Bläddra i källkod

Merge topic 'vs-sdk-selection'

1e67482daf VS: Generalize Win10 max SDK version to all VS generators

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5721
Brad King 4 år sedan
förälder
incheckning
fddbb7db4b

+ 8 - 0
Help/release/3.19.rst

@@ -400,3 +400,11 @@ Changes made since CMake 3.19.0 include the following.
   * The naming pattern ``cmake-$ver-macos10.10-universal`` is a universal
   * The naming pattern ``cmake-$ver-macos10.10-universal`` is a universal
     binary with ``x86_64`` and ``arm64`` architectures.  It requires
     binary with ``x86_64`` and ``arm64`` architectures.  It requires
     macOS 10.10 or newer.
     macOS 10.10 or newer.
+
+3.19.4
+------
+
+* The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM`
+  variable introduced in 3.19.0 previously worked only with the
+  :generator:`Visual Studio 14 2015` generator.  It has now been fixed to
+  work with :ref:`Visual Studio Generators` for later VS versions too.

+ 1 - 1
Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM.rst

@@ -3,7 +3,7 @@ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM
 
 
 .. versionadded:: 3.19
 .. versionadded:: 3.19
 
 
-Override the :ref:`Windows 10 SDK Maximum Version for VS 2015`.
+Override the :ref:`Windows 10 SDK Maximum Version for VS 2015` and beyond.
 
 
 The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` variable may
 The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` variable may
 be set to a false value (e.g. ``OFF``, ``FALSE``, or ``0``) or the SDK version
 be set to a false value (e.g. ``OFF``, ``FALSE``, or ``0``) or the SDK version

+ 6 - 0
Source/cmGlobalVisualStudio14Generator.cxx

@@ -253,6 +253,12 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion(
     // If value is an invalid pointer, leave result unchanged.
     // If value is an invalid pointer, leave result unchanged.
   }
   }
 
 
+  return this->GetWindows10SDKMaxVersionDefault(mf);
+}
+
+std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersionDefault(
+  cmMakefile*) const
+{
   // The last Windows 10 SDK version that VS 2015 can target is 10.0.14393.0.
   // The last Windows 10 SDK version that VS 2015 can target is 10.0.14393.0.
   //
   //
   // "VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763) is
   // "VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763) is

+ 5 - 1
Source/cmGlobalVisualStudio14Generator.h

@@ -40,9 +40,13 @@ protected:
   // of the toolset is installed
   // of the toolset is installed
   bool IsWindowsStoreToolsetInstalled() const;
   bool IsWindowsStoreToolsetInstalled() const;
 
 
+  // Used to adjust the max-SDK-version calculation to accommodate user
+  // configuration.
+  std::string GetWindows10SDKMaxVersion(cmMakefile* mf) const;
+
   // Used to make sure that the Windows 10 SDK selected can work with the
   // Used to make sure that the Windows 10 SDK selected can work with the
   // version of the toolset.
   // version of the toolset.
-  virtual std::string GetWindows10SDKMaxVersion(cmMakefile* mf) const;
+  virtual std::string GetWindows10SDKMaxVersionDefault(cmMakefile* mf) const;
 
 
   virtual bool SelectWindows10SDK(cmMakefile* mf, bool required);
   virtual bool SelectWindows10SDK(cmMakefile* mf, bool required);
 
 

+ 2 - 1
Source/cmGlobalVisualStudioVersionedGenerator.cxx

@@ -540,7 +540,8 @@ bool cmGlobalVisualStudioVersionedGenerator::IsWin81SDKInstalled() const
   return false;
   return false;
 }
 }
 
 
-std::string cmGlobalVisualStudioVersionedGenerator::GetWindows10SDKMaxVersion(
+std::string
+cmGlobalVisualStudioVersionedGenerator::GetWindows10SDKMaxVersionDefault(
   cmMakefile*) const
   cmMakefile*) const
 {
 {
   return std::string();
   return std::string();

+ 1 - 1
Source/cmGlobalVisualStudioVersionedGenerator.h

@@ -56,7 +56,7 @@ protected:
   // Check for a Win 8 SDK known to the registry or VS installer tool.
   // Check for a Win 8 SDK known to the registry or VS installer tool.
   bool IsWin81SDKInstalled() const;
   bool IsWin81SDKInstalled() const;
 
 
-  std::string GetWindows10SDKMaxVersion(cmMakefile*) const override;
+  std::string GetWindows10SDKMaxVersionDefault(cmMakefile*) const override;
 
 
   std::string FindMSBuildCommand() override;
   std::string FindMSBuildCommand() override;
   std::string FindDevEnvCommand() override;
   std::string FindDevEnvCommand() override;