summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio14Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-01-07 19:54:32 (GMT)
committerBrad King <brad.king@kitware.com>2016-01-08 15:05:40 (GMT)
commitc173e37fa32b9d212cc6305f5e6dc881ba34e140 (patch)
tree7270599b7baad2ce813c51764a1e4b6c55d00d08 /Source/cmGlobalVisualStudio14Generator.cxx
parentfd7180f0c0c2554c31afda235469df986a109fe4 (diff)
downloadCMake-c173e37fa32b9d212cc6305f5e6dc881ba34e140.zip
CMake-c173e37fa32b9d212cc6305f5e6dc881ba34e140.tar.gz
CMake-c173e37fa32b9d212cc6305f5e6dc881ba34e140.tar.bz2
VS: Do not select a partial Windows 10 SDK folder (#15831)
Skip SDK candidate folders that do not contain <um/windows.h> as they are not full SDKs.
Diffstat (limited to 'Source/cmGlobalVisualStudio14Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index 41825fb..803b500 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -229,6 +229,16 @@ cmGlobalVisualStudio14Generator::IsWindowsStoreToolsetInstalled() const
win10SDK, cmSystemTools::KeyWOW64_32);
}
+#if defined(_WIN32) && !defined(__CYGWIN__)
+struct NoWindowsH
+{
+ bool operator()(std::string const& p)
+ {
+ return !cmSystemTools::FileExists(p + "/um/windows.h", true);
+ }
+};
+#endif
+
//----------------------------------------------------------------------------
std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
{
@@ -252,6 +262,12 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
std::string path = win10Root + "Include/*";
// Grab the paths of the different SDKs that are installed
cmSystemTools::GlobDirs(path, sdks);
+
+ // Skip SDKs that do not contain <um/windows.h> because that indicates that
+ // only the UCRT MSIs were installed for them.
+ sdks.erase(std::remove_if(sdks.begin(), sdks.end(), NoWindowsH()),
+ sdks.end());
+
if (!sdks.empty())
{
// Only use the filename, which will be the SDK version.