diff options
author | Wil Stark <wil_stark@keysight.com> | 2018-12-07 00:31:20 (GMT) |
---|---|---|
committer | Wil Stark <wil_stark@keysight.com> | 2019-01-11 17:08:55 (GMT) |
commit | 5b1364a2e39cd799d663c597bafa4222be888088 (patch) | |
tree | 3d12a94ee706d67045a81113fdad74fa261574f0 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 5a283b79e5fe1739142cc513a9a701855849b2f8 (diff) | |
download | CMake-5b1364a2e39cd799d663c597bafa4222be888088.zip CMake-5b1364a2e39cd799d663c597bafa4222be888088.tar.gz CMake-5b1364a2e39cd799d663c597bafa4222be888088.tar.bz2 |
cmVisualStudio10TargetGenerator: Fix .NET Compact Framework projects.
Fixes: #18672
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b0e70ff..5140648 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -297,6 +297,11 @@ std::ostream& cmVisualStudio10TargetGenerator::Elem::WriteString( "$(UserRootDir)\\Microsoft.CSharp.$(Platform).user.props" #define VS10_CSharp_TARGETS "$(MSBuildToolsPath)\\Microsoft.CSharp.targets" +#define VS10_CSharp_NETCF_TARGETS \ + "$(MSBuildExtensionsPath)\\Microsoft\\$(TargetFrameworkIdentifier)\\" \ + "$(TargetFrameworkTargetsVersion)\\Microsoft.$(TargetFrameworkIdentifier)" \ + ".CSharp.targets" + void cmVisualStudio10TargetGenerator::Generate() { // do not generate external ms projects @@ -480,9 +485,31 @@ void cmVisualStudio10TargetGenerator::Generate() targetFrameworkVersion = this->GeneratorTarget->GetProperty( "DOTNET_TARGET_FRAMEWORK_VERSION"); } + if (!targetFrameworkVersion && this->ProjectType == csproj && + this->GlobalGenerator->TargetsWindowsCE() && + this->GlobalGenerator->GetVersion() == + cmGlobalVisualStudioGenerator::VS12) { + // VS12 .NETCF default to .NET framework 3.9 + targetFrameworkVersion = "v3.9"; + } if (targetFrameworkVersion) { e1.Element("TargetFrameworkVersion", targetFrameworkVersion); } + if (this->ProjectType == csproj && + this->GlobalGenerator->TargetsWindowsCE()) { + const char* targetFrameworkId = this->GeneratorTarget->GetProperty( + "VS_TARGET_FRAMEWORK_IDENTIFIER"); + if (!targetFrameworkId) { + targetFrameworkId = "WindowsEmbeddedCompact"; + } + e1.Element("TargetFrameworkIdentifier", targetFrameworkId); + const char* targetFrameworkVer = this->GeneratorTarget->GetProperty( + "VS_TARGET_FRAMEWORKS_TARGET_VERSION"); + if (!targetFrameworkVer) { + targetFrameworkVer = "v8.0"; + } + e1.Element("TargetFrameworkTargetsVersion", targetFrameworkVer); + } } // Disable the project upgrade prompt that is displayed the first time a @@ -638,7 +665,11 @@ void cmVisualStudio10TargetGenerator::Generate() Elem(e0, "Import").Attribute("Project", VS10_CXX_TARGETS); break; case csproj: - Elem(e0, "Import").Attribute("Project", VS10_CSharp_TARGETS); + if (this->GlobalGenerator->TargetsWindowsCE()) { + Elem(e0, "Import").Attribute("Project", VS10_CSharp_NETCF_TARGETS); + } else { + Elem(e0, "Import").Attribute("Project", VS10_CSharp_TARGETS); + } break; } |