Commit 80f59ee6 authored by Ben Boeckel's avatar Ben Boeckel

cmGlobalVisualStudio14Generator: notify when the SDK version doesn't match

When requesting an SDK version which is not suitable (e.g., missing
`windows.h`), CMake will use the next-best SDK version. Output a message
when CMake chooses something different than the requested SDK version.

See #16895.
parent 1fda77d4
...@@ -151,6 +151,13 @@ bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf, ...@@ -151,6 +151,13 @@ bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
mf->IssueMessage(cmake::FATAL_ERROR, e.str()); mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false; return false;
} }
if (!cmSystemTools::VersionCompareEqual(this->WindowsTargetPlatformVersion,
this->SystemVersion)) {
std::ostringstream e;
e << "Selecting Windows SDK version " << this->WindowsTargetPlatformVersion
<< " to target Windows " << this->SystemVersion << ".";
mf->DisplayStatus(e.str().c_str(), -1);
}
mf->AddDefinition("CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION", mf->AddDefinition("CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION",
this->WindowsTargetPlatformVersion.c_str()); this->WindowsTargetPlatformVersion.c_str());
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment