CMake: Directly link to SDL2-static when appropriate
Trying to be lazy and alias SDL2 to SDL2-static causes issues in later versions of CMake. Just use the same condition to tell which one to use.
This commit is contained in:
parent
47b133c0b8
commit
0941ae0b61
1
externals/CMakeLists.txt
vendored
1
externals/CMakeLists.txt
vendored
|
@ -69,7 +69,6 @@ if (YUZU_USE_EXTERNAL_SDL2)
|
||||||
set(SDL_SHARED OFF)
|
set(SDL_SHARED OFF)
|
||||||
|
|
||||||
add_subdirectory(SDL EXCLUDE_FROM_ALL)
|
add_subdirectory(SDL EXCLUDE_FROM_ALL)
|
||||||
add_library(SDL2 ALIAS SDL2-static)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ENet
|
# ENet
|
||||||
|
|
|
@ -226,6 +226,10 @@ if(ENABLE_CUBEB)
|
||||||
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
|
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
|
||||||
endif()
|
endif()
|
||||||
if(ENABLE_SDL2)
|
if(ENABLE_SDL2)
|
||||||
|
if (YUZU_USE_EXTERNAL_SDL2)
|
||||||
|
target_link_libraries(audio_core PRIVATE SDL2-static)
|
||||||
|
else()
|
||||||
target_link_libraries(audio_core PRIVATE SDL2)
|
target_link_libraries(audio_core PRIVATE SDL2)
|
||||||
|
endif()
|
||||||
target_compile_definitions(audio_core PRIVATE HAVE_SDL2)
|
target_compile_definitions(audio_core PRIVATE HAVE_SDL2)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -55,7 +55,11 @@ if (ENABLE_SDL2)
|
||||||
drivers/sdl_driver.cpp
|
drivers/sdl_driver.cpp
|
||||||
drivers/sdl_driver.h
|
drivers/sdl_driver.h
|
||||||
)
|
)
|
||||||
|
if (YUZU_USE_EXTERNAL_SDL2)
|
||||||
|
target_link_libraries(input_common PRIVATE SDL2-static)
|
||||||
|
else()
|
||||||
target_link_libraries(input_common PRIVATE SDL2)
|
target_link_libraries(input_common PRIVATE SDL2)
|
||||||
|
endif()
|
||||||
target_compile_definitions(input_common PRIVATE HAVE_SDL2)
|
target_compile_definitions(input_common PRIVATE HAVE_SDL2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,11 @@ if (YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_LESS 6)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_SDL2)
|
if (ENABLE_SDL2)
|
||||||
|
if (YUZU_USE_EXTERNAL_SDL2)
|
||||||
|
target_link_libraries(yuzu PRIVATE SDL2-static)
|
||||||
|
else()
|
||||||
target_link_libraries(yuzu PRIVATE SDL2)
|
target_link_libraries(yuzu PRIVATE SDL2)
|
||||||
|
endif()
|
||||||
target_compile_definitions(yuzu PRIVATE HAVE_SDL2)
|
target_compile_definitions(yuzu PRIVATE HAVE_SDL2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue