Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Beatrici <git@davidebeatrici.dev>2020-07-01 18:12:55 +0300
committerDavide Beatrici <git@davidebeatrici.dev>2020-07-11 20:34:49 +0300
commit2fc3c01f0c148f0b9cf2c68298cc3cd1924d4cd8 (patch)
tree9a41d01ec40563b271f3a2979123288a6b70d721 /3rdparty
parent369c855570af9940152e47c778131c70c67ea0a7 (diff)
3rdparty/speex-build: add CMake project
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/speex-build/CMakeLists.txt94
1 files changed, 94 insertions, 0 deletions
diff --git a/3rdparty/speex-build/CMakeLists.txt b/3rdparty/speex-build/CMakeLists.txt
new file mode 100644
index 000000000..fc3b2a53b
--- /dev/null
+++ b/3rdparty/speex-build/CMakeLists.txt
@@ -0,0 +1,94 @@
+set(SPEEX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../speex-src")
+set(SPEEXDSP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../speexdsp-src")
+
+set(SPEEX_SRC_DIR "${SPEEX_DIR}/libspeex")
+set(SPEEXDSP_SRC_DIR "${SPEEXDSP_DIR}/libspeexdsp")
+
+if(NOT EXISTS "${SPEEX_DIR}/COPYING" OR NOT EXISTS "${SPEEXDSP_DIR}/COPYING")
+ message(FATAL_ERROR
+ "${SPEEX_DIR} or ${SPEEXDSP_DIR} was not found. You need to do one of the following:\n"
+ "Option 1: Checkout the submodule:\n"
+ "git submodule update --init --recursive\n"
+ "Option 2: Use system Speex and SpeexDSP (v1.2 or later):\n"
+ "cmake .. -Dbundled-speex=OFF"
+ )
+endif()
+
+if(WIN32)
+ add_library(speex SHARED)
+ set_target_properties(speex PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+ if(MINGW)
+ # Remove "lib" prefix.
+ set_target_properties(speex PROPERTIES PREFIX "")
+ endif()
+else()
+ add_library(speex STATIC)
+endif()
+
+target_compile_definitions(speex PRIVATE "HAVE_CONFIG_H")
+
+target_include_directories(speex PRIVATE SYSTEM "${SPEEX_DIR}/libspeex" "${SPEEXDSP_DIR}/libspeexdsp")
+target_include_directories(speex PUBLIC SYSTEM "${SPEEX_DIR}/include" "${SPEEXDSP_DIR}/include")
+
+if(MSVC)
+ # We include "win32" only for MSVC because MinGW uses the "config.h" for Unix-like systems.
+ target_include_directories(speex PRIVATE SYSTEM BEFORE "${CMAKE_CURRENT_SOURCE_DIR}/win32")
+else()
+ target_include_directories(speex PUBLIC SYSTEM ${CMAKE_CURRENT_SOURCE_DIR})
+endif()
+
+if(WIN32)
+ target_compile_definitions(speex PRIVATE "_USE_MATH_DEFINES" "USE_SMALLFT")
+ target_sources(speex PRIVATE "mumble_speex_init.c")
+endif()
+
+set(SPEEXDSP_SOURCES
+ "${SPEEXDSP_SRC_DIR}/fftwrap.c"
+ "${SPEEXDSP_SRC_DIR}/filterbank.c"
+ "${SPEEXDSP_SRC_DIR}/jitter.c"
+ "${SPEEXDSP_SRC_DIR}/mdf.c"
+ "${SPEEXDSP_SRC_DIR}/preprocess.c"
+ "${SPEEXDSP_SRC_DIR}/resample.c"
+ "${SPEEXDSP_SRC_DIR}/scal.c"
+ "${SPEEXDSP_SRC_DIR}/smallft.c"
+)
+
+set(SPEEX_SOURCES
+ "${SPEEX_SRC_DIR}/bits.c"
+ "${SPEEX_SRC_DIR}/cb_search.c"
+ "${SPEEX_SRC_DIR}/exc_5_64_table.c"
+ "${SPEEX_SRC_DIR}/exc_5_256_table.c"
+ "${SPEEX_SRC_DIR}/exc_8_128_table.c"
+ "${SPEEX_SRC_DIR}/exc_10_16_table.c"
+ "${SPEEX_SRC_DIR}/exc_10_32_table.c"
+ "${SPEEX_SRC_DIR}/exc_20_32_table.c"
+ "${SPEEX_SRC_DIR}/filters.c"
+ "${SPEEX_SRC_DIR}/gain_table.c"
+ "${SPEEX_SRC_DIR}/gain_table_lbr.c"
+ "${SPEEX_SRC_DIR}/hexc_10_32_table.c"
+ "${SPEEX_SRC_DIR}/hexc_table.c"
+ "${SPEEX_SRC_DIR}/high_lsp_tables.c"
+ "${SPEEX_SRC_DIR}/kiss_fft.c"
+ "${SPEEX_SRC_DIR}/kiss_fftr.c"
+ "${SPEEX_SRC_DIR}/lpc.c"
+ "${SPEEX_SRC_DIR}/lsp.c"
+ "${SPEEX_SRC_DIR}/lsp_tables_nb.c"
+ "${SPEEX_SRC_DIR}/ltp.c"
+ "${SPEEX_SRC_DIR}/modes.c"
+ "${SPEEX_SRC_DIR}/modes_wb.c"
+ "${SPEEX_SRC_DIR}/nb_celp.c"
+ "${SPEEX_SRC_DIR}/quant_lsp.c"
+ "${SPEEX_SRC_DIR}/sb_celp.c"
+ "${SPEEX_SRC_DIR}/speex.c"
+ "${SPEEX_SRC_DIR}/speex_callbacks.c"
+ "${SPEEX_SRC_DIR}/speex_header.c"
+ "${SPEEX_SRC_DIR}/stereo.c"
+ "${SPEEX_SRC_DIR}/vbr.c"
+ "${SPEEX_SRC_DIR}/vorbis_psy.c"
+ "${SPEEX_SRC_DIR}/vq.c"
+ "${SPEEX_SRC_DIR}/window.c"
+)
+
+target_sources(speex PRIVATE ${SPEEXDSP_SOURCES} ${SPEEX_SOURCES} "speex.def")
+
+target_disable_warnings(speex)