diff options
author | Brad King <brad.king@kitware.com> | 2016-04-28 13:26:09 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-04-28 13:26:09 (GMT) |
commit | 5b4f771fd7eb02f4bb5248194796d191347e492b (patch) | |
tree | 7d496e39d55949952b21b8dc44cde48a47971a25 /Tests | |
parent | 954c06803d32ee35c9af94969a4386848e6b7b79 (diff) | |
parent | 21b1fa5cb9adccd8d5bbc411c4932cf46d2ed29f (diff) | |
download | CMake-5b4f771fd7eb02f4bb5248194796d191347e492b.zip CMake-5b4f771fd7eb02f4bb5248194796d191347e492b.tar.gz CMake-5b4f771fd7eb02f4bb5248194796d191347e492b.tar.bz2 |
Merge topic 'intel-compiler-features'
21b1fa5c Help: Add notes for topic 'intel-compiler-features'
9addce99 Features: Record standard flags for Intel C/C++ on Windows
15a6c950 WCDH: Add Intel to list of supported compilers
36f32ede Features: Record standards and features for Intel C on UNIX
d028b948 Features: Specify minimum version Intel C++ 12.1
be910f00 Features: Record standards and features for Intel C++ on UNIX
7f401ae4 Features: Detect C default dialect on MSVC-like compilers
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CompileFeatures/CMakeLists.txt | 82 | ||||
-rw-r--r-- | Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 14 |
2 files changed, 91 insertions, 5 deletions
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index a32138d..9f08523 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -119,6 +119,55 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") endif() endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) + if (CMAKE_CXX_COMIPLER_VERSION VERSION_EQUAL 15.0) + list(REMOVE_ITEM CXX_non_features + # The cxx_contextual_conversions feature happens to work + # (for *this* testcase) with Intel 13/14/15, but they do not + # document support until 16. + cxx_contextual_conversions + ) + + elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0) + list(REMOVE_ITEM CXX_non_features + cxx_alignof + + # not supposed to work until 15 + cxx_attribute_deprecated + + # The cxx_contextual_conversions feature happens to work + # (for *this* testcase) with Intel 13/14/15, but they do not + # document support until 16. + cxx_contextual_conversions + ) + + elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1) + list(REMOVE_ITEM CXX_non_features + # These features happen to work but aren't documented to + # do so until 14.0 + cxx_constexpr + cxx_enum_forward_declarations + cxx_sizeof_member + cxx_strong_enums + cxx_unicode_literals + + # not supposed to work until 15 + cxx_attribute_deprecated + cxx_nonstatic_member_init + + # The cxx_contextual_conversions feature happens to work + # (for *this* testcase) with Intel 13/14/15, but they do not + # document support until 16. + cxx_contextual_conversions + + # This is an undocumented feature; it does not work in future versions + cxx_aggregate_default_initializers + ) + endif() + endif() +endif() + set(C_ext c) set(C_standard_flag 11) set(CXX_ext cpp) @@ -177,6 +226,16 @@ if (CMAKE_C_COMPILE_FEATURES) list(APPEND expected_defs EXPECT_C_STATIC_ASSERT=1 ) + elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel") + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15) + list(APPEND expected_defs + EXPECT_C_STATIC_ASSERT=1 + ) + else() + list(APPEND expected_defs + EXPECT_C_STATIC_ASSERT=0 + ) + endif() endif() list(APPEND expected_defs @@ -301,6 +360,29 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 ) + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() endif() add_executable(CompileFeaturesGenex genex_test.cpp) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index c538280..8b251d7 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -11,7 +11,7 @@ get_property(c_known_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) write_compiler_detection_header( FILE "${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h" PREFIX TEST - COMPILERS GNU Clang AppleClang MSVC SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro Intel VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -61,7 +61,8 @@ endmacro() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" - OR CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") + OR CMAKE_CXX_COMPILER_ID STREQUAL "SunPro" + OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel") # False for C++98 mode. list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) @@ -80,7 +81,9 @@ endif() if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" - OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") + OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang" + OR CMAKE_C_COMPILER_ID STREQUAL "Intel") + add_executable(C_undefined c_undefined.c) set_property(TARGET C_undefined PROPERTY C_STANDARD 90) target_compile_options(C_undefined PRIVATE -Werror=undef) @@ -104,7 +107,7 @@ write_compiler_detection_header( PREFIX MULTI OUTPUT_FILES_VAR multi_files OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support" - COMPILERS GNU Clang AppleClang MSVC SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro Intel VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} @@ -142,7 +145,8 @@ set_defines(multi_files_11 "${true_defs}" "${false_defs}") if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" - OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") + OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang" + OR CMAKE_C_COMPILER_ID STREQUAL "Intel") add_executable(WriteCompilerDetectionHeader_C11 main.c) set_property(TARGET WriteCompilerDetectionHeader_C11 PROPERTY C_STANDARD 11) set_defines(WriteCompilerDetectionHeader_C11 "EXPECTED_COMPILER_C_FUNCTION_PROTOTYPES;EXPECTED_COMPILER_C_RESTRICT" "") |