1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

CMake: Use find_package to find SDL2

This ensures that the SDL2 uses an absolute library path, which is
necessary when SDL2 isn't present in the default link directories (e.g.
on macOS).
This commit is contained in:
Alex James 2021-01-16 02:15:06 -06:00 committed by Ivan
parent 3567c43fb5
commit d7a8d385d8
2 changed files with 7 additions and 4 deletions

View File

@ -354,7 +354,7 @@ target_link_libraries(3rdparty_openal INTERFACE ${OPENAL_LIBRARY})
set(FAUDIO_TARGET 3rdparty_dummy_lib)
if(USE_FAUDIO)
# FAudio depends on SDL2
pkg_check_modules(SDL2 sdl2)
find_package(SDL2)
if (NOT SDL2_FOUND OR SDL2_VERSION VERSION_LESS 2.0.9)
message("-- RPCS3: FAudio requires SDL 2.0.9 or newer.")
else()

View File

@ -122,9 +122,12 @@ if(USE_PULSE AND PULSE_FOUND)
target_link_libraries(rpcs3_emu PUBLIC 3rdparty::pulse)
endif()
if(USE_FAUDIO AND SDL2_FOUND AND NOT SDL2_VERSION VERSION_LESS 2.0.9)
target_sources(rpcs3_emu PRIVATE Audio/FAudio/FAudioBackend.cpp)
target_link_libraries(rpcs3_emu PUBLIC 3rdparty::faudio)
if(USE_FAUDIO)
find_package(SDL2)
if(SDL2_FOUND AND NOT SDL2_VERSION VERSION_LESS 2.0.9)
target_sources(rpcs3_emu PRIVATE Audio/FAudio/FAudioBackend.cpp)
target_link_libraries(rpcs3_emu PUBLIC 3rdparty::faudio)
endif()
endif()
if(WIN32)