[Cmake-commits] CMake branch, next, updated. v3.8.0-rc2-462-ge5e35d9

Kitware Robot kwrobot at kitware.com
Fri Mar 10 16:35:03 EST 2017


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  e5e35d980b970af7d12f6d9d3f00a22c3b2192d2 (commit)
       via  83be64d99c5a545f17d1a19da6159ac853942843 (commit)
       via  8ba8b5537cdee251d412c331267822badc8fafdc (commit)
      from  774841f7ddc9309f74d8becc32fac43beaf1fc3c (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=e5e35d980b970af7d12f6d9d3f00a22c3b2192d2
commit e5e35d980b970af7d12f6d9d3f00a22c3b2192d2
Merge: 774841f 83be64d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 10 21:26:39 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Mar 10 16:27:26 2017 -0500

    Stage topic 'update-kwsys'
    
    Topic-id: 23004
    Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/576


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83be64d99c5a545f17d1a19da6159ac853942843
commit 83be64d99c5a545f17d1a19da6159ac853942843
Merge: 0b24381 8ba8b55
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 10 16:24:53 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 10 16:24:53 2017 -0500

    Merge branch 'upstream-KWSys' into update-kwsys
    
    * upstream-KWSys:
      KWSys 2017-03-07 (5da8cfe0)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8ba8b5537cdee251d412c331267822badc8fafdc
commit 8ba8b5537cdee251d412c331267822badc8fafdc
Author:     KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Tue Mar 7 13:33:51 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 10 16:24:52 2017 -0500

    KWSys 2017-03-07 (5da8cfe0)
    
    Code extracted from:
    
        https://gitlab.kitware.com/utils/kwsys.git
    
    at commit 5da8cfe0544f95697808b0b46ed3183621902f0b (master).
    
    Upstream Shortlog
    -----------------
    
    Ben Boeckel (1):
          c5529406 SystemTools: use std::string::empty
    
    Robert Maynard (1):
          27e64d34 SystemInformation: Teach Is64Bits to check host architecture at runtime

diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 86f7552..93312e9 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -539,6 +539,7 @@ protected:
   std::string OSRelease;
   std::string OSVersion;
   std::string OSPlatform;
+  bool OSIs64Bit;
 };
 
 SystemInformation::SystemInformation()
@@ -1499,6 +1500,7 @@ SystemInformationImplementation::SystemInformationImplementation()
   this->OSRelease = "";
   this->OSVersion = "";
   this->OSPlatform = "";
+  this->OSIs64Bit = (sizeof(void*) == 8);
 }
 
 SystemInformationImplementation::~SystemInformationImplementation()
@@ -5320,10 +5322,20 @@ bool SystemInformationImplementation::QueryOSInformation()
   this->Hostname = name;
 
   const char* arch = getenv("PROCESSOR_ARCHITECTURE");
+  const char* wow64 = getenv("PROCESSOR_ARCHITEW6432");
   if (arch) {
     this->OSPlatform = arch;
   }
 
+  if (wow64) {
+    // the PROCESSOR_ARCHITEW6432 is only defined when running 32bit programs
+    // on 64bit OS
+    this->OSIs64Bit = true;
+  } else if (arch) {
+    // all values other than x86 map to 64bit architectures
+    this->OSIs64Bit = (strncmp(arch, "x86", 3) != 0);
+  }
+
 #else
 
   struct utsname unameInfo;
@@ -5334,6 +5346,12 @@ bool SystemInformationImplementation::QueryOSInformation()
     this->OSRelease = unameInfo.release;
     this->OSVersion = unameInfo.version;
     this->OSPlatform = unameInfo.machine;
+
+    // This is still insufficient to capture 64bit architecture such
+    // powerpc and possible mips and sparc
+    if (this->OSPlatform.find_first_of("64") != std::string::npos) {
+      this->OSIs64Bit = true;
+    }
   }
 
 #ifdef __APPLE__
@@ -5387,6 +5405,6 @@ void SystemInformationImplementation::TrimNewline(std::string& output)
 /** Return true if the machine is 64 bits */
 bool SystemInformationImplementation::Is64Bits()
 {
-  return (sizeof(void*) == 8);
+  return this->OSIs64Bit;
 }
 }
diff --git a/SystemInformation.hxx.in b/SystemInformation.hxx.in
index cc09393..54e7fc1 100644
--- a/SystemInformation.hxx.in
+++ b/SystemInformation.hxx.in
@@ -65,6 +65,7 @@ public:
   // on this system.
   std::string GetOSDescription();
 
+  // returns if the operating system is 64bit or not.
   bool Is64Bits();
 
   unsigned int GetNumberOfLogicalCPU();
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 8c82ec1..65b7b26 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -3331,7 +3331,7 @@ std::string SystemTools::CollapseFullPath(const std::string& in_path,
   SystemTools::SplitPath(in_path, path_components);
 
   // If the input path is relative, start with a base path.
-  if (path_components[0].length() == 0) {
+  if (path_components[0].empty()) {
     std::vector<std::string> base_components;
     if (in_base) {
       // Use the given base path.
diff --git a/testSystemInformation.cxx b/testSystemInformation.cxx
index 86a1e1e..3a9217f 100644
--- a/testSystemInformation.cxx
+++ b/testSystemInformation.cxx
@@ -52,6 +52,7 @@ int testSystemInformation(int, char* [])
   printMethod(info, GetOSRelease);
   printMethod(info, GetOSVersion);
   printMethod(info, GetOSPlatform);
+  printMethod(info, Is64Bits);
   printMethod(info, GetVendorString);
   printMethod(info, GetVendorID);
   printMethod(info, GetTypeID);
@@ -63,7 +64,6 @@ int testSystemInformation(int, char* [])
   printMethod2(info, GetProcessorCacheSize, "KB");
   printMethod(info, GetLogicalProcessorsPerPhysical);
   printMethod2(info, GetProcessorClockFrequency, "MHz");
-  printMethod(info, Is64Bits);
   printMethod(info, GetNumberOfLogicalCPU);
   printMethod(info, GetNumberOfPhysicalCPU);
   printMethod(info, DoesCPUSupportCPUID);

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

Summary of changes:
 Source/kwsys/SystemInformation.cxx     |   20 +++++++++++++++++++-
 Source/kwsys/SystemInformation.hxx.in  |    1 +
 Source/kwsys/SystemTools.cxx           |    2 +-
 Source/kwsys/testSystemInformation.cxx |    2 +-
 4 files changed, 22 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list