diff options
author | Brad King <brad.king@kitware.com> | 2023-03-31 22:41:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-04-05 16:06:21 (GMT) |
commit | 8499374c6a7114d83a8768edd611caf02d9941a1 (patch) | |
tree | 2b2a54d116f53d04f92a07f001b4dc37569a4408 /Source | |
parent | 1c8d4b4bf186356b82addbac56c14426a7833316 (diff) | |
download | CMake-8499374c6a7114d83a8768edd611caf02d9941a1.zip CMake-8499374c6a7114d83a8768edd611caf02d9941a1.tar.gz CMake-8499374c6a7114d83a8768edd611caf02d9941a1.tar.bz2 |
VS: Simplify logic to require SDK for Windows Store
Revise logic added by commit d7e863c1c1 (VS: Do not fail on Windows 10
with VS 2015 if no SDK is available, 2016-01-21, v3.4.3~1^2) to make the
requirement decision locally and simplify signatures.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.cxx | 22 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 2 |
3 files changed, 14 insertions, 12 deletions
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index 7424ca3..4b59b16 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -140,7 +140,7 @@ bool cmGlobalVisualStudio14Generator::MatchesGeneratorName( bool cmGlobalVisualStudio14Generator::InitializeWindows(cmMakefile* mf) { if (cmHasLiteralPrefix(this->SystemVersion, "10.0")) { - return this->SelectWindows10SDK(mf, false); + return this->SelectWindows10SDK(mf); } return true; } @@ -163,7 +163,7 @@ bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf) return false; } if (cmHasLiteralPrefix(this->SystemVersion, "10.0")) { - return this->SelectWindows10SDK(mf, true); + return this->SelectWindows10SDK(mf); } return true; } @@ -173,19 +173,21 @@ bool cmGlobalVisualStudio14Generator::InitializeAndroid(cmMakefile*) return true; } -bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf, - bool required) +bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf) { // Find the default version of the Windows 10 SDK. std::string const version = this->GetWindows10SDKVersion(mf); - if (required && version.empty()) { - std::ostringstream e; - e << "Could not find an appropriate version of the Windows 10 SDK" - << " installed on this machine"; - mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); - return false; + if (version.empty()) { + if (this->SystemName == "WindowsStore") { + mf->IssueMessage( + MessageType::FATAL_ERROR, + "Could not find an appropriate version of the Windows 10 SDK" + " installed on this machine"); + return false; + } } + this->SetWindowsTargetPlatformVersion(version, mf); return true; } diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index 7fb9b4b..30e8b18 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -47,7 +47,7 @@ protected: // version of the toolset. virtual std::string GetWindows10SDKMaxVersionDefault(cmMakefile* mf) const; - virtual bool SelectWindows10SDK(cmMakefile* mf, bool required); + virtual bool SelectWindows10SDK(cmMakefile* mf); void SetWindowsTargetPlatformVersion(std::string const& version, cmMakefile* mf); diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 415eb7c..f4a4d3d 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -900,7 +900,7 @@ bool cmGlobalVisualStudioVersionedGenerator::InitializeWindows(cmMakefile* mf) } // Otherwise we must choose a Win 10 SDK even if we are not targeting // Windows 10. - return this->SelectWindows10SDK(mf, false); + return this->SelectWindows10SDK(mf); } bool cmGlobalVisualStudioVersionedGenerator::SelectWindowsStoreToolset( |