authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2020-02-04 22:34:46-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-02-04 22:34:46-05:00
log25cbee0b84074368c23b7540a63cba83162e4b73
tree77de20ef7c7cfbf8d95258584db1a0cd81cc2957
parent3e7c02edc183a1b869c004d89debcefbd74bcdeb
parentc6df5deb3450e0d8a2ba449c34a0bd195fbce8ec
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #4390 from mikdusan/cherry-pick

stage1: guard against case-mismatched build types

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

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