diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2018-03-19 20:20:03 (GMT) |
---|---|---|
committer | Michael Stürmer <michael.stuermer@schaeffler.com> | 2018-04-05 04:36:53 (GMT) |
commit | 4b7a82b4edf7f148c9d1a7ec06c7aece7b21d56b (patch) | |
tree | 6ba83ba85de42493e8b087ca81b4855eb821e79f | |
parent | 20e31fb4c9e1954dfac5b06d3717e517beda8e0a (diff) | |
download | CMake-4b7a82b4edf7f148c9d1a7ec06c7aece7b21d56b.zip CMake-4b7a82b4edf7f148c9d1a7ec06c7aece7b21d56b.tar.gz CMake-4b7a82b4edf7f148c9d1a7ec06c7aece7b21d56b.tar.bz2 |
cmVisualStudio10TargetGenerator: set /clr compiler flag from property
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4bd07ef..ffd7194 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2395,6 +2395,22 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( clOptions.AddFlag("AssemblerListingLocation", asmLocation); } } + + // check for managed C++ assembly compiler flag. This overrides any + // /clr* compiler flags which may be defined in the flags variable(s). + if (this->ProjectType != csproj) { + // TODO: add check here, if /clr was defined manually and issue + // warning that this is discouraged. + if (auto* clr = + this->GeneratorTarget->GetProperty("COMMON_LANGUAGE_RUNTIME")) { + std::string clrString = clr; + if (!clrString.empty()) { + clrString = ":" + clrString; + } + flags += " /clr" + clrString; + } + } + clOptions.Parse(flags.c_str()); clOptions.Parse(defineFlags.c_str()); std::vector<std::string> targetDefines; |