From fb6b94f80fed42b4c690b43a875bf0a58977493e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 13 Feb 2020 20:47:44 -0500 Subject: [PATCH] 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). --- CMakeLists.txt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6d5a9e810..71d4e2cda3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,23 +5,6 @@ if(NOT CMAKE_BUILD_TYPE) "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() -set(_list "Debug;Release;RelWithDebInfo;MinSizeRel") -string(TOLOWER "${_list}" _list_lower) -string(TOLOWER ${CMAKE_BUILD_TYPE} _build_type_lower) -list(FIND _list_lower "${_build_type_lower}" _index) -if(NOT ${_index} EQUAL -1) - list(FIND _list "${CMAKE_BUILD_TYPE}" _index) - if(${_index} EQUAL -1) - string(REPLACE ";" ", " _list_pretty "${_list}") - message("::") - message(":: ERROR: build type case-mismatch: ${CMAKE_BUILD_TYPE}") - message("::") - message(":: valid types: { ${_list_pretty} }") - message("::") - message(FATAL_ERROR) - endif() -endif() - if(NOT CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING "Directory to install zig to" FORCE)