[speex] Fix debug mode .def file. Add exports for extern globals.

This commit is contained in:
Robert Schumacher 2017-12-02 23:57:17 -08:00
parent 71f8958a06
commit d5395ac793
3 changed files with 17 additions and 4 deletions

View File

@ -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})

View File

@ -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.

View File

@ -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)