Skip to content
Snippets Groups Projects
Commit ecd557cb authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'check_cxx_compiler_flag_no_normal_variable' into release-3.21


018d300c Check*CompilerFlag: Do not set result as a normal variable too

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !6318
parents 709d0369 018d300c
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,6 @@ int main(void) { return 0; }]=])
foreach(v IN LISTS _locale_vars)
set(ENV{${v}} ${_locale_vars_saved_${v}})
endforeach()
set(${_var} "${${_var}}" PARENT_SCOPE)
endfunction ()
cmake_policy(POP)
......@@ -305,11 +305,21 @@ unset(C_BOGUS_FLAG CACHE)
include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG(${C_DD}-_this_is_not_a_flag_ C_BOGUS_FLAG)
TEST_FAIL(C_BOGUS_FLAG "CHECK_C_COMPILER_FLAG() succeeded, but should have failed")
unset(C_BOGUS_FLAG CACHE)
if(DEFINED C_BOGUS_FLAG)
# Verify that CHECK_C_COMPILER_FLAG didn't construct a normal variable
message(SEND_ERROR "CHECK_C_COMPILER_FLAG shouldn't construct C_BOGUS_FLAG as a normal variable")
endif()
unset(CXX_BOGUS_FLAG CACHE)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG)
TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed")
unset(CXX_BOGUS_FLAG CACHE)
if(DEFINED CXX_BOGUS_FLAG)
# Verify that CHECK_C_COMPILER_FLAG didn't construct a normal variable
message(SEND_ERROR "CHECK_CXX_COMPILER_FLAG shouldn't construct CXX_BOGUS_FLAG as a normal variable")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
unset(C_STRICT_PROTOTYPES CACHE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment