diff options
author | Marc Chevrier <marc.chevrier@sap.com> | 2017-11-30 14:06:21 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@sap.com> | 2017-12-05 13:47:39 (GMT) |
commit | 9432f686e62082045f53bd0ec8f8911966476df1 (patch) | |
tree | 9e03e1ae0c08fa693fbfb741b763d45c78b5feef /Tests/RunCMake/XcodeProject | |
parent | d06b8264212c893b5da8d7499328eb403aaaad37 (diff) | |
download | CMake-9432f686e62082045f53bd0ec8f8911966476df1.zip CMake-9432f686e62082045f53bd0ec8f8911966476df1.tar.gz CMake-9432f686e62082045f53bd0ec8f8911966476df1.tar.bz2 |
Add generator expression support to per-source COMPILE_DEFINITIONS
This allows users to specify different genex-based compile definitions for each file in a target.
Fixes: #17508
Diffstat (limited to 'Tests/RunCMake/XcodeProject')
4 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-result.txt b/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-stderr.txt b/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-stderr.txt new file mode 100644 index 0000000..46a294d --- /dev/null +++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error in CMakeLists.txt: + Xcode does not support per-config per-source COMPILE_DEFINITIONS: + + \$<\$<CONFIG:Debug>:MYDEBUG> + + specified for source: + + .*/Tests/RunCMake/XcodeProject/main.c$ diff --git a/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions.cmake b/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions.cmake new file mode 100644 index 0000000..f9df55f --- /dev/null +++ b/Tests/RunCMake/XcodeProject/PerConfigPerSourceDefinitions.cmake @@ -0,0 +1,3 @@ +enable_language(C) +add_executable(main main.c) +set_property(SOURCE main.c PROPERTY COMPILE_DEFINITIONS "$<$<CONFIG:Debug>:MYDEBUG>") diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index f730b83..7eb624c 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -19,6 +19,7 @@ if (NOT XCODE_VERSION VERSION_LESS 6) endif() run_cmake(PerConfigPerSourceFlags) +run_cmake(PerConfigPerSourceDefinitions) # Use a single build tree for a few tests without cleaning. |