mirror of
https://github.com/RPCS3/rpcs3
synced 2024-09-06 00:17:03 +00: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:
parent
3567c43fb5
commit
d7a8d385d8
2
3rdparty/CMakeLists.txt
vendored
2
3rdparty/CMakeLists.txt
vendored
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue