mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 22:31:18 -05:00
VS: Add COMMON_LANGUAGE_RUNTIME support for "netcore"
Generate `CLRSupport` for Visual Studio projects. Fixes: #22054
This commit is contained in:
@@ -8515,9 +8515,14 @@ cmGeneratorTarget::ManagedType cmGeneratorTarget::CheckManagedType(
|
||||
// lib
|
||||
// 2. empty propval: add /clr as flag, mixed unmanaged/managed
|
||||
// target, has import lib
|
||||
// 3. any value (safe,pure): add /clr:[propval] as flag, target with
|
||||
// 3. netcore propval: add /clr:netcore as flag, mixed
|
||||
// unmanaged/managed target, has import lib.
|
||||
// 4. any value (safe,pure): add /clr:[propval] as flag, target with
|
||||
// managed code only, no import lib
|
||||
return propval.empty() ? ManagedType::Mixed : ManagedType::Managed;
|
||||
if (propval.empty() || propval == "netcore") {
|
||||
return ManagedType::Mixed;
|
||||
}
|
||||
return ManagedType::Managed;
|
||||
}
|
||||
|
||||
cmGeneratorTarget::ManagedType cmGeneratorTarget::GetManagedType(
|
||||
|
||||
@@ -3316,9 +3316,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
|
||||
}
|
||||
}
|
||||
|
||||
if (this->ProjectType != VsProjectType::csproj && clOptions.IsManaged()) {
|
||||
if (this->ProjectType != VsProjectType::csproj &&
|
||||
(clOptions.IsManaged() || clOptions.HasFlag("CLRSupport"))) {
|
||||
this->Managed = true;
|
||||
std::string managedType = clOptions.GetFlag("CompileAsManaged");
|
||||
std::string managedType = clOptions.HasFlag("CompileAsManaged")
|
||||
? clOptions.GetFlag("CompileAsManaged")
|
||||
: "Mixed";
|
||||
if (managedType == "Safe" || managedType == "Pure") {
|
||||
// force empty calling convention if safe clr is used
|
||||
clOptions.AddFlag("CallingConvention", "");
|
||||
|
||||
Reference in New Issue
Block a user