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, master has been updated
       via  50ba2f019baa3e5487a975cb72059f1fc178f9d0 (commit)
       via  fd74eba1402d66a4d6a1af3442cf219d02f7cbc8 (commit)
       via  76a5ac210050e0c1ccdce8ce89a0c77579e30187 (commit)
       via  6fc33829443ea3ef2dc8cc71c0a98b635bec6179 (commit)
       via  2ad14ef4ea57c19f6cb4ed365e99a30be81eefe7 (commit)
       via  557b2d6e65038640d5016413e612e48691cff0d8 (commit)
       via  017598a4443c19185dc245f3f0fcfceff9b98463 (commit)
      from  49a53cac87fe3a303a2794ccdd7c1b5cecd2d016 (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=50ba2f019baa3e5487a975cb72059f1fc178f9d0
commit 50ba2f019baa3e5487a975cb72059f1fc178f9d0
Merge: fd74eba 6fc3382
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Feb 14 15:14:11 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Feb 14 10:14:47 2019 -0500

    Merge topic 'fix-legacy-implicit-includes'
    
    6fc3382944 Update logic for sysroot in detected implicit include directories
    2ad14ef4ea cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffix
    557b2d6e65 Fix regression in -I/usr/include exclusion logic
    017598a444 macOS: Fix addition of <sdk>/usr/include to default implicit 
include dirs
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !2957


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd74eba1402d66a4d6a1af3442cf219d02f7cbc8
commit fd74eba1402d66a4d6a1af3442cf219d02f7cbc8
Merge: 49a53ca 76a5ac2
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Thu Feb 14 15:14:02 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Feb 14 10:14:08 2019 -0500

    Merge topic 'fix-pointer-truncation'
    
    76a5ac2100 cmListFileLexer: Add missing include to avoid possible pointer 
truncation
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !2956


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76a5ac210050e0c1ccdce8ce89a0c77579e30187
commit 76a5ac210050e0c1ccdce8ce89a0c77579e30187
Author:     Zsolt Parragi <zsolt.parr...@cancellar.hu>
AuthorDate: Tue Feb 12 21:01:18 2019 +0100
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Feb 13 10:22:59 2019 -0500

    cmListFileLexer: Add missing include to avoid possible pointer truncation
    
    The `cmsys/Enconding.h` include had a typo in its surrounding ifdef,
    possibly causing a missing function declaration (`cmsysEncoding_DupToWide`).
    As this is C code, this resulted in the code compiling, but with a truncated
    return value, possibly causing crashes.

diff --git a/Source/LexerParser/cmListFileLexer.c 
b/Source/LexerParser/cmListFileLexer.c
index c726415..15dcda0 100644
--- a/Source/LexerParser/cmListFileLexer.c
+++ b/Source/LexerParser/cmListFileLexer.c
@@ -766,7 +766,7 @@ Modify cmListFileLexer.c:
 
 /* IWYU pragma: no_forward_declare yyguts_t */
 
-#ifdef WIN32
+#ifdef _WIN32
 #include "cmsys/Encoding.h"
 #endif
 
diff --git a/Source/LexerParser/cmListFileLexer.in.l 
b/Source/LexerParser/cmListFileLexer.in.l
index 6a6fb5f..fdf14d2 100644
--- a/Source/LexerParser/cmListFileLexer.in.l
+++ b/Source/LexerParser/cmListFileLexer.in.l
@@ -18,7 +18,7 @@ Modify cmListFileLexer.c:
 
 /* IWYU pragma: no_forward_declare yyguts_t */
 
-#ifdef WIN32
+#ifdef _WIN32
 #include "cmsys/Encoding.h"
 #endif
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6fc33829443ea3ef2dc8cc71c0a98b635bec6179
commit 6fc33829443ea3ef2dc8cc71c0a98b635bec6179
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Feb 13 09:27:24 2019 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Feb 13 10:03:56 2019 -0500

    Update logic for sysroot in detected implicit include directories
    
    Since commit 5990ecb741 (Compute implicit include directories from
    compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the
    `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from
    a real compiler invocation.  In this case the paths under the sysroot
    should already have the sysroot prefix so we should no longer have to
    add the sysroot prefix.  However, it is also possible for project code
    to add its own paths to `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES`
    without the sysroot prefix and expect the historical addition of the
    sysroot prefix to be preserved.
    
    Try to account for both cases by conditionally adding the sysroot prefix
    on implicit include directories that do not already have it.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b1115ea..8090e00 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -935,6 +935,7 @@ std::vector<BT<std::string>> 
cmLocalGenerator::GetIncludeDirectoriesImplicit(
     } else {
       rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
     }
+    cmSystemTools::ConvertToUnixSlashes(rootPath);
 
     // Raw list of implicit include directories
     std::vector<std::string> impDirVec;
@@ -964,8 +965,11 @@ std::vector<BT<std::string>> 
cmLocalGenerator::GetIncludeDirectoriesImplicit(
     }
 
     for (std::string const& i : impDirVec) {
-      std::string imd = rootPath + i;
+      std::string imd = i;
       cmSystemTools::ConvertToUnixSlashes(imd);
+      if (!rootPath.empty() && !cmHasPrefix(imd, rootPath)) {
+        imd = rootPath + imd;
+      }
       if (implicitSet.insert(imd).second) {
         implicitDirs.emplace_back(std::move(imd));
       }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ad14ef4ea57c19f6cb4ed365e99a30be81eefe7
commit 2ad14ef4ea57c19f6cb4ed365e99a30be81eefe7
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Feb 13 09:22:41 2019 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Feb 13 09:52:20 2019 -0500

    cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffix

diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 9e3efd3..d38b0d1 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -336,6 +336,14 @@ std::reverse_iterator<Iter> cmMakeReverseIterator(Iter it)
   return std::reverse_iterator<Iter>(it);
 }
 
+inline bool cmHasPrefix(std::string const& str, std::string const& prefix)
+{
+  if (str.size() < prefix.size()) {
+    return false;
+  }
+  return str.compare(0, prefix.size(), prefix) == 0;
+}
+
 inline bool cmHasSuffix(const std::string& str, const std::string& suffix)
 {
   if (str.size() < suffix.size()) {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=557b2d6e65038640d5016413e612e48691cff0d8
commit 557b2d6e65038640d5016413e612e48691cff0d8
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Feb 13 09:23:31 2019 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Feb 13 09:52:20 2019 -0500

    Fix regression in -I/usr/include exclusion logic
    
    The change in commit 15ad830062 (Refactor exclusion of -I/usr/include to
    avoid per-language values, 2019-01-21, v3.14.0-rc1~108^2~4) caused the
    exclusion to apply to Fortran, but it was only meant for C, CXX, and
    CUDA.  The purpose of the change was to prepare for the value of
    `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` to be computed from the
    actual compiler instead of hard-coded.  We need to preserve exclusion of
    `-I/usr/include` if the compiler has any implicit include directory that
    looks intended to replace it, e.g. `<sdk>/usr/include` on macOS.
    
    Fixes: #18914

diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 4ae4514..46c24bb 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -63,11 +63,6 @@ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
   /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
   )
 
-# Platform-wide directories to avoid adding via -I<dir>.
-list(APPEND CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES
-  /usr/include
-  )
-
 # Default per-language values.  These may be later replaced after
 # parsing the implicit directory information from compiler output.
 set(_CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES_INIT
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 252aa4c..b1115ea 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -939,12 +939,6 @@ std::vector<BT<std::string>> 
cmLocalGenerator::GetIncludeDirectoriesImplicit(
     // Raw list of implicit include directories
     std::vector<std::string> impDirVec;
 
-    // Get platform-wide implicit directories.
-    if (const char* implicitIncludes = (this->Makefile->GetDefinition(
-          "CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES"))) {
-      cmSystemTools::ExpandListArgument(implicitIncludes, impDirVec);
-    }
-
     // Load implicit include directories for this language.
     std::string key = "CMAKE_";
     key += lang;
@@ -953,6 +947,22 @@ std::vector<BT<std::string>> 
cmLocalGenerator::GetIncludeDirectoriesImplicit(
       cmSystemTools::ExpandListArgument(value, impDirVec);
     }
 
+    // The Platform/UnixPaths module used to hard-code /usr/include for C, CXX,
+    // and CUDA in CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES, but those
+    // variables are now computed.  On macOS the /usr/include directory is
+    // inside the platform SDK so the computed value does not contain it
+    // directly.  In this case adding -I/usr/include can hide SDK headers so we
+    // must still exclude it.
+    if ((lang == "C" || lang == "CXX" || lang == "CUDA") &&
+        std::find(impDirVec.begin(), impDirVec.end(), "/usr/include") ==
+          impDirVec.end() &&
+        std::find_if(impDirVec.begin(), impDirVec.end(),
+                     [](std::string const& d) {
+                       return cmHasLiteralSuffix(d, "/usr/include");
+                     }) != impDirVec.end()) {
+      impDirVec.emplace_back("/usr/include");
+    }
+
     for (std::string const& i : impDirVec) {
       std::string imd = rootPath + i;
       cmSystemTools::ConvertToUnixSlashes(imd);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=017598a4443c19185dc245f3f0fcfceff9b98463
commit 017598a4443c19185dc245f3f0fcfceff9b98463
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed Feb 13 09:45:36 2019 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Feb 13 09:52:19 2019 -0500

    macOS: Fix addition of <sdk>/usr/include to default implicit include dirs
    
    In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl.
    consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) the
    `Platform/UnixPaths` module was updated to add `/usr/include` to
    `CMAKE_{C,CXX,CUDA}_IMPLICIT_INCLUDE_DIRECTORIES` through an
    initialization variable used by `CMakeDetermineCompilerABI` instead of
    directly.  This approach makes it only a default that can be overridden
    by detection of the implicit include directories really used by the
    compiler.
    
    The addition of `<sdk>/usr/include` to default implicit include
    directories by the `Platform/Darwin` module needs the same update but
    was accidentally left out of the original commit.

diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index a73ffba..5590433 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -214,7 +214,7 @@ include(Platform/UnixPaths)
 if(_CMAKE_OSX_SYSROOT_PATH AND EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
   list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${_CMAKE_OSX_SYSROOT_PATH}/usr)
   foreach(lang C CXX)
-    list(APPEND CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES 
${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
+    list(APPEND _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT 
${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
   endforeach()
 endif()
 list(APPEND CMAKE_SYSTEM_PREFIX_PATH

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

Summary of changes:
 Modules/Platform/Darwin.cmake           |  2 +-
 Modules/Platform/UnixPaths.cmake        |  5 -----
 Source/LexerParser/cmListFileLexer.c    |  2 +-
 Source/LexerParser/cmListFileLexer.in.l |  2 +-
 Source/cmAlgorithms.h                   |  8 ++++++++
 Source/cmLocalGenerator.cxx             | 28 +++++++++++++++++++++-------
 6 files changed, 32 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to