mirror of
https://github.com/visualboyadvance-m/visualboyadvance-m
synced 2025-10-05 23:52:49 +02:00
build: use libsamplerate with vcpkg sdl2 port
Enable the samplerate feature for the vcpkg sdl2 port to use libsamplerate for resampling. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
@@ -45,7 +45,7 @@ if(TAG_RELEASE)
|
||||
include(MakeReleaseCommitAndTag)
|
||||
endif()
|
||||
|
||||
set(VCPKG_DEPS pkgconf zlib sdl2 gettext wxwidgets)
|
||||
set(VCPKG_DEPS pkgconf zlib "sdl2[samplerate]" gettext wxwidgets)
|
||||
|
||||
set(VCPKG_DEPS_OPTIONAL
|
||||
sfml ENABLE_LINK
|
||||
|
@@ -202,6 +202,25 @@ IF(SDL2_LIBRARY_TEMP)
|
||||
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP} -lversion -limm32)
|
||||
ENDIF(MINGW)
|
||||
|
||||
# Add libsamplerate with vcpkg
|
||||
if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg")
|
||||
if(WIN32)
|
||||
unset(arch_suffix)
|
||||
unset(path_prefix)
|
||||
if(VCPKG_TARGET_TRIPLET MATCHES -static)
|
||||
set(arch_suffix -static)
|
||||
endif()
|
||||
if(CMAKE_BUILD_TYPE MATCHES "^(Debug|RelWithDebInfo)$")
|
||||
set(path_prefix debug)
|
||||
endif()
|
||||
set(installed_prefix ${_VCPKG_INSTALLED_DIR}/${WINARCH}-windows${arch_suffix}/${path_prefix})
|
||||
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${installed_prefix}/lib/samplerate.lib)
|
||||
else()
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} -lsamplerate)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Add some stuff from pkg-config, if available
|
||||
IF(NOT PKG_CONFIG_EXECUTABLE)
|
||||
FIND_PACKAGE(PkgConfig QUIET)
|
||||
|
Reference in New Issue
Block a user