mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-25 15:43:44 +01:00
bf89c3503d
- Sets dependencies for targets - Fixes not being able to build single targets, like `make vgmstream_cli` - Fixes not being able to build with multiple jobs, like `make -j 5` - Compiles dependencies out of the source directory - Fixes double lib suffix, renaming liblibvgmstream.a to libvgmstream.a - Removes zlib dependency from static builds, previously required by ffmpeg - If ARCHIVE_EXTRACT is not available in cmake, mpg123 will be downloaded through svn, then fall back to git if that is not available either
54 lines
1.4 KiB
CMake
54 lines
1.4 KiB
CMake
if(NOT WIN32 AND USE_SPEEX)
|
|
if(NOT SPEEX_PATH)
|
|
find_package(Speex QUIET)
|
|
|
|
if(Speex_FOUND)
|
|
set(SPEEX_SOURCE "(system)")
|
|
endif()
|
|
endif()
|
|
if(SPEEX_PATH OR NOT Speex_FOUND)
|
|
FetchDependency(SPEEX
|
|
DIR speex
|
|
GIT_REPOSITORY https://gitlab.xiph.org/xiph/speex
|
|
GIT_TAG 870ff845b32f314aec0036641ffe18aba4916887
|
|
)
|
|
|
|
if(SPEEX_PATH)
|
|
set(SPEEX_LINK_PATH ${SPEEX_BIN}/libspeex/.libs/libspeex.a)
|
|
|
|
if(NOT EXISTS ${SPEEX_PATH}/configure)
|
|
add_custom_target(SPEEX_AUTORECONF
|
|
COMMAND ./autogen.sh
|
|
BYPRODUCTS ${SPEEX_PATH}/configure
|
|
WORKING_DIRECTORY ${SPEEX_PATH}
|
|
)
|
|
endif()
|
|
|
|
file(MAKE_DIRECTORY ${SPEEX_BIN})
|
|
add_custom_target(SPEEX_CONFIGURE
|
|
COMMAND "${SPEEX_PATH}/configure" --enable-static --disable-shared --disable-binaries CC="${CMAKE_C_COMPILER}" AR="${CMAKE_AR}"
|
|
DEPENDS ${SPEEX_PATH}/configure
|
|
BYPRODUCTS ${SPEEX_BIN}/Makefile
|
|
WORKING_DIRECTORY ${SPEEX_BIN}
|
|
)
|
|
add_custom_target(SPEEX_MAKE
|
|
COMMAND make
|
|
DEPENDS ${SPEEX_BIN}/Makefile
|
|
BYPRODUCTS ${SPEEX_LINK_PATH} ${SPEEX_BIN}
|
|
WORKING_DIRECTORY ${SPEEX_BIN}
|
|
)
|
|
|
|
add_library(speex STATIC IMPORTED)
|
|
if(NOT EXISTS ${SPEEX_LINK_PATH})
|
|
add_dependencies(speex SPEEX_MAKE)
|
|
endif()
|
|
set_target_properties(speex PROPERTIES
|
|
IMPORTED_LOCATION ${SPEEX_LINK_PATH}
|
|
)
|
|
endif()
|
|
endif()
|
|
endif()
|
|
if(NOT USE_SPEEX)
|
|
unset(SPEEX_SOURCE)
|
|
endif()
|