summaryrefslogtreecommitdiffstats
path: root/Tests/TryCompile/testdef.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-03 19:57:02 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-15 13:14:56 (GMT)
commit290857bb03a4ce2f42df751c319769ff5863dd73 (patch)
tree95fc3cca9b850e5d0df4535e7b14c84e870a93a4 /Tests/TryCompile/testdef.c
parent99a814e5b9a4f0bd497b8785b60257b232d54e79 (diff)
downloadCMake-290857bb03a4ce2f42df751c319769ff5863dd73.zip
CMake-290857bb03a4ce2f42df751c319769ff5863dd73.tar.gz
CMake-290857bb03a4ce2f42df751c319769ff5863dd73.tar.bz2
try_compile: Escape CMAKE_<lang>_FLAGS in test projects (#14268)
If CMAKE_<lang>_FLAGS contains quotes or other CMake language characters they must be escaped when written into the generated CMakeLists.txt file so that the test project parses them properly. Teach the TryCompile test to cover this case by adding a flag with quotes into CMAKE_C_FLAGS during a C language try_compile.
Diffstat (limited to 'Tests/TryCompile/testdef.c')
-rw-r--r--Tests/TryCompile/testdef.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/TryCompile/testdef.c b/Tests/TryCompile/testdef.c
new file mode 100644
index 0000000..5401e71
--- /dev/null
+++ b/Tests/TryCompile/testdef.c
@@ -0,0 +1,4 @@
+#ifndef TESTDEF
+# error "TESTDEF should be defined!"
+#endif
+int main(void) { return 0; }