mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 17:19:05 -05:00
Test CHECK_(C|CXX)_COMPILER_FLAG macros
This teaches the TryCompile test to check that the compiler flag check macros correctly reject a bad flag. See issue #9516.
This commit is contained in:
@@ -200,4 +200,12 @@ TEST_ASSERT(CXX_BUILD_SHOULD_WORK "CHECK_CXX_SOURCE_COMPILES() failed")
|
||||
TEST_FAIL(CXX_RUN_SHOULD_FAIL "CHECK_CXX_SOURCE_RUNS() succeeded, but should have failed")
|
||||
TEST_ASSERT(CXX_RUN_SHOULD_WORK "CHECK_CXX_SOURCE_RUNS() failed")
|
||||
|
||||
UNSET(C_BOGUS_FLAG CACHE)
|
||||
INCLUDE(CheckCCompilerFlag)
|
||||
CHECK_C_COMPILER_FLAG(-_this_is_not_a_flag_ C_BOGUS_FLAG)
|
||||
TEST_FAIL(C_BOGUS_FLAG "CHECK_C_COMPILER_FLAG() succeeded, but should have failed")
|
||||
|
||||
UNSET(CXX_BOGUS_FLAG CACHE)
|
||||
INCLUDE(CheckCXXCompilerFlag)
|
||||
CHECK_CXX_COMPILER_FLAG(-_this_is_not_a_flag_ CXX_BOGUS_FLAG)
|
||||
TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed")
|
||||
|
||||
Reference in New Issue
Block a user