[Cmake-commits] CMake branch, next, updated. v3.4.1-1905-g8673afc

Brad King brad.king at kitware.com
Mon Jan 11 13:56:26 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  8673afc72a2ba9ba8d7184411b4b1247ea45d774 (commit)
       via  a57caf7eecdfe61e4ac5f63b145fc9269610f3f0 (commit)
       via  ad594de8cc9c4063830df58453b0679c209ff4d8 (commit)
      from  5c88b0413cba78652e3f238302de04b10221c4a1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8673afc72a2ba9ba8d7184411b4b1247ea45d774
commit 8673afc72a2ba9ba8d7184411b4b1247ea45d774
Merge: 5c88b04 a57caf7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 11 13:56:25 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 11 13:56:25 2016 -0500

    Merge topic 'vs-win10-sdk' into next
    
    a57caf7e VS: Fix Windows 10 SDK version selection (#15831)
    ad594de8 cmSystemTools: Add VersionCompareEqual helper


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a57caf7eecdfe61e4ac5f63b145fc9269610f3f0
commit a57caf7eecdfe61e4ac5f63b145fc9269610f3f0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 11 13:44:11 2016 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 11 13:44:11 2016 -0500

    VS: Fix Windows 10 SDK version selection (#15831)
    
    In commit v3.4.0-rc1~5^2~1 (VS: Add support for selecting the Windows 10
    SDK, 2015-09-30) we added Windows 10 SDK selection choosing the most
    recent SDK that is not newer than the target version.  This is backward
    because it should be up to the application code to not use APIs newer
    than the target version.  It is up to the build system to provide a SDK
    that has at least the APIs expected to be available for the target
    version.  Furthermore, since the default target version is the host
    version of Windows, the old approach breaks when the only SDK available
    is for a newer version of Windows.
    
    Fix this by always selecting a Windows 10 SDK if one exists.  Use the
    SDK for the exact version if is available.  Otherwise use the latest
    version of the SDK available because that will have at least the APIs
    expected for the target version.

diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index 803b500..83499f1 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -277,29 +277,21 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
       *i = cmSystemTools::GetFilenameName(*i);
       }
 
-    // Sort the results to make sure we select the most recent one that
-    // has a version less or equal to our version of the operating system
+    // Sort the results to make sure we select the most recent one.
     std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater);
 
-    // Select a suitable SDK version.
-    if (this->SystemVersion == "10.0")
-      {
-      // Use the latest Windows 10 SDK since no build version was given.
-      return sdks.at(0);
-      }
-    else
+    // Look for a SDK exactly matching the requested target version.
+    for (std::vector<std::string>::iterator i = sdks.begin();
+         i != sdks.end(); ++i)
       {
-      // Find the SDK less or equal to our specified version
-      for (std::vector<std::string>::iterator i = sdks.begin();
-           i != sdks.end(); ++i)
+      if (cmSystemTools::VersionCompareEqual(*i, this->SystemVersion))
         {
-        if (!cmSystemTools::VersionCompareGreater(*i, this->SystemVersion))
-          {
-          // This is the most recent SDK that we can run safely
-          return *i;
-          }
+        return *i;
         }
       }
+
+    // Use the latest Windows 10 SDK since the exact version is not available.
+    return sdks.at(0);
     }
 #endif
   // Return an empty string

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad594de8cc9c4063830df58453b0679c209ff4d8
commit ad594de8cc9c4063830df58453b0679c209ff4d8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 11 13:42:07 2016 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jan 11 13:43:22 2016 -0500

    cmSystemTools: Add VersionCompareEqual helper
    
    Wrap a call to VersionCompare with OP_EQUAL.

diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 2c5aa8a..d8b8415 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2777,6 +2777,14 @@ bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
 }
 
 //----------------------------------------------------------------------------
+bool cmSystemTools::VersionCompareEqual(std::string const& lhs,
+                                        std::string const& rhs)
+{
+  return cmSystemTools::VersionCompare(
+    cmSystemTools::OP_EQUAL, lhs.c_str(), rhs.c_str());
+}
+
+//----------------------------------------------------------------------------
 bool cmSystemTools::VersionCompareGreater(std::string const& lhs,
                                           std::string const& rhs)
 {
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index b6b0978..9cafbec 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -294,6 +294,8 @@ public:
    * Compare versions
    */
   static bool VersionCompare(CompareOp op, const char* lhs, const char* rhs);
+  static bool VersionCompareEqual(std::string const& lhs,
+                                  std::string const& rhs);
   static bool VersionCompareGreater(std::string const& lhs,
                                     std::string const& rhs);
 

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGlobalVisualStudio14Generator.cxx |   26 +++++++++-----------------
 Source/cmSystemTools.cxx                   |    8 ++++++++
 Source/cmSystemTools.h                     |    2 ++
 3 files changed, 19 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list