summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-08 13:55:16 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-08 13:55:16 (GMT)
commita639689c16039b2f7c8b63e31fbbbc753ccef8c8 (patch)
tree28ec6915e54190cadbe5f28584b8ce466bfe4f42 /Tests
parent5d5067ae57c9d02656a54076cdf121c7084a4de3 (diff)
downloadCMake-a639689c16039b2f7c8b63e31fbbbc753ccef8c8.zip
CMake-a639689c16039b2f7c8b63e31fbbbc753ccef8c8.tar.gz
CMake-a639689c16039b2f7c8b63e31fbbbc753ccef8c8.tar.bz2
Check*CompilerFlag: Revert to previous method used to pass flags (#15641)
Since commit v3.3.0-rc1~397^2 (Check*CompilerFlag: Refactor method used to pass flags, 2015-02-24) these check modules pass the flags to the compiler front-end during linking as well as during compilation. This breaks checks for flags like '-x c++' that are meant only for the compilation step. Revert the change and add a test covering a compiler-only flag.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt
index e205330..9be69f1 100644
--- a/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt
@@ -56,3 +56,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
else()
message("Unhandled Platform")
endif()
+
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+ check_cxx_compiler_flag("-x c++" HAVE_X_CXX)
+ if(NOT HAVE_X_CXX)
+ message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} compiler flag '-x c++' check failed")
+ endif()
+endif()