]> git.ipfire.org Git - thirdparty/ccache.git/blame - cmake/DefaultBuildType.cmake
fix: Avoid crash for -arch as last compiler option
[thirdparty/ccache.git] / cmake / DefaultBuildType.cmake
CommitLineData
999f4f75 1# Set a default build type if none was specified.
f2341b2b 2
999f4f75
JR
3if(CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES)
4 return()
5endif()
f2341b2b 6
999f4f75
JR
7# Default to Release for end user builds (from source archive) and Debug for
8# development builds (in a Git repository).
533393e6 9if(CCACHE_DEV_MODE)
999f4f75
JR
10 set(
11 CMAKE_BUILD_TYPE "Debug"
12 CACHE STRING "Choose the type of build." FORCE)
13else()
14 set(
15 CMAKE_BUILD_TYPE "Release"
16 CACHE STRING "Choose the type of build." FORCE)
f2341b2b 17endif()
999f4f75
JR
18message(
19 STATUS
20 "Setting CMAKE_BUILD_TYPE to ${CMAKE_BUILD_TYPE} as none was specified."
21)
22
23# Set the possible values of build type for CMake UIs.
24set_property(
25 CACHE CMAKE_BUILD_TYPE
26 PROPERTY
27 STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")