diff options
author | Brad King <brad.king@kitware.com> | 2020-01-27 15:03:18 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-27 15:03:26 (GMT) |
commit | 0bf9589bf16070e59f0e8bfc5bedac71d3045634 (patch) | |
tree | 9c7c8fa495087c54b721cc0a543393cbda69e7d9 | |
parent | fd6c1d99e3f678044c3cd1b5a6da808ecce825c2 (diff) | |
parent | effd4d05694382598675913b957dda2e08aa7392 (diff) | |
download | CMake-0bf9589bf16070e59f0e8bfc5bedac71d3045634.zip CMake-0bf9589bf16070e59f0e8bfc5bedac71d3045634.tar.gz CMake-0bf9589bf16070e59f0e8bfc5bedac71d3045634.tar.bz2 |
Merge topic 'csharp-no-valued-macros'
effd4d0569 CSharp: Do not pass definitions with values
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4267
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index fd94bc9..6761c64 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -6,6 +6,7 @@ #include <set> #include <cm/memory> +#include <cm/vector> #include "windows.h" @@ -2811,6 +2812,9 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( case csproj: this->GeneratorTarget->GetCompileDefinitions(targetDefines, configName, "CSharp"); + cm::erase_if(targetDefines, [](std::string const& def) { + return def.find('=') != std::string::npos; + }); break; } clOptions.AddDefines(targetDefines); diff --git a/Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake index 152bf9c..631abac 100644 --- a/Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake +++ b/Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake @@ -27,15 +27,15 @@ foreach(line IN LISTS lines) elseif(inDebug AND (line MATCHES "^ *<DefineConstants>.*MY_FOO_DEFINE.*</DefineConstants> *$") AND (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_DEBUG.*</DefineConstants> *$") AND - (line MATCHES "^ *<DefineConstants>.*MY_BAR_ASSIGNMENT=bar.*</DefineConstants> *$") AND - (NOT (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_RELEASE.*</DefineConstants> *$")) + (NOT (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_RELEASE.*</DefineConstants> *$")) AND + (NOT (line MATCHES "^ *<DefineConstants>.*MY_BAR_ASSIGNMENT=bar.*</DefineConstants> *$")) ) set(debugOK TRUE) elseif(inRelease AND (line MATCHES "^ *<DefineConstants>.*MY_FOO_DEFINE.*</DefineConstants> *$") AND (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_RELEASE.*</DefineConstants> *$") AND - (line MATCHES "^ *<DefineConstants>.*MY_BAR_ASSIGNMENT=bar.*</DefineConstants> *$") AND - (NOT (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_DEBUG.*</DefineConstants> *$")) + (NOT (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_DEBUG.*</DefineConstants> *$")) AND + (NOT (line MATCHES "^ *<DefineConstants>.*MY_BAR_ASSIGNMENT=bar.*</DefineConstants> *$")) ) set(releaseOK TRUE) endif() |