Update builds for libspeex

This commit is contained in:
bnnm 2021-01-23 16:44:16 +01:00
parent 9d41ef13ac
commit 628e98116b
6 changed files with 42 additions and 3 deletions

View File

@ -38,12 +38,14 @@ jobs:
run: |
$fb2kFiles = @(
"ext_libs/*.dll",
"ext_libs/libspeex/*.dll",
"Release/foo_input_vgmstream.dll",
"README.md"
)
$cliFiles = @(
"ext_libs/*.dll",
"ext_libs/libspeex/*.dll",
"Release/in_vgmstream.dll",
"Release/test.exe",
"Release/xmp-vgmstream.dll",

4
.gitignore vendored
View File

@ -24,6 +24,10 @@ Release
/ext_libs/Release
/ext_libs/*.exp
/ext_libs/*.lib
/ext_libs/libspeex/Debug
/ext_libs/libspeex/Release
/ext_libs/libspeex/*.exp
/ext_libs/libspeex/*.lib
/ext_libs/Getopt/Debug
/ext_libs/Getopt/Release
/fb2k/Debug

View File

@ -23,7 +23,8 @@ if(WIN32)
# May need to see if it is possible to get these to work on non-Windows systems too
option(USE_G719 "Use libg719_decode for support ITU-T G.719" ON)
option(USE_ATRAC9 "Use LibAtrac9 for support of ATRAC9" ON)
option(USE_CELT "Use libcelt for support of FSB CELT versions 0.6.1 and 0.11.0" ON)
option(USE_CELT "Use libcelt for support of FSB CELT versions 0.6.1 and 0.11.0" ON)
option(USE_SPEEX "Use libspeex for support of SPEEX" ON)
endif()
# Build choices
@ -227,7 +228,8 @@ message(STATUS " G.722.1: ${USE_G7221}")
if(WIN32)
message(STATUS " G.719: ${USE_G719}")
message(STATUS " ATRAC9: ${USE_ATRAC9}")
message(STATUS " FSB CELT: ${USE_CELT}")
message(STATUS " FSB CELT: ${USE_CELT}")
message(STATUS " SPEEX: ${USE_SPEEX}")
endif()
message(STATUS "")

View File

@ -109,6 +109,14 @@ macro(setup_target TARGET)
${VGM_BINARY_DIR}/ext_libs/libcelt-0110.lib)
endif()
endif()
if(USE_SPEEX)
target_compile_definitions(${TARGET} PRIVATE VGM_USE_SPEEX)
if(LINK)
add_dependencies(${TARGET} libspeex)
target_link_libraries(${TARGET} ${VGM_BINARY_DIR}/ext_libs/libspeex/libspeex.lib)
endif()
endif()
endmacro()
# Installs the DLLs to the given install prefix
@ -126,6 +134,7 @@ macro(install_dlls INSTALL_PREFIX)
set(CELT_DLL
${VGM_SOURCE_DIR}/ext_libs/libcelt-0061.dll
${VGM_SOURCE_DIR}/ext_libs/libcelt-0110.dll)
set(SPEEX_DLL ${VGM_SOURCE_DIR}/ext_libs/libspeex/libspeex.dll)
# List of DLLs to check for install
set(DLLS
@ -135,7 +144,8 @@ macro(install_dlls INSTALL_PREFIX)
G719
FFMPEG
ATRAC9
CELT)
CELT
SPEEX)
# Loop over DLLs and only install if the USE_* is set for that DLL
foreach(DLL ${DLLS})

View File

@ -104,6 +104,7 @@ The following options are currently only available for Windows:
- **USE_G719**: Chooses if you wish to use libg719_decode for support ITU-T G.719. The default is `ON`.
- **USE_ATRAC9**: Chooses if you wish to use LibAtrac9 for support of ATRAC9. The default is `ON`.
- **USE_CELT**: Chooses if you wish to use libcelt for support of FSB CELT versions 0.6.1 and 0.11.0. The default is `ON`.
- **USE_SPEEX**: Chooses if you wish to use libspeex for support of SPEEX. The default is `ON`.
#### Build Options

View File

@ -101,6 +101,17 @@ if(MSVC)
${CMAKE_CURRENT_BINARY_DIR}/libcelt-0110.lib
SOURCES ${CELT_HEADERS})
endif()
if(USE_SPEEX)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libspeex/libspeex.lib ${CMAKE_CURRENT_BINARY_DIR}/libspeex/libspeex.exp
COMMAND lib
ARGS /def:${CMAKE_CURRENT_SOURCE_DIR}/libspeex/libspeex.def /machine:x86 /out:${CMAKE_CURRENT_BINARY_DIR}/libspeex/libspeex.lib
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libspeex/libspeex.def)
file(GLOB SPEEX_HEADERS "${VGM_SOURCE_DIR}/ext_includes/speex/*.h")
add_custom_target(libspeex
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/libspeex/libspeex.lib
SOURCES ${SPEEX_HEADERS})
endif()
elseif(MINGW)
if(NOT DLLTOOL)
set(DLLTOOL dlltool)
@ -181,4 +192,13 @@ elseif(MINGW)
${CMAKE_CURRENT_BINARY_DIR}/libcelt-0061.lib
${CMAKE_CURRENT_BINARY_DIR}/libcelt-0110.lib)
endif()
if(USE_SPEEX)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libspeex/libspeex.lib
COMMAND ${DLLTOOL}
ARGS -d ${CMAKE_CURRENT_SOURCE_DIR}/libspeex/libspeex.def -l ${CMAKE_CURRENT_BINARY_DIR}/libspeex/libspeex.lib
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libspeex/libspeex.def)
add_custom_target(libspeex
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/libspeex/libspeex.lib)
endif()
endif()