summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-03-11 21:59:20 (GMT)
committerBrad King <brad.king@kitware.com>2021-03-12 13:36:40 (GMT)
commit58a50a3a0aa814c0fb00720cb8fc9edb2cf72344 (patch)
tree19b9ef83bef46cff1ae566967ca629727df2ca63 /Source/cmVisualStudio10TargetGenerator.cxx
parent09f59da7f09ef864c592cb7e3ffd26373ae2f705 (diff)
downloadCMake-58a50a3a0aa814c0fb00720cb8fc9edb2cf72344.zip
CMake-58a50a3a0aa814c0fb00720cb8fc9edb2cf72344.tar.gz
CMake-58a50a3a0aa814c0fb00720cb8fc9edb2cf72344.tar.bz2
VS: Fix '-T version=14.28' under VS 16.9
CMake accepts the toolset version that is default in the current VS version by matching the name later VS versions will use for the SxS props files. It predicts the future name based on the first two components of the current VS version's default toolset. However, this heuristic breaks naming the VS 16.8 toolset version 14.28 under VS 16.9 because the latter's default toolset version is 14.28.29910, which did not increment the second version component (unprecedented in VS). Fix this by always using the requested version's SxS props file when it exists, even if it matches the first two components of the current VS version's default toolset. Also add a special case for the name VS 16.10 will use for VS 16.9's default toolset, so that it can be used with VS 16.9 too. Fixes: #21922
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 4eb3b7f..489e42d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -623,14 +623,14 @@ void cmVisualStudio10TargetGenerator::Generate()
}
switch (this->ProjectType) {
- case vcxproj:
- if (this->GlobalGenerator->GetPlatformToolsetVersion()) {
- Elem(e0, "Import")
- .Attribute("Project",
- this->GlobalGenerator->GetAuxiliaryToolset());
+ case vcxproj: {
+ std::string const& props =
+ this->GlobalGenerator->GetPlatformToolsetVersionProps();
+ if (!props.empty()) {
+ Elem(e0, "Import").Attribute("Project", props);
}
Elem(e0, "Import").Attribute("Project", VS10_CXX_DEFAULT_PROPS);
- break;
+ } break;
case csproj:
Elem(e0, "Import")
.Attribute("Project", VS10_CSharp_DEFAULT_PROPS)