Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: print a warning if SDL version is between 2.16 and 2.20 included, ref #600 #621

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,27 @@ endif()

# SDL, required for all targets on win32 because of iconv and SDL_SetHint(SDL_TIMER_RESOLUTION, 0)
if (BUILD_CLIENT OR WIN32)
find_package(SDL2 REQUIRED)
if(LINUX)
find_package(SDL2 QUIET CONFIG)
if(SDL2_VERSION)
if (SDL2_VERSION VERSION_GREATER_EQUAL "2.16"
AND SDL2_VERSION VERSION_LESS_EQUAL "2.20")
message(WARNING "SDL ${SDL2_VERSION} between version 2.16 and 2.20 is known to be buggy, see https://github.com/DaemonEngine/Daemon/issues/600")
illwieckz marked this conversation as resolved.
Show resolved Hide resolved
endif()
else()
# CMake may be able to find SDL2 without supporting CONFIG
# If sdl2-config.cmake or SDL2Config.cmake isn't provided.
find_package(SDL2 REQUIRED)
message(STATUS "SDL version is unknown, version can't be checked for known bugs")
endif()
else()
# Non-Linux systems use pre-compiled SDL we provide,
# so no one is using unapproved version.
find_package(SDL2 REQUIRED)
endif()

include_directories(${SDL2_INCLUDE_DIR})

if (WIN32)
set(LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} ${SDL2_LIBRARY})
else()
Expand Down