mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 22:59:56 -05:00
Merge topic 'vs-sdk-style-platform-override'
4ebedf246d VS: Fix SLNs for DOTNET_SDK targets with VS_GLOBAL_PlatformTarget
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Steven Boswell <ulatekh@yahoo.com>
Merge-request: !11247
This commit is contained in:
@@ -1009,12 +1009,19 @@ cm::VS::Solution cmGlobalVisualStudioGenerator::CreateSolution(
|
||||
project->TypeId = Solution::Project::TypeIdDefault;
|
||||
}
|
||||
|
||||
project->Platform =
|
||||
// On VS 19 and above, always map .NET SDK projects to "Any CPU".
|
||||
(gt->IsDotNetSdkTarget() && this->Version >= VSVersion::VS16 &&
|
||||
!cmGlobalVisualStudioGenerator::IsReservedTarget(gt->GetName()))
|
||||
? "Any CPU"
|
||||
: solution.Platform;
|
||||
if (gt->IsDotNetSdkTarget() &&
|
||||
!cmGlobalVisualStudioGenerator::IsReservedTarget(gt->GetName())) {
|
||||
cmValue platformTarget = gt->GetProperty("VS_GLOBAL_PlatformTarget");
|
||||
if (!platformTarget.IsEmpty()) {
|
||||
project->Platform = *platformTarget;
|
||||
} else {
|
||||
project->Platform =
|
||||
// On VS 16 and above, always map .NET SDK projects to "Any CPU".
|
||||
this->Version >= VSVersion::VS16 ? "Any CPU" : solution.Platform;
|
||||
}
|
||||
} else {
|
||||
project->Platform = solution.Platform;
|
||||
}
|
||||
|
||||
// Add solution-level dependencies.
|
||||
TargetDependSet const& depends = this->GetTargetDirectDepends(gt);
|
||||
|
||||
Reference in New Issue
Block a user