[Cmake-commits] CMake branch, next, updated. v3.8.0-rc1-433-gaa1fd4f
Brad King
brad.king at kitware.com
Tue Feb 21 14:06:28 EST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via aa1fd4f3d25da106c6db053a01d479b065a7eaaf (commit)
via 2da0838c64b6d43fd12eecb5d65ac458a335b266 (commit)
from 83f21887f75b66c99a61e7e1deeabf89d78229d1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa1fd4f3d25da106c6db053a01d479b065a7eaaf
commit aa1fd4f3d25da106c6db053a01d479b065a7eaaf
Merge: 83f2188 2da0838
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 21 14:06:27 2017 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 21 14:06:27 2017 -0500
Merge topic 'vs2017-fallback-sdk' into next
2da0838c VS2017: If Win 8.1 SDK is not available, use Win 10 SDK
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2da0838c64b6d43fd12eecb5d65ac458a335b266
commit 2da0838c64b6d43fd12eecb5d65ac458a335b266
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Feb 20 09:46:58 2017 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 21 13:47:54 2017 -0500
VS2017: If Win 8.1 SDK is not available, use Win 10 SDK
We try to choose the Windows SDK version based on the version of Windows
targeted by the build. However, if using VS 2017 without the Windows
8.1 SDK installed then we must fall back to the Windows 10 SDK even when
targeting an older version of Windows.
Inspired-by: gnaggnoyil <gnaggnoyil at gmail.com>
diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx
index d11ee7c..2312bc0 100644
--- a/Source/cmGlobalVisualStudio15Generator.cxx
+++ b/Source/cmGlobalVisualStudio15Generator.cxx
@@ -109,6 +109,18 @@ void cmGlobalVisualStudio15Generator::WriteSLNHeader(std::ostream& fout)
}
}
+bool cmGlobalVisualStudio15Generator::InitializeWindows(cmMakefile* mf)
+{
+ // If the Win 8.1 SDK is installed then we can select a SDK matching
+ // the target Windows version.
+ if (this->IsWin81SDKInstalled()) {
+ return cmGlobalVisualStudio14Generator::InitializeWindows(mf);
+ }
+ // Otherwise we must choose a Win 10 SDK even if we are not targeting
+ // Windows 10.
+ return this->SelectWindows10SDK(mf, false);
+}
+
bool cmGlobalVisualStudio15Generator::SelectWindowsStoreToolset(
std::string& toolset) const
{
@@ -135,6 +147,28 @@ bool cmGlobalVisualStudio15Generator::IsWindowsStoreToolsetInstalled() const
return vsSetupAPIHelper.IsWin10SDKInstalled();
}
+bool cmGlobalVisualStudio15Generator::IsWin81SDKInstalled() const
+{
+ // Does the VS installer tool know about one?
+ if (vsSetupAPIHelper.IsWin81SDKInstalled()) {
+ return true;
+ }
+
+ // Does the registry know about one (e.g. from VS 2015)?
+ std::string win81Root;
+ if (cmSystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+ "Windows Kits\\Installed Roots;KitsRoot81",
+ win81Root, cmSystemTools::KeyWOW64_32) ||
+ cmSystemTools::ReadRegistryValue(
+ "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\"
+ "Windows Kits\\Installed Roots;KitsRoot81",
+ win81Root, cmSystemTools::KeyWOW64_32)) {
+ return true;
+ }
+ return false;
+}
+
std::string cmGlobalVisualStudio15Generator::FindMSBuildCommand()
{
std::string msbuild;
diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudio15Generator.h
index 781b41e..f979b65 100644
--- a/Source/cmGlobalVisualStudio15Generator.h
+++ b/Source/cmGlobalVisualStudio15Generator.h
@@ -28,6 +28,7 @@ public:
virtual const char* GetToolsVersion() { return "15.0"; }
protected:
+ bool InitializeWindows(cmMakefile* mf) CM_OVERRIDE;
virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
virtual const char* GetIDEVersion() { return "15.0"; }
@@ -40,6 +41,9 @@ protected:
// of the toolset is installed
bool IsWindowsStoreToolsetInstalled() const;
+ // Check for a Win 8 SDK known to the registry or VS installer tool.
+ bool IsWin81SDKInstalled() const;
+
std::string FindMSBuildCommand() CM_OVERRIDE;
std::string FindDevEnvCommand() CM_OVERRIDE;
-----------------------------------------------------------------------
Summary of changes:
Source/cmGlobalVisualStudio15Generator.cxx | 34 ++++++++++++++++++++++++++++
Source/cmGlobalVisualStudio15Generator.h | 4 ++++
2 files changed, 38 insertions(+)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list