Commit 4b7a82b4 authored by Michael Stürmer's avatar Michael Stürmer
Browse files

cmVisualStudio10TargetGenerator: set /clr compiler flag from property

parent 20e31fb4
...@@ -2395,6 +2395,22 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( ...@@ -2395,6 +2395,22 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.AddFlag("AssemblerListingLocation", asmLocation); 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(flags.c_str());
clOptions.Parse(defineFlags.c_str()); clOptions.Parse(defineFlags.c_str());
std::vector<std::string> targetDefines; std::vector<std::string> targetDefines;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment