mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 00:08:56 +00:00
Merge pull request #4441 from mikdusan/stage1-cmake
stage1: limit cmake checks on build type
This commit is contained in:
commit
1fb70497d2
@ -5,16 +5,21 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
||||
endif()
|
||||
|
||||
set(_list "None;Debug;Release;RelWithDebInfo;MinSizeRel")
|
||||
list(FIND _list ${CMAKE_BUILD_TYPE} _index)
|
||||
if(${_index} EQUAL -1)
|
||||
string(REPLACE ";" ", " _list_pretty "${_list}")
|
||||
message("::")
|
||||
message(":: ERROR: Invalid build type: ${CMAKE_BUILD_TYPE}")
|
||||
message("::")
|
||||
message(":: valid types: { ${_list_pretty} }")
|
||||
message("::")
|
||||
message(FATAL_ERROR)
|
||||
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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user