diff options
author | Sumit Bhardwaj <bhardwajs@outlook.com> | 2021-12-15 16:21:34 (GMT) |
---|---|---|
committer | Sumit Bhardwaj <bhardwajs@outlook.com> | 2021-12-21 17:35:49 (GMT) |
commit | 0eea32a376fc54b198fa4690ca57b829a2d14baa (patch) | |
tree | c786935ed240c0857c0e82d87ffc27149fdade33 /Source/cmGlobalVisualStudio7Generator.cxx | |
parent | a450cc9533ac8a54d14ec5e0cbf6b379a2014e7a (diff) | |
download | CMake-0eea32a376fc54b198fa4690ca57b829a2d14baa.zip CMake-0eea32a376fc54b198fa4690ca57b829a2d14baa.tar.gz CMake-0eea32a376fc54b198fa4690ca57b829a2d14baa.tar.bz2 |
VS: Add DOTNET_SDK property to generate SDK-style C# projects
Changes in cmVisualStudio10TargetGenerator::Generate to write .Net
SDK-style project for VS generators VS 19 and above. Also adds
documentation and tests.
Issue: #20227
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index b3f8d90..c72b109 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -373,8 +373,16 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( this->IsPartOfDefaultBuild(configs, projectTargets, target); cmValue vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { + std::string mapping; + + // On VS 19 and above, always map .NET SDK projects to "Any CPU". + if (target->IsDotNetSdkTarget() && + this->GetVersion() >= VSVersion::VS16 && + !this->IsReservedTarget(target->GetName())) { + mapping = "Any CPU"; + } this->WriteProjectConfigurations(fout, *vcprojName, *target, configs, - configsPartOfDefaultBuild); + configsPartOfDefaultBuild, mapping); } } } |