Проверка флагов только в отладочном режиме
This commit is contained in:
parent
baa57922b4
commit
7a6c8e4a30
@ -18,18 +18,20 @@ macro(CHECK_ENABLE_CXX_FLAG flag)
|
||||
endmacro()
|
||||
|
||||
macro(CHECK_ENABLE_DEBUG_CXX_FLAG flag)
|
||||
set(CMAKE_REQUIRED_QUIET TRUE)
|
||||
check_cxx_compiler_flag("${flag}" CHECK_CXX_FLAG_DEBUG)
|
||||
unset(CMAKE_REQUIRED_QUIET)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_REQUIRED_QUIET TRUE)
|
||||
check_cxx_compiler_flag("${flag}" CHECK_CXX_FLAG_DEBUG)
|
||||
unset(CMAKE_REQUIRED_QUIET)
|
||||
|
||||
if(CHECK_CXX_FLAG_DEBUG)
|
||||
message(STATUS "'${flag}': debug flag is supported.")
|
||||
string(CONCAT _CMLIB_DETECTED_CXX_FLAGS_DEBUG "${_CMLIB_DETECTED_CXX_FLAGS_DEBUG} ${flag}")
|
||||
else()
|
||||
message(STATUS "'${flag}': debug flag is NOT supported.")
|
||||
if(CHECK_CXX_FLAG_DEBUG)
|
||||
message(STATUS "'${flag}': debug flag is supported.")
|
||||
string(CONCAT _CMLIB_DETECTED_CXX_FLAGS_DEBUG "${_CMLIB_DETECTED_CXX_FLAGS_DEBUG} ${flag}")
|
||||
else()
|
||||
message(STATUS "'${flag}': debug flag is NOT supported.")
|
||||
endif()
|
||||
# NOTE: check_cxx_compiler stores variables in the cache.
|
||||
unset(CHECK_CXX_FLAG_DEBUG CACHE)
|
||||
endif()
|
||||
# NOTE: check_cxx_compiler stores variables in the cache.
|
||||
unset(CHECK_CXX_FLAG_DEBUG CACHE)
|
||||
endmacro()
|
||||
|
||||
function(cmlib_set_cxx_standard version)
|
||||
|
Loading…
Reference in New Issue
Block a user