Merge topic 'vs-win10-sdk'

d7e863c1 VS: Do not fail on Windows 10 with VS 2015 if no SDK is available (#15929)
This commit is contained in:
Brad King 2016-01-25 09:47:11 -05:00 committed by CMake Topic Stage
commit 0586f1798e
3 changed files with 8 additions and 6 deletions

View File

@ -8,4 +8,5 @@ specification of a target Windows version to select a corresponding SDK.
The :variable:`CMAKE_SYSTEM_VERSION` variable may be set to specify a The :variable:`CMAKE_SYSTEM_VERSION` variable may be set to specify a
version. Otherwise CMake computes a default version based on the Windows version. Otherwise CMake computes a default version based on the Windows
SDK versions available. The chosen Windows target version number is provided SDK versions available. The chosen Windows target version number is provided
in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``. in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``. If no Windows 10 SDK
is available this value will be empty.

View File

@ -117,7 +117,7 @@ bool cmGlobalVisualStudio14Generator::InitializeWindows(cmMakefile* mf)
{ {
if (cmHasLiteralPrefix(this->SystemVersion, "10.0")) if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
{ {
return this->SelectWindows10SDK(mf); return this->SelectWindows10SDK(mf, false);
} }
return true; return true;
} }
@ -145,17 +145,18 @@ bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf)
} }
if (cmHasLiteralPrefix(this->SystemVersion, "10.0")) if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
{ {
return this->SelectWindows10SDK(mf); return this->SelectWindows10SDK(mf, true);
} }
return true; return true;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf) bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
bool required)
{ {
// Find the default version of the Windows 10 SDK. // Find the default version of the Windows 10 SDK.
this->WindowsTargetPlatformVersion = this->GetWindows10SDKVersion(); this->WindowsTargetPlatformVersion = this->GetWindows10SDKVersion();
if (this->WindowsTargetPlatformVersion.empty()) if (required && this->WindowsTargetPlatformVersion.empty())
{ {
std::ostringstream e; std::ostringstream e;
e << "Could not find an appropriate version of the Windows 10 SDK" e << "Could not find an appropriate version of the Windows 10 SDK"

View File

@ -39,7 +39,7 @@ protected:
bool IsWindowsStoreToolsetInstalled() const; bool IsWindowsStoreToolsetInstalled() const;
virtual const char* GetIDEVersion() { return "14.0"; } virtual const char* GetIDEVersion() { return "14.0"; }
virtual bool SelectWindows10SDK(cmMakefile* mf); virtual bool SelectWindows10SDK(cmMakefile* mf, bool required);
// Used to verify that the Desktop toolset for the current generator is // Used to verify that the Desktop toolset for the current generator is
// installed on the machine. // installed on the machine.