summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-16 15:22:01 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-17 14:20:50 (GMT)
commit447fbb3facd09a29a2a402df258acf01cbf0bc34 (patch)
treef0a98cea28393e1e60728cc90613574de039b68c
parent597bb72ed7a74bf9b70dec8726113050e731d667 (diff)
downloadCMake-447fbb3facd09a29a2a402df258acf01cbf0bc34.zip
CMake-447fbb3facd09a29a2a402df258acf01cbf0bc34.tar.gz
CMake-447fbb3facd09a29a2a402df258acf01cbf0bc34.tar.bz2
Tests: Execute compile features tests unconditionally.
Conditionally create a dummy test if there are no known features.
-rw-r--r--Tests/CMakeCommands/target_compile_features/CMakeLists.txt8
-rw-r--r--Tests/CMakeLists.txt8
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt8
3 files changed, 19 insertions, 5 deletions
diff --git a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
index ad76411..62e3ce0 100644
--- a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
@@ -1,6 +1,14 @@
cmake_minimum_required(VERSION 3.0)
project(target_compile_features)
+if (NOT CMAKE_CXX_COMPILE_FEATURES)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_dummy.cpp"
+ "int main(int,char**) { return 0; }\n"
+ )
+ add_executable(target_compile_features "${CMAKE_CURRENT_BINARY_DIR}/test_dummy.cpp")
+ return()
+endif()
+
set(CMAKE_VERBOSE_MAKEFILE ON)
add_executable(target_compile_features main.cpp)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 12bd3b2..9d642cc 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -197,11 +197,9 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(TarTest TarTest)
ADD_TEST_MACRO(SystemInformation SystemInformation)
ADD_TEST_MACRO(MathTest MathTest)
- if(CMAKE_CXX_COMPILER_ID STREQUAL GNU
- AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
- ADD_TEST_MACRO(CompileFeatures CompileFeatures)
- ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features)
- endif()
+ ADD_TEST_MACRO(CompileFeatures CompileFeatures)
+ ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features)
+
# assume no resources building to test
set(TEST_RESOURCES FALSE)
# for windows and cygwin assume we have resources
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index bceb6bb..ce5004b 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -3,6 +3,14 @@ cmake_minimum_required(VERSION 3.0)
project(CompileFeatures)
+if (NOT CMAKE_CXX_COMPILE_FEATURES)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp"
+ "int main(int,char**) { return 0; }\n"
+ )
+ add_executable(CompileFeatures "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
+ return()
+endif()
+
macro(run_test feature)
if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ${feature})
add_library(test_${feature} OBJECT ${feature}.cpp)