From 9a58517df4168a5d928b715fcaa96fc24df9b40c Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 28 Oct 2016 11:18:15 -0400 Subject: Tests: Add case for Xcode per-config per-source COMPILE_FLAGS diagnostic --- Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-result.txt | 1 + Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt | 8 ++++++++ Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags.cmake | 3 +++ Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 2 ++ 4 files changed, 14 insertions(+) create mode 100644 Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-result.txt create mode 100644 Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags-stderr.txt create mode 100644 Tests/RunCMake/XcodeProject/PerConfigPerSourceFlags.cmake 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: + + \$<\$:-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 "$<$:-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) -- cgit v0.12