diff options
author | Brad King <brad.king@kitware.com> | 2014-05-20 13:40:14 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-05-20 13:40:14 (GMT) |
commit | c1edede31f4e979826a5fc0f6e56b1b59cb00f21 (patch) | |
tree | 11ca8f038a7e363ebd7b218d5cf753fae4b1cd4d /Tests/CompileFeatures/CMakeLists.txt | |
parent | 8897116df8e8a6576f2736b96b8e0d529c26139e (diff) | |
parent | e0890d03a48d12904ffe24aa94fb2847d8d5f4e7 (diff) | |
download | CMake-c1edede31f4e979826a5fc0f6e56b1b59cb00f21.zip CMake-c1edede31f4e979826a5fc0f6e56b1b59cb00f21.tar.gz CMake-c1edede31f4e979826a5fc0f6e56b1b59cb00f21.tar.bz2 |
Merge topic 'compile-features-C-language'
e0890d03 Features: Extend concept to C language.
Diffstat (limited to 'Tests/CompileFeatures/CMakeLists.txt')
-rw-r--r-- | Tests/CompileFeatures/CMakeLists.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index adf50d5..0e1e6c9 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0) project(CompileFeatures) -if (NOT CMAKE_CXX_COMPILE_FEATURES) +if (NOT CMAKE_C_COMPILE_FEATURES AND NOT CMAKE_CXX_COMPILE_FEATURES) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" "int main(int,char**) { return 0; }\n" ) @@ -22,6 +22,10 @@ macro(run_test feature lang) endif() endmacro() +get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) +foreach(feature ${c_features}) + run_test(${feature} C) +endforeach() get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) foreach(feature ${cxx_features}) run_test(${feature} CXX) @@ -34,9 +38,11 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU ) endif() +set(C_ext c) +set(C_standard_flag 11) set(CXX_ext cpp) set(CXX_standard_flag 11) -foreach(lang CXX) +foreach(lang CXX C) if (CMAKE_${lang}_COMPILE_FEATURES) foreach(feature ${${lang}_non_features}) message("Testing feature : ${feature}") |