File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.16)
22
3+ if (NOT DEFINED CMAKE_BUILD_TYPE )
4+ set (cmake_build_type_undefined 1)
5+ endif ()
6+
37# See docs/release_checklist.md
48project (SDL3 LANGUAGES C VERSION "3.1.7" )
59
913 set (SDL3_SUBPROJECT ON )
1014endif ()
1115
16+ # By default, configure SDL3 in RelWithDebInfo configuration
17+ if (NOT SDL3_SUBPROJECT)
18+ get_property (is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
19+ if (is_multi_config)
20+ # The first item in CMAKE_CONFIGURATION_TYPES is the default configuration
21+ if (DEFINED CMAKE_CONFIGURATION_TYPES AND "RelWithDebInfo" IN_LIST CMAKE_CONFIGURATION_TYPES )
22+ list (REMOVE_ITEM CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" )
23+ list (INSERT CMAKE_CONFIGURATION_TYPES 0 "RelWithDebInfo" )
24+ set (CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES} " CACHE STRING "CMake configuration types" FORCE)
25+ endif ()
26+ else ()
27+ if (cmake_build_type_undefined)
28+ set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "CMake build type" FORCE)
29+ endif ()
30+ endif ()
31+ endif ()
32+
1233# CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)"
1334# CMake 3.24+ emits a warning when not set.
1435unset (OFF )
You can’t perform that action at this time.
0 commit comments