From d5395ac793d1db78ab97ca144d5e89eabf49a735 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 2 Dec 2017 23:57:17 -0800 Subject: [PATCH] [speex] Fix debug mode .def file. Add exports for extern globals. --- ports/speex/CMakeLists.txt | 13 ++++++++++--- ports/speex/CONTROL | 2 +- ports/speex/portfile.cmake | 6 ++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ports/speex/CMakeLists.txt b/ports/speex/CMakeLists.txt index 839222ae6f..915b082268 100644 --- a/ports/speex/CMakeLists.txt +++ b/ports/speex/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required (VERSION 3.8.0) project (libspeex C) -set(COMMON_INCLUDES ${PROJECT_BINARY_DIR}/include) - option(USE_SSE "USE_SSE used Note: USE_SSE and FIXED_POINT are mutually exclusive." ON) if(MSVC) add_definitions(-DHAVE_CONFIG_H) @@ -17,6 +15,15 @@ include_directories(win32 include) set(CMAKE_DEBUG_POSTFIX d) +file(READ "win32/libspeex.def" _contents) +string(REPLACE "LIBRARY libspeex" "LIBRARY libspeexd" _contents "${_contents}") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libspeex.def" + "${_contents}\n" + "speex_nb_mode\n" + "speex_wb_mode\n" + "speex_uwb_mode\n" +) + set(SRC "libspeex/bits.c" "libspeex/cb_search.c" @@ -52,7 +59,7 @@ set(SRC "libspeex/vbr.c" "libspeex/vq.c" "libspeex/window.c" - "win32/libspeex.def" + "${CMAKE_CURRENT_BINARY_DIR}/libspeex.def" ) add_library(libspeex ${SRC}) diff --git a/ports/speex/CONTROL b/ports/speex/CONTROL index 5d3fa10a20..00910a5967 100644 --- a/ports/speex/CONTROL +++ b/ports/speex/CONTROL @@ -1,3 +1,3 @@ Source: speex -Version: 1.2.0-1 +Version: 1.2.0-2 Description: Speex is an Open Source/Free Software patent-free audio compression format designed for speech. diff --git a/ports/speex/portfile.cmake b/ports/speex/portfile.cmake index 6eed0cfc91..271c2bc887 100644 --- a/ports/speex/portfile.cmake +++ b/ports/speex/portfile.cmake @@ -18,4 +18,10 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(READ "${CURRENT_PACKAGES_DIR}/include/speex/speex.h" _contents) + string(REPLACE "extern const SpeexMode" "__declspec(dllimport) extern const SpeexMode" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/include/speex/speex.h" "${_contents}") +endif() + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/speex RENAME copyright)