Skip to content

Commit

Permalink
Fix SDL autodetection
Browse files Browse the repository at this point in the history
Moving to the official SDL2 config resulted in a few variables now following
the standard CMake naming conventions. Use the new names when checking whether
SDL is present.
  • Loading branch information
lmoureaux authored and jwrober committed Dec 17, 2023
1 parent 8fb346b commit 8d2ab53
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cmake/FreecivDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,16 @@ if(FREECIV_ENABLE_NLS)
endif()

# SDL2 for audio
find_package(SDL2 QUIET)
find_package(SDL2_mixer QUIET)
if (SDL2_MIXER_LIBRARIES AND SDL2_LIBRARY)
find_package(SDL2)
find_package(SDL2_mixer)
if (SDL2_MIXER_LIBRARIES AND SDL2_FOUND)
set(AUDIO_SDL TRUE)
endif()
if (NOT SDL2_LIBRARY)
message("SDL2 not found")
set(SDL2_INCLUDE_DIR "")
if (NOT SDL2_FOUND)
message(STATUS "SDL2 not found - audio support disabled")
endif()
if (NOT SDL2_MIXER_LIBRARIES)
message("SDL2_mixer not found")
message(STATUS "SDL2_mixer not found - audio support disabled")
set(SDL2_MIXER_LIBRARIES "")
set(SDL2_MIXER_INCLUDE_DIR "")
endif()
Expand Down

0 comments on commit 8d2ab53

Please sign in to comment.