summaryrefslogtreecommitdiff
path: root/Tests/CompileFeatures
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-28 10:42:52 -0400
committerBrad King <brad.king@kitware.com>2018-03-28 10:54:43 -0400
commite62dfeccb1bb6a86a85f34908343a89f6d02ee6a (patch)
tree7a0916851751a7794b77e9b1caca6f981ce78e4e /Tests/CompileFeatures
parentc22cdf78d7be7283d7d031c7e9e15246d53354f8 (diff)
downloadcmake-e62dfeccb1bb6a86a85f34908343a89f6d02ee6a.tar.gz
Features: Do not assume c_restrict support in CompileFeatures test
Define `EXPECT_C_RESTRICT` separately for each compiler.
Diffstat (limited to 'Tests/CompileFeatures')
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index b560acd7e2..0271cd6017 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