From b72b9d3973c5e3042ec2e63958077d585367e799 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 3 Apr 2022 17:14:35 +0200 Subject: [PATCH] cmake: print a warning if SDL version is between 2.16 and 2.20 included, ref #600 --- CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49b82e30e8..80c4cbb589 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -623,8 +623,21 @@ 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) + find_package(SDL2 QUIET CONFIG) + if(SDL2_FOUND) + 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") + 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(WARNING "SDL version is unknown, version can't be checked for known bugs") + endif() + include_directories(${SDL2_INCLUDE_DIR}) + if (WIN32) set(LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} ${SDL2_LIBRARY}) else()