llvm.org GIT mirror llvm / 91d509f
cmake: Error on invalid CMAKE_BUILD_TYPE Apparently if you make a typo in the argument to CMAKE_BUILD_TYPE, cmake silently accepts this but doesn't apply any particular build type to your build. This means you get a build that doesn't really make any sense - it's sort of a debug build with asserts disabled. Error out instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244406 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Bogner 5 years ago
1 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
44 if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
55 message(STATUS "No build type selected, default to Debug")
66 set(CMAKE_BUILD_TYPE "Debug")
7 endif()
8
9 if (CMAKE_BUILD_TYPE AND
10 NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
11 message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
712 endif()
813
914 if(POLICY CMP0022)