CMake: Fix X11 + SDL_mixer build

Stop using SDL2_FOUND to determine if SDL2 should be used or not,
because it may be defined as a side effect of
pkg_check_modules(SDL2_mixer).
This commit is contained in:
kichikuou
2020-06-27 15:05:56 +09:00
parent 426cdaa836
commit 1cd949f597
2 changed files with 3 additions and 6 deletions
+2 -5
View File
@@ -71,10 +71,7 @@ else()
optional_find_package(Freetype)
include(FindPkgConfig)
if (NOT X11_FOUND)
optional_pkg_check_modules(SDL2 IMPORTED_TARGET sdl2)
endif()
optional_pkg_check_modules(SDL2 IMPORTED_TARGET sdl2)
optional_pkg_check_modules(SDL2MIXER IMPORTED_TARGET SDL2_mixer)
optional_pkg_check_modules(SDL2TTF IMPORTED_TARGET SDL2_ttf)
@@ -202,7 +199,7 @@ endif()
if (EMSCRIPTEN OR ANDROID)
set(SRC_JOYSTICK joystick_dmy.c)
elseif (SDL2_FOUND)
elseif (ENABLE_SDL)
set(SRC_JOYSTICK joystick_sdl.c)
set(SUMMARY_JOYSTICK "SDL")
set(HAVE_SDLJOY 1)
+1 -1
View File
@@ -93,7 +93,7 @@ else() # non-emscripten, non-android
if (FREETYPE_FOUND)
target_link_libraries(xsystem35 PRIVATE Freetype::Freetype)
endif()
if (SDL2_FOUND)
if (ENABLE_SDL)
target_link_libraries(xsystem35 PRIVATE PkgConfig::SDL2)
endif()
if (SDL2MIXER_FOUND)