summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/XcodeProject
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-10-28 15:18:15 (GMT)
committerBrad King <brad.king@kitware.com>2016-10-28 15:18:15 (GMT)
commit9a58517df4168a5d928b715fcaa96fc24df9b40c (patch)
tree0cd62836b7d656303510e43465ef140f8923815f /Tests/RunCMake/XcodeProject
parent1e4bb358946a100ea04bbc97f8195b90b44a5e9c (diff)
downloadCMake-9a58517df4168a5d928b715fcaa96fc24df9b40c.zip
CMake-9a58517df4168a5d928b715fcaa96fc24df9b40c.tar.gz
CMake-9a58517df4168a5d928b715fcaa96fc24df9b40c.tar.bz2
Tests: Add case for Xcode per-config per-source COMPILE_FLAGS diagnostic
Diffstat (limited to 'Tests/RunCMake/XcodeProject')
-rw-r--r--Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-result.txt1
-rw-r--r--Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt8
-rw-r--r--Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake2
4 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-result.txt b/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt b/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt
new file mode 100644
index 0000000..6500649
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Error in CMakeLists.txt:
+ Xcode does not support per-config per-source COMPILE_FLAGS:
+
+ \$<\$<CONFIG:Debug>:-DMYDEBUG>
+
+ specified for source:
+
+ .*/Tests/RunCMake/XcodeProject/main.c$
diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags.cmake b/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags.cmake
new file mode 100644
index 0000000..99cec5b
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+add_executable(main main.c)
+set_property(SOURCE main.c PROPERTY COMPILE_FLAGS "$<$<CONFIG:Debug>:-DMYDEBUG>")
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index d43c80d..60912c2 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -13,6 +13,8 @@ if (NOT XCODE_VERSION VERSION_LESS 6)
run_cmake(XcodePlatformFrameworks)
endif()
+run_cmake(PerConfigPerSourceFlags)
+
# Use a single build tree for a few tests without cleaning.
if(NOT XCODE_VERSION VERSION_LESS 5)