summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-18 13:59:40 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-01-18 14:01:14 (GMT)
commit2a5ca650c9f973c83fe3d5b070f6313e1bd536c1 (patch)
tree7d8c5db3f1e39bde9410bd341fd48a0d543a8e23
parent1ae2c6b2c9def9f0d0db3a808290d485eccf062c (diff)
downloadCMake-2a5ca650c9f973c83fe3d5b070f6313e1bd536c1.zip
CMake-2a5ca650c9f973c83fe3d5b070f6313e1bd536c1.tar.gz
CMake-2a5ca650c9f973c83fe3d5b070f6313e1bd536c1.tar.bz2
Features: Wrap failure-test in UNIX condition.
The use of GNU on non-UNIX for 'compile features' is not tested and is not well defined.
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt14
1 files changed, 8 insertions, 6 deletions
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 401de95..5849417 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -25,12 +25,14 @@ if (NOT CMAKE_CXX_COMPILE_FEATURES AND NOT CMAKE_C_COMPILE_FEATURES)
)
add_executable(WriteCompilerDetectionHeader "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
- include(CheckCXXSourceCompiles)
- check_cxx_source_compiles("#include \"${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h\"\nint main() { return 0; }\n"
- file_include_works
- )
- if (file_include_works)
- message(SEND_ERROR "Inclusion of ${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h was expected to cause an error, but did not.")
+ if(UNIX OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ include(CheckCXXSourceCompiles)
+ check_cxx_source_compiles("#include \"${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h\"\nint main() { return 0; }\n"
+ file_include_works
+ )
+ if (file_include_works)
+ message(SEND_ERROR "Inclusion of ${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h was expected to cause an error, but did not.")
+ endif()
endif()
return()
endif()