Commit 8f33de84621319a5504f2197854a2e5c03ae5dea

Anonymous Maarten 2022-07-21T14:08:19

cmake: set CMP0054 policy to NEW

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 12d6ece..9d33d12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,13 @@ if(MSVC)
   target_compile_options(sdl-build-options INTERFACE "/MP")
 endif(MSVC)
 
+# CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"
+# CMake 3.24+ emits a warning when not set.
+unset(OFF)
+unset(ON)
+if(POLICY CMP0054)
+  cmake_policy(SET CMP0054 NEW)
+endif()
 
 # !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property
 # !!! FIXME:  for the SDL2 shared library (so you get an