cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgt

This commit is contained in:
Michael Stürmer 2018-03-19 21:21:57 +01:00
parent f9042d807d
commit f3c6828876

View File

@ -2550,10 +2550,15 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
if (this->ProjectType != csproj && clOptions.IsManaged()) {
this->Managed = true;
std::string managedType = clOptions.GetFlag("CompileAsManaged");
if (managedType == "Safe") {
if (managedType == "Safe" || managedType == "Pure") {
// force empty calling convention if safe clr is used
clOptions.AddFlag("CallingConvention", "");
}
// The default values of these flags are incompatible to
// managed assemblies. We have to force valid values if
// the target is a managed C++ target.
clOptions.AddFlag("ExceptionHandling", "Async");
clOptions.AddFlag("BasicRuntimeChecks", "Default");
}
if (this->ProjectType == csproj) {
// /nowin32manifest overrides /win32manifest: parameter