diff options
author | Brad King <brad.king@kitware.com> | 2016-12-07 15:38:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-07 16:02:54 (GMT) |
commit | 27431de1627d95329712f4af8362fcaf2667aad5 (patch) | |
tree | f8c1de4de9371566f652b57cb9c3f454b6e6bbe8 /Source/cmGlobalVisualStudio10Generator.cxx | |
parent | db3499df5d06ab2cacc61e9f7720a33456aeafe4 (diff) | |
download | CMake-27431de1627d95329712f4af8362fcaf2667aad5.zip CMake-27431de1627d95329712f4af8362fcaf2667aad5.tar.gz CMake-27431de1627d95329712f4af8362fcaf2667aad5.tar.bz2 |
VS: Fix standalone Windows7.1SDK toolset selection
Since commit v3.7.0-rc1~142^2~1 (VS: Explicitly default to v100 toolset
in Visual Studio 2010, 2016-07-21) we prefer to always set a platform
toolset explicitly so that `CMAKE_VS_PLATFORM_TOOLSET` can be reported.
However, the `v100` default for the VS 10 generator is not appropriate
for all environments. We fixed support for VS 2010 Express Edition in
commit v3.7.0-rc1~142^2 (VS: Do not default to missing v100 64-bit
toolset on VS 2010 Express, 2016-09-09).
Fix support for the standalone Windows7.1SDK toolset environment by
recognizing the `PlatformToolset` environment variable that it sets to
`Windows7.1SDK` and using this as our default toolset instead.
Closes: #16483
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index caaac87..502c93a 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -93,7 +93,16 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator( this->SystemIsWindowsPhone = false; this->SystemIsWindowsStore = false; this->MSBuildCommandInitialized = false; - this->DefaultPlatformToolset = "v100"; + { + std::string envPlatformToolset; + if (cmSystemTools::GetEnv("PlatformToolset", envPlatformToolset) && + envPlatformToolset == "Windows7.1SDK") { + // We are running from a Windows7.1SDK command prompt. + this->DefaultPlatformToolset = "Windows7.1SDK"; + } else { + this->DefaultPlatformToolset = "v100"; + } + } this->Version = VS10; } |