summaryrefslogtreecommitdiff
path: root/Tests/CMakeOnly
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-08 09:55:16 -0400
committerBrad King <brad.king@kitware.com>2015-07-08 09:55:16 -0400
commita639689c16039b2f7c8b63e31fbbbc753ccef8c8 (patch)
tree28ec6915e54190cadbe5f28584b8ce466bfe4f42 /Tests/CMakeOnly
parent5d5067ae57c9d02656a54076cdf121c7084a4de3 (diff)
downloadcmake-a639689c16039b2f7c8b63e31fbbbc753ccef8c8.tar.gz
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/CMakeOnly')
-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 e205330b08..9be69f128c 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()