summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-08-18 15:21:45 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-08-18 15:21:45 (GMT)
commit3353657919f8cd05a206c81056fc9a9bdb29ac00 (patch)
tree61f74170aad4629249034fd50ece6002f4be32f5 /Tests
parent258c5c2f27886ca60bda5a6a1f6411310f0bf1df (diff)
parentfbf7a9297571b7e26739009d7026fbe21c3ccbc7 (diff)
downloadCMake-3353657919f8cd05a206c81056fc9a9bdb29ac00.zip
CMake-3353657919f8cd05a206c81056fc9a9bdb29ac00.tar.gz
CMake-3353657919f8cd05a206c81056fc9a9bdb29ac00.tar.bz2
Merge topic 'makefile-assign-escape-octothorpe'
fbf7a929 Makefile: Handle '#' in COMPILE_OPTIONS (#15070)
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CompileOptions/CMakeLists.txt6
-rw-r--r--Tests/CompileOptions/main.cpp3
2 files changed, 9 insertions, 0 deletions
diff --git a/Tests/CompileOptions/CMakeLists.txt b/Tests/CompileOptions/CMakeLists.txt
index 9b6c9c2..05a5f82 100644
--- a/Tests/CompileOptions/CMakeLists.txt
+++ b/Tests/CompileOptions/CMakeLists.txt
@@ -22,6 +22,12 @@ set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS
${cxx_tests}
)
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Borland")
+ set_property(TARGET CompileOptions APPEND PROPERTY COMPILE_OPTIONS
+ "-DTEST_OCTOTHORPE=\"#\""
+ )
+endif()
+
target_link_libraries(CompileOptions testlib)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
diff --git a/Tests/CompileOptions/main.cpp b/Tests/CompileOptions/main.cpp
index 42f4cca..f3c1355 100644
--- a/Tests/CompileOptions/main.cpp
+++ b/Tests/CompileOptions/main.cpp
@@ -17,6 +17,9 @@
int main()
{
return (strcmp(NEEDS_ESCAPE, "E$CAPE") == 0
+#ifdef TEST_OCTOTHORPE
+ && strcmp(TEST_OCTOTHORPE, "#") == 0
+#endif
&& strcmp(EXPECTED_C_COMPILER_VERSION, TEST_C_COMPILER_VERSION) == 0
&& strcmp(EXPECTED_CXX_COMPILER_VERSION, TEST_CXX_COMPILER_VERSION) == 0
&& TEST_C_COMPILER_VERSION_EQUALITY == 1