From e62dfeccb1bb6a86a85f34908343a89f6d02ee6a Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 28 Mar 2018 10:42:52 -0400 Subject: Features: Do not assume c_restrict support in CompileFeatures test Define `EXPECT_C_RESTRICT` separately for each compiler. --- Tests/CompileFeatures/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index b560acd..0271cd6 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -227,43 +227,53 @@ if (C_expected_features) if (CMAKE_C_COMPILER_ID STREQUAL "GNU") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) list(APPEND expected_defs + EXPECT_C_RESTRICT=1 EXPECT_C_STATIC_ASSERT=1 ) else() list(APPEND expected_defs + EXPECT_C_RESTRICT=1 EXPECT_C_STATIC_ASSERT=0 ) endif() elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") list(APPEND expected_defs + EXPECT_C_RESTRICT=1 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_RESTRICT=1 EXPECT_C_STATIC_ASSERT=1 ) else() list(APPEND expected_defs + EXPECT_C_RESTRICT=1 EXPECT_C_STATIC_ASSERT=0 ) endif() elseif (CMAKE_C_COMPILER_ID STREQUAL "SunPro") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.13) list(APPEND expected_defs + EXPECT_C_RESTRICT=1 EXPECT_C_STATIC_ASSERT=1 ) else() list(APPEND expected_defs + EXPECT_C_RESTRICT=1 EXPECT_C_STATIC_ASSERT=0 ) endif() + else() + list(APPEND expected_defs + EXPECT_C_RESTRICT=1 + ) endif() list(APPEND expected_defs EXPECT_C_FUNCTION_PROTOTYPES=1 - EXPECT_C_RESTRICT=1 ) target_compile_definitions(CompileFeaturesGenex_C PRIVATE -- cgit v0.12