authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-13 20:47:44-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-13 20:47:44-05:00
logfb6b94f80fed42b4c690b43a875bf0a58977493e
tree74fcd751e35852e6b5d1defe990327c55c40c2b2
parentcf67d30cdcdd46264e59184ff6a1bf9062a77878
signaturelock-open Commit is signed but in an unrecognized format.

cmake: remove case mismatch detection on build mode

See discussion here for context: https://github.com/ziglang/zig/commit/c6df5deb3450e0d8a2ba449c34a0bd195fbce8ec#comments Michael - I appreciate what you did here, making the configure script work better for people in practice. When it was checking the build type against a whitelist, I think it was worth it. However, now that we are supporting systems which use non-standard cmake build modes, I don't think this case-mismatch detection thing is worth it. It's starting to get to the point where it's a lot of complication for very little benefit. Besides, cmake is not case sensitive. If we support non-standard build modes, then we would need to support a hypothetical build mode of `release` (lower case). So let's just remove this and rely on people to use the build system correctly (like they will have to do when building any cmake project from source).

1 files changed, 0 insertions(+), 17 deletions(-)

CMakeLists.txt-17
...@@ -5,23 +5,6 @@ if(NOT CMAKE_BUILD_TYPE)...@@ -5,23 +5,6 @@ if(NOT CMAKE_BUILD_TYPE)
5 "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)5 "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
6endif()6endif()
77
8set(_list "Debug;Release;RelWithDebInfo;MinSizeRel")
9string(TOLOWER "${_list}" _list_lower)
10string(TOLOWER ${CMAKE_BUILD_TYPE} _build_type_lower)
11list(FIND _list_lower "${_build_type_lower}" _index)
12if(NOT ${_index} EQUAL -1)
13 list(FIND _list "${CMAKE_BUILD_TYPE}" _index)
14 if(${_index} EQUAL -1)
15 string(REPLACE ";" ", " _list_pretty "${_list}")
16 message("::")
17 message(":: ERROR: build type case-mismatch: ${CMAKE_BUILD_TYPE}")
18 message("::")
19 message(":: valid types: { ${_list_pretty} }")
20 message("::")
21 message(FATAL_ERROR)
22 endif()
23endif()
24
25if(NOT CMAKE_INSTALL_PREFIX)8if(NOT CMAKE_INSTALL_PREFIX)
26 set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING9 set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING
27 "Directory to install zig to" FORCE)10 "Directory to install zig to" FORCE)