[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.16 1.17

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Sep 17 15:33:15 EDT 2009


Update of /cvsroot/CMake/CMake/Tests/TryCompile
In directory public:/mounts/ram/cvs-serv6422/Tests/TryCompile

Modified Files:
	CMakeLists.txt 
Log Message:
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.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/TryCompile/CMakeLists.txt,v
retrieving revision 1.16
retrieving revision 1.17
diff -C 2 -d -r1.16 -r1.17
*** CMakeLists.txt	4 Aug 2009 18:37:46 -0000	1.16
--- CMakeLists.txt	17 Sep 2009 19:33:12 -0000	1.17
***************
*** 201,203 ****
--- 201,211 ----
  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")



More information about the Cmake-commits mailing list