authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2020-02-04 15:50:11-05:00
committergravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2020-02-04 20:39:05-05:00
logc6df5deb3450e0d8a2ba449c34a0bd195fbce8ec
tree77de20ef7c7cfbf8d95258584db1a0cd81cc2957
parent3e7c02edc183a1b869c004d89debcefbd74bcdeb
signaturelock-open Commit is signed but in an unrecognized format.

stage1: guard against case-mismatched build types

- zig CMakeLists.txt CMAKE_BUILD_TYPE string comparisons are case-sensitive - cmake itself is unclear about how tolerant it is for case-mismatches - add CMAKE_BUILD_TYPE guard in CMakeLists.txt to force exact matches

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)