[cmake] make CMAKE_BUILD_TYPE selectable
This commit is contained in:
parent
fb1ce1eb53
commit
24954bf6ed
@ -30,8 +30,16 @@ if (NOT ANDROID)
|
||||
endif()
|
||||
|
||||
# Default to release build type
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default")
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
# Set a default build type if none was specified
|
||||
set(default_build_type "Release")
|
||||
|
||||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
||||
STRING "Choose the type of build." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
include(PlatformDefaults)
|
||||
|
Loading…
Reference in New Issue
Block a user