summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CompileFeatures')
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt11
-rw-r--r--Tests/CompileFeatures/feature_test.c10
2 files changed, 20 insertions, 1 deletions
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 5cd0836..aacf4c1 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -63,6 +63,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
+ AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
+ # The cxx_raw_string_literals feature happens to work in some distributions
+ # of GNU 4.4, but it is first documented as available with GNU 4.5.
+ list(REMOVE_ITEM CXX_non_features
+ cxx_raw_string_literals
+ )
+endif()
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
# The cxx_constexpr feature happens to work (for *this* testcase) with
# GNU 4.5, but it is first documented as available with GNU 4.6.
@@ -103,8 +111,9 @@ foreach(lang CXX C)
try_compile(${feature}_works
"${CMAKE_CURRENT_BINARY_DIR}/${feature}_test"
"${CMAKE_CURRENT_SOURCE_DIR}/feature_test.${${lang}_ext}"
- COMPILE_DEFINITIONS "-DTEST=${CMAKE_CURRENT_SOURCE_DIR}/${feature}.${${lang}_ext}"
+ COMPILE_DEFINITIONS "-DTEST=${feature}.${${lang}_ext}"
CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD=${${lang}_standard_flag}"
+ "-DINCLUDE_DIRECTORIES=${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE OUTPUT
)
if (${feature}_works)
diff --git a/Tests/CompileFeatures/feature_test.c b/Tests/CompileFeatures/feature_test.c
new file mode 100644
index 0000000..4147f1f
--- /dev/null
+++ b/Tests/CompileFeatures/feature_test.c
@@ -0,0 +1,10 @@
+
+#define STRINGIFY_IMPL(X) #X
+#define STRINGIFY(X) STRINGIFY_IMPL(X)
+
+#include STRINGIFY(TEST)
+
+int main(void)
+{
+ return 0;
+}