Support for default build types

This commit is contained in:
John Machado 2022-07-04 21:28:21 +05:30 committed by GitHub
parent 102bb47557
commit e199903917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -151,6 +151,10 @@ else()
set(CMAKE_BUILD_TYPE "ReleaseInternal")
elseif("${BUILD_TYPE}" STREQUAL "debug")
set(CMAKE_BUILD_TYPE "Debug")
elseif("${BUILD_TYPE}" STREQUAL "RelWithDebInfo")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
elseif("${BUILD_TYPE}" STREQUAL "MinSizeRel")
set(CMAKE_BUILD_TYPE "MinSizeRel")
endif()
endif()

View File

@ -44,8 +44,19 @@ if(NOT DEFINED _bs_include_base_utils)
elseif ("${_bs_compare_var}" STREQUAL "Debug" OR "${_bs_compare_var}" STREQUAL "debug")
set(T_CMAKE_BUILD_TYPE "Debug")
set(BUILD_TYPE "debug")
elseif ("${_bs_compare_var}" STREQUAL "RelWithDebInfo" OR "${_bs_compare_var}" STREQUAL "RELWITHDEBINFO" OR
"${_bs_compare_var}" STREQUAL "relwithdebinfo")
set(T_CMAKE_BUILD_TYPE "RelWithDebInfo")
set(BUILD_TYPE "RelWithDebInfo")
elseif ("${_bs_compare_var}" STREQUAL "MinSizeRel" OR "${_bs_compare_var}" STREQUAL "MINSIZEREL" OR
"${_bs_compare_var}" STREQUAL "minsizerel")
set(T_CMAKE_BUILD_TYPE "MinSizeRel")
set(BUILD_TYPE "MinSizeRel")
else()
message(FATAL_ERROR "Build Type: ${_bs_compare_var} is undefined, Please enter correct value - exiting!")
#Pass the flag as received from user, Could be a custom flag setting
message("Build Type: ${_bs_compare_var} is a custom build type")
set(T_CMAKE_BUILD_TYPE "${_bs_compare_var}")
set(BUILD_TYPE "${_bs_compare_var}")
endif()
endmacro()
@ -60,7 +71,8 @@ if(NOT DEFINED _bs_include_base_utils)
# to UFO_BUILD_TYPE and BUILD_TYPE.
function(bs_check_build_type)
if(DEFINED CMAKE_BUILD_TYPE AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")
if(DEFINED CMAKE_BUILD_TYPE AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL ""
AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "None")
set(_bs_check_build_type_done 1 PARENT_SCOPE)