summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-06-28 13:04:01 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-06-28 13:04:01 (GMT)
commitdaaf6283f5c0e8b7ea7ee93f983ad56d4498788d (patch)
tree3ad2b5c4c089f7c66a7af374f6c106e53304b4cf /Tests
parent2ed149caefb6b9c60f8e93058d5431727c650116 (diff)
parentd221eac81261679d3580849218220290fcd122df (diff)
downloadCMake-daaf6283f5c0e8b7ea7ee93f983ad56d4498788d.zip
CMake-daaf6283f5c0e8b7ea7ee93f983ad56d4498788d.tar.gz
CMake-daaf6283f5c0e8b7ea7ee93f983ad56d4498788d.tar.bz2
Merge topic 'refactor-compile-options'
d221eac Refactor target COMPILE_OPTIONS and COMPILE_FLAGS handling b6385ca Escape target flags taken from COMPILE_OPTIONS 0c9cc9a Embarcadero: Use response files only for includes, objects, and libs
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CompileOptions/CMakeLists.txt6
-rw-r--r--Tests/CompileOptions/main.cpp19
2 files changed, 19 insertions, 6 deletions
diff --git a/Tests/CompileOptions/CMakeLists.txt b/Tests/CompileOptions/CMakeLists.txt
index 6d8a96a..52c3759 100644
--- a/Tests/CompileOptions/CMakeLists.txt
+++ b/Tests/CompileOptions/CMakeLists.txt
@@ -5,7 +5,11 @@ project(CompileOptions)
add_library(testlib other.cpp)
add_executable(CompileOptions main.cpp)
-set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS "$<$<CXX_COMPILER_ID:GNU>:-DTEST_DEFINE>")
+set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS
+ "-DTEST_DEFINE"
+ "-DNEEDS_ESCAPE=\"E$CAPE\""
+ "$<$<CXX_COMPILER_ID:GNU>:-DTEST_DEFINE_GNU>"
+ )
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 0d39050..90740f1 100644
--- a/Tests/CompileOptions/main.cpp
+++ b/Tests/CompileOptions/main.cpp
@@ -1,11 +1,20 @@
+#ifndef TEST_DEFINE
+# error Expected definition TEST_DEFINE
+#endif
+
+#ifndef NEEDS_ESCAPE
+# error Expected definition NEEDS_ESCAPE
+#endif
#ifdef DO_GNU_TESTS
-# ifndef TEST_DEFINE
-# error Expected TEST_DEFINE
-# endif
+# ifndef TEST_DEFINE_GNU
+# error Expected definition TEST_DEFINE_GNU
+# endif
#endif
-int main(int argc, char **argv)
+#include <string.h>
+
+int main()
{
- return 0;
+ return strcmp(NEEDS_ESCAPE, "E$CAPE") == 0 ? 0 : 1;
}