From f3c6828876f2f0dd8408868d90db1c4b323cba02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20St=C3=BCrmer?= Date: Mon, 19 Mar 2018 21:21:57 +0100 Subject: cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgt --- Source/cmVisualStudio10TargetGenerator.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index f52e79a..4dabb4c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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 -- cgit v0.12