[Cmake-commits] CMake branch, master, updated. v3.13.3-1264-gd526327

Kitware Robot kwrobot at kitware.com
Thu Jan 31 11:23:04 EST 2019


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  d526327079e23748dd2a87acd4d9b4b1174725bf (commit)
       via  29368abde7d5b4d3d6f734aa530e82dd9f4ee739 (commit)
       via  1b46f2f12a368e6e4049b814d0b8499394fa442e (commit)
       via  ca0310b919cb389618d480cbdc0124609051866a (commit)
       via  a2dc420cd4946eb3b17fcdcc6c32dafc7c679ad5 (commit)
       via  0933707d5c8b18401834e0787157e2de68f98e51 (commit)
       via  dc9f4f9eca3ee046bbb2f974ab9ae9af7ffc46cf (commit)
       via  fb823855158855b6c967ef8dc7947762c097f914 (commit)
       via  20291e8e7293fd0ba0f5c66fe57388ee20381ccb (commit)
       via  a624a3e1b3105e94ad30722e3053679a3b7d5b7e (commit)
       via  f4f3b6b9af13366b16ce5a3be7af6c2b68c8be09 (commit)
       via  699cd032128afcda78e12a76b227faa6c1f6a258 (commit)
       via  1180fc87803b39cc03e503e4d08fa7d68656da8a (commit)
       via  3f9822ff6d2e38ef9aedc54d654e3afc635596fd (commit)
       via  198650ae7399cc086c49e58b0a9e03e9efb86235 (commit)
       via  8a7f93d000f1676d6051027b0608ca7658c8f00e (commit)
       via  eff9c69740d5d4a26025a89f517a612e446077c0 (commit)
       via  c68465f7908336a29c48539cb9ac0dcb32310abb (commit)
       via  d6fbd438c4ca89a4e5e7eec612b142f8e86faa17 (commit)
      from  24bee427b5da710c5f9941f5cddb455df1a2ea82 (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=d526327079e23748dd2a87acd4d9b4b1174725bf
commit d526327079e23748dd2a87acd4d9b4b1174725bf
Merge: 29368ab a624a3e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 31 16:19:33 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jan 31 11:19:38 2019 -0500

    Merge topic 'ninja-intel-depfile'
    
    a624a3e1b3 Ninja: Use deps=gcc for Intel Compiler on Windows
    f4f3b6b9af Ninja: Detect when ninja is new enough to support a multi-line depfile
    699cd03212 Ninja: Drop unnecessary deptype customization infrastructure
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2893


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29368abde7d5b4d3d6f734aa530e82dd9f4ee739
commit 29368abde7d5b4d3d6f734aa530e82dd9f4ee739
Merge: 1b46f2f 20291e8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 31 16:18:34 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jan 31 11:18:40 2019 -0500

    Merge topic 'install-strip-macos'
    
    20291e8e72 install: Fix stripping on macOS
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2892


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b46f2f12a368e6e4049b814d0b8499394fa442e
commit 1b46f2f12a368e6e4049b814d0b8499394fa442e
Merge: ca0310b 8a7f93d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 31 16:17:35 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jan 31 11:17:40 2019 -0500

    Merge topic 'xcode-object-dir'
    
    8a7f93d000 Xcode: Fix object library builds with sanitizers enabled
    eff9c69740 Xcode: Place object library artifacts outside Objects-normal directory
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2885


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca0310b919cb389618d480cbdc0124609051866a
commit ca0310b919cb389618d480cbdc0124609051866a
Merge: a2dc420 198650a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 31 16:15:34 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jan 31 11:16:53 2019 -0500

    Merge topic 'set-validate-cache-type'
    
    198650ae73 set: warn if CACHE type is not recognized
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2874


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2dc420cd4946eb3b17fcdcc6c32dafc7c679ad5
commit a2dc420cd4946eb3b17fcdcc6c32dafc7c679ad5
Merge: 0933707 c68465f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 31 16:14:42 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jan 31 11:16:04 2019 -0500

    Merge topic 'xerces-xalan-header-checking'
    
    c68465f790 FindXercesC, FindXalanC: Don't examine non-existent version headers
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2884


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0933707d5c8b18401834e0787157e2de68f98e51
commit 0933707d5c8b18401834e0787157e2de68f98e51
Merge: dc9f4f9 d6fbd43
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 31 16:14:30 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jan 31 11:15:11 2019 -0500

    Merge topic 'autogen-std-bind-to-lambdas'
    
    d6fbd438c4 Autogen: Refactor std::bind calls to lambdas
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2766


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc9f4f9eca3ee046bbb2f974ab9ae9af7ffc46cf
commit dc9f4f9eca3ee046bbb2f974ab9ae9af7ffc46cf
Merge: fb82385 3f9822f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 31 16:13:41 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jan 31 11:14:21 2019 -0500

    Merge topic 'tidy-use-equals-default-fix'
    
    3f9822ff6d clang-tidy: Silence use-equals-default warning
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2887


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb823855158855b6c967ef8dc7947762c097f914
commit fb823855158855b6c967ef8dc7947762c097f914
Merge: 24bee42 1180fc8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Jan 31 16:13:27 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jan 31 11:13:34 2019 -0500

    Merge topic 'std-string-callback'
    
    1180fc8780 OutputCallback: Accept std::string argument
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Acked-by: vvs31415 <vstakhovsky at fastmail.com>
    Merge-request: !2891


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20291e8e7293fd0ba0f5c66fe57388ee20381ccb
commit 20291e8e7293fd0ba0f5c66fe57388ee20381ccb
Author:     Harry Mallon <hjmallon at gmail.com>
AuthorDate: Wed Jan 30 17:28:11 2019 +0000
Commit:     Harry Mallon <hjmallon at gmail.com>
CommitDate: Wed Jan 30 22:00:16 2019 +0000

    install: Fix stripping on macOS
    
    On macOS the `strip` tool requires special arguments depending on the
    type of binary to be stripped.
    
    Fixes: #11367
    Fixes: #16499

diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 10df70b..2f59de8 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -765,10 +765,22 @@ void cmInstallTargetGenerator::AddStripRule(std::ostream& os, Indent indent,
     return;
   }
 
+  std::string stripArgs;
+
+  // macOS 'strip' is picky, executables need '-u -r' and dylibs need '-x'.
+  if (this->Target->Target->GetMakefile()->IsOn("APPLE")) {
+    if (this->Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
+        this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) {
+      stripArgs = "-x ";
+    } else if (this->Target->GetType() == cmStateEnums::EXECUTABLE) {
+      stripArgs = "-u -r ";
+    }
+  }
+
   os << indent << "if(CMAKE_INSTALL_DO_STRIP)\n";
   os << indent << "  execute_process(COMMAND \""
      << this->Target->Target->GetMakefile()->GetDefinition("CMAKE_STRIP")
-     << "\" \"" << toDestDirPath << "\")\n";
+     << "\" " << stripArgs << "\"" << toDestDirPath << "\")\n";
   os << indent << "endif()\n";
 }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a624a3e1b3105e94ad30722e3053679a3b7d5b7e
commit a624a3e1b3105e94ad30722e3053679a3b7d5b7e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 30 14:25:56 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 30 14:59:23 2019 -0500

    Ninja: Use deps=gcc for Intel Compiler on Windows
    
    Ninja 1.9 supports the depfile format generated by this compiler.
    Use `deps = gcc` when the version of Ninja is new enough.
    
    Unfortunately the Intel Compiler for Windows does not properly
    escape spaces in paths written to a depfile so if there is a
    space in the path we must still fall back to `deps = msvc`.
    
    Fixes: #18855

diff --git a/Modules/Platform/Windows-Intel-C.cmake b/Modules/Platform/Windows-Intel-C.cmake
index 767fec5..06d8f50 100644
--- a/Modules/Platform/Windows-Intel-C.cmake
+++ b/Modules/Platform/Windows-Intel-C.cmake
@@ -1,2 +1,4 @@
 include(Platform/Windows-Intel)
 __windows_compiler_intel(C)
+set(CMAKE_NINJA_DEPTYPE_C intel) # special value handled by CMake
+set(CMAKE_DEPFILE_FLAGS_C "-QMMD -QMT <OBJECT> -QMF <DEPFILE>")
diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake
index 84cd303..666de6e 100644
--- a/Modules/Platform/Windows-Intel-CXX.cmake
+++ b/Modules/Platform/Windows-Intel-CXX.cmake
@@ -1,3 +1,5 @@
 include(Platform/Windows-Intel)
 set(_COMPILE_CXX " /TP")
 __windows_compiler_intel(CXX)
+set(CMAKE_NINJA_DEPTYPE_CXX intel) # special value handled by CMake
+set(CMAKE_DEPFILE_FLAGS_CXX "-QMMD -QMT <OBJECT> -QMF <DEPFILE>")
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c85a6f7..c29c657 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -173,8 +173,28 @@ void cmNinjaTargetGenerator::AddIncludeFlags(std::string& languageFlags,
 
 bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const
 {
-  return (this->GetMakefile()->GetSafeDefinition("CMAKE_NINJA_DEPTYPE_" +
-                                                 lang) == "msvc");
+  std::string const& deptype =
+    this->GetMakefile()->GetSafeDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
+  if (deptype == "msvc") {
+    return true;
+  }
+  if (deptype == "intel") {
+    // Ninja does not really define "intel", but we use it to switch based
+    // on whether this environment supports "gcc" or "msvc" deptype.
+    if (!this->GetGlobalGenerator()->SupportsMultilineDepfile()) {
+      // This ninja version is too old to support the Intel depfile format.
+      // Fall back to msvc deptype.
+      return true;
+    }
+    if ((this->Makefile->GetHomeDirectory().find(' ') != std::string::npos) ||
+        (this->Makefile->GetHomeOutputDirectory().find(' ') !=
+         std::string::npos)) {
+      // The Intel compiler does not properly escape spaces in a depfile.
+      // Fall back to msvc deptype.
+      return true;
+    }
+  }
+  return false;
 }
 
 // TODO: Refactor with

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4f3b6b9af13366b16ce5a3be7af6c2b68c8be09
commit f4f3b6b9af13366b16ce5a3be7af6c2b68c8be09
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 30 14:55:34 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 30 14:58:21 2019 -0500

    Ninja: Detect when ninja is new enough to support a multi-line depfile
    
    Ninja 1.9 supports the multi-line depfile format generated by the
    Intel Compiler for Windows.  Teach the global generator to detect
    when the version is new enough to support this.

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 4fd0673..6498024 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -454,6 +454,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
   , NinjaSupportsConsolePool(false)
   , NinjaSupportsImplicitOuts(false)
   , NinjaSupportsManifestRestat(false)
+  , NinjaSupportsMultilineDepfile(false)
   , NinjaSupportsDyndeps(0)
 {
 #ifdef _WIN32
@@ -581,6 +582,9 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
   this->NinjaSupportsManifestRestat = !cmSystemTools::VersionCompare(
     cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
     RequiredNinjaVersionForManifestRestat().c_str());
+  this->NinjaSupportsMultilineDepfile = !cmSystemTools::VersionCompare(
+    cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
+    RequiredNinjaVersionForMultilineDepfile().c_str());
   {
     // Our ninja branch adds ".dyndep-#" to its version number,
     // where '#' is a feature-specific version number.  Extract it.
@@ -1478,6 +1482,11 @@ bool cmGlobalNinjaGenerator::SupportsManifestRestat() const
   return this->NinjaSupportsManifestRestat;
 }
 
+bool cmGlobalNinjaGenerator::SupportsMultilineDepfile() const
+{
+  return this->NinjaSupportsMultilineDepfile;
+}
+
 void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
 {
   WriteRule(*this->RulesFileStream, "CLEAN", ninjaCmd() + " -t clean",
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index b3aa88f..c619e67 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -345,9 +345,14 @@ public:
   static std::string RequiredNinjaVersionForConsolePool() { return "1.5"; }
   static std::string RequiredNinjaVersionForImplicitOuts() { return "1.7"; }
   static std::string RequiredNinjaVersionForManifestRestat() { return "1.8"; }
+  static std::string RequiredNinjaVersionForMultilineDepfile()
+  {
+    return "1.9";
+  }
   bool SupportsConsolePool() const;
   bool SupportsImplicitOuts() const;
   bool SupportsManifestRestat() const;
+  bool SupportsMultilineDepfile() const;
 
   std::string NinjaOutputPath(std::string const& path) const;
   bool HasOutputPathPrefix() const { return !this->OutputPathPrefix.empty(); }
@@ -461,6 +466,7 @@ private:
   bool NinjaSupportsConsolePool;
   bool NinjaSupportsImplicitOuts;
   bool NinjaSupportsManifestRestat;
+  bool NinjaSupportsMultilineDepfile;
   unsigned long NinjaSupportsDyndeps;
 
 private:

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=699cd032128afcda78e12a76b227faa6c1f6a258
commit 699cd032128afcda78e12a76b227faa6c1f6a258
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 30 14:54:09 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 30 14:54:35 2019 -0500

    Ninja: Drop unnecessary deptype customization infrastructure
    
    Do not pass `CMAKE_NINJA_DEPTYPE_<LANG>` in place of `deps = gcc`.
    If Ninja ever introduces a new dependency type we will likely need
    to update CMake for it anyway.

diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index edb0ef3..c85a6f7 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -630,10 +630,6 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     }
   } else {
     deptype = "gcc";
-    const char* langdeptype = mf->GetDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
-    if (langdeptype) {
-      deptype = langdeptype;
-    }
     depfile = "$DEP_FILE";
     const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang;
     std::string depfileFlags = mf->GetSafeDefinition(flagsName);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1180fc87803b39cc03e503e4d08fa7d68656da8a
commit 1180fc87803b39cc03e503e4d08fa7d68656da8a
Author:     Regina Pfeifer <regina at mailbox.org>
AuthorDate: Wed Jan 30 18:33:58 2019 +0100
Commit:     Regina Pfeifer <regina at mailbox.org>
CommitDate: Wed Jan 30 18:33:58 2019 +0100

    OutputCallback: Accept std::string argument

diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 38aa1b3..2fd4c7a 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -123,11 +123,8 @@ public:
         s += "\n";
       });
 
-    cmSystemTools::SetStdoutCallback(
-      [&s](const char* m, size_t len) { s.append(m, len); });
-
-    cmSystemTools::SetStderrCallback(
-      [&s](const char* m, size_t len) { s.append(m, len); });
+    cmSystemTools::SetStdoutCallback([&s](std::string const& m) { s += m; });
+    cmSystemTools::SetStderrCallback([&s](std::string const& m) { s += m; });
 
     this->CM.SetProgressCallback([&s](const char* msg, float /*unused*/) {
       s += msg;
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 065d610..a073c30 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -29,9 +29,9 @@ QCMake::QCMake(QObject* p)
       this->messageCallback(msg, title);
     });
   cmSystemTools::SetStdoutCallback(
-    [this](const char* msg, size_t len) { this->stdoutCallback(msg, len); });
+    [this](std::string const& msg) { this->stdoutCallback(msg); });
   cmSystemTools::SetStderrCallback(
-    [this](const char* msg, size_t len) { this->stderrCallback(msg, len); });
+    [this](std::string const& msg) { this->stderrCallback(msg); });
 
   this->CMakeInstance = new cmake(cmake::RoleProject, cmState::Project);
   this->CMakeInstance->SetCMakeEditCommand(
@@ -365,15 +365,15 @@ void QCMake::messageCallback(const char* msg, const char* /*title*/)
   QCoreApplication::processEvents();
 }
 
-void QCMake::stdoutCallback(const char* msg, size_t len)
+void QCMake::stdoutCallback(std::string const& msg)
 {
-  emit this->outputMessage(QString::fromLocal8Bit(msg, int(len)));
+  emit this->outputMessage(QString::fromStdString(msg));
   QCoreApplication::processEvents();
 }
 
-void QCMake::stderrCallback(const char* msg, size_t len)
+void QCMake::stderrCallback(std::string const& msg)
 {
-  emit this->outputMessage(QString::fromLocal8Bit(msg, int(len)));
+  emit this->outputMessage(QString::fromStdString(msg));
   QCoreApplication::processEvents();
 }
 
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index 4f22505..ef4d2a1 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -170,8 +170,8 @@ protected:
   bool interruptCallback();
   void progressCallback(const char* msg, float percent);
   void messageCallback(const char* msg, const char* title);
-  void stdoutCallback(const char* msg, size_t len);
-  void stderrCallback(const char* msg, size_t len);
+  void stdoutCallback(std::string const& msg);
+  void stderrCallback(std::string const& msg);
 
   bool WarnUninitializedMode;
   bool WarnUnusedMode;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index a9cf0c6..5d8c079 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -308,7 +308,7 @@ void cmSystemTools::SetStderrCallback(OutputCallback f)
 void cmSystemTools::Stderr(const std::string& s)
 {
   if (s_StderrCallback) {
-    s_StderrCallback(s.c_str(), s.length());
+    s_StderrCallback(s);
   } else {
     std::cerr << s << std::flush;
   }
@@ -317,7 +317,7 @@ void cmSystemTools::Stderr(const std::string& s)
 void cmSystemTools::Stdout(const std::string& s)
 {
   if (s_StdoutCallback) {
-    s_StdoutCallback(s.c_str(), s.length());
+    s_StdoutCallback(s);
   } else {
     std::cout << s << std::flush;
   }
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 990c932..f39da64 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -80,7 +80,7 @@ public:
     Message(m.c_str(), title);
   }
 
-  using OutputCallback = std::function<void(const char*, size_t)>;
+  using OutputCallback = std::function<void(std::string const&)>;
 
   ///! Send a string to stdout
   static void Stdout(const std::string& s);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f9822ff6d2e38ef9aedc54d654e3afc635596fd
commit 3f9822ff6d2e38ef9aedc54d654e3afc635596fd
Author:     Regina Pfeifer <regina at mailbox.org>
AuthorDate: Wed Jan 30 17:51:07 2019 +0100
Commit:     Regina Pfeifer <regina at mailbox.org>
CommitDate: Wed Jan 30 17:51:07 2019 +0100

    clang-tidy: Silence use-equals-default warning
    
    clang-tidy 7 has an option to suppress this warning in macros which
    defaults to '1'.  Set the option to '0' and silence the warning
    explicitly.

diff --git a/.clang-tidy b/.clang-tidy
index dace6f1..a41ab64 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -34,4 +34,6 @@ HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
 CheckOptions:
   - key:   modernize-use-default-member-init.UseAssignment
     value: '1'
+  - key:   modernize-use-equals-default.IgnoreMacros
+    value: '0'
 ...
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index eb66ed5..aac188e 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -95,7 +95,7 @@ static const struct ZeroNode installInterfaceNode;
 #define BOOLEAN_OP_NODE(OPNAME, OP, SUCCESS_VALUE, FAILURE_VALUE)             \
   static const struct OP##Node : public cmGeneratorExpressionNode             \
   {                                                                           \
-    OP##Node() {}                                                             \
+    OP##Node() {} /* NOLINT(modernize-use-equals-default) */                  \
     virtual int NumExpectedParameters() const { return OneOrMoreParameters; } \
                                                                               \
     std::string Evaluate(const std::vector<std::string>& parameters,          \

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=198650ae7399cc086c49e58b0a9e03e9efb86235
commit 198650ae7399cc086c49e58b0a9e03e9efb86235
Author:     Taylor Holberton <taylorcholberton at gmail.com>
AuthorDate: Mon Jan 28 21:06:38 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 30 10:47:24 2019 -0500

    set: warn if CACHE type is not recognized

diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 1a2d1c6..b09e3ca 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -4,6 +4,7 @@
 
 #include "cmAlgorithms.h"
 #include "cmMakefile.h"
+#include "cmMessageType.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
 #include "cmSystemTools.h"
@@ -112,7 +113,15 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
 
   if (cache) {
     std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0);
-    type = cmState::StringToCacheEntryType(args[cacheStart + 1].c_str());
+    if (!cmState::StringToCacheEntryType(args[cacheStart + 1].c_str(), type)) {
+      std::string m = "implicitly converting '" + args[cacheStart + 1] +
+        "' to 'STRING' type.";
+      this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, m);
+      // Setting this may not be required, since it's
+      // initialized as a string. Keeping this here to
+      // ensure that the type is actually converting to a string.
+      type = cmStateEnums::STRING;
+    }
     docstring = args[cacheStart + 2].c_str();
   }
 
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index fdd7b3d..a08e9b8 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -75,14 +75,23 @@ const char* cmState::CacheEntryTypeToString(cmStateEnums::CacheEntryType type)
 
 cmStateEnums::CacheEntryType cmState::StringToCacheEntryType(const char* s)
 {
+  cmStateEnums::CacheEntryType type = cmStateEnums::STRING;
+  StringToCacheEntryType(s, type);
+  return type;
+}
+
+bool cmState::StringToCacheEntryType(const char* s,
+                                     cmStateEnums::CacheEntryType& type)
+{
   int i = 0;
   while (cmCacheEntryTypes[i]) {
     if (strcmp(s, cmCacheEntryTypes[i]) == 0) {
-      return static_cast<cmStateEnums::CacheEntryType>(i);
+      type = static_cast<cmStateEnums::CacheEntryType>(i);
+      return true;
     }
     ++i;
   }
-  return cmStateEnums::STRING;
+  return false;
 }
 
 bool cmState::IsCacheEntryType(std::string const& key)
diff --git a/Source/cmState.h b/Source/cmState.h
index e447485..f755f83 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -65,6 +65,8 @@ public:
   cmStateSnapshot Pop(cmStateSnapshot const& originSnapshot);
 
   static cmStateEnums::CacheEntryType StringToCacheEntryType(const char*);
+  static bool StringToCacheEntryType(const char*,
+                                     cmStateEnums::CacheEntryType& type);
   static const char* CacheEntryTypeToString(cmStateEnums::CacheEntryType);
   static bool IsCacheEntryType(std::string const& key);
 
diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake b/Tests/RunCMake/set/RunCMakeTest.cmake
index b8e8cf1..ea63d0b 100644
--- a/Tests/RunCMake/set/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set/RunCMakeTest.cmake
@@ -3,3 +3,4 @@ include(RunCMake)
 run_cmake(ParentScope)
 run_cmake(ParentPulling)
 run_cmake(ParentPullingRecursive)
+run_cmake(UnknownCacheType)
diff --git a/Tests/RunCMake/set/UnknownCacheType-stderr.txt b/Tests/RunCMake/set/UnknownCacheType-stderr.txt
new file mode 100644
index 0000000..6e1c811
--- /dev/null
+++ b/Tests/RunCMake/set/UnknownCacheType-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning \(dev\) at UnknownCacheType.cmake:1 \(set\):
+  implicitly converting 'unknown_type_sample' to 'STRING' type.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/set/UnknownCacheType.cmake b/Tests/RunCMake/set/UnknownCacheType.cmake
new file mode 100644
index 0000000..f2b5d05
--- /dev/null
+++ b/Tests/RunCMake/set/UnknownCacheType.cmake
@@ -0,0 +1 @@
+set (sample_key sample_value CACHE unknown_type_sample "sample doc")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a7f93d000f1676d6051027b0608ca7658c8f00e
commit 8a7f93d000f1676d6051027b0608ca7658c8f00e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 30 09:42:02 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 30 10:28:40 2019 -0500

    Xcode: Fix object library builds with sanitizers enabled
    
    Using `xcodebuild -enableAddressSanitizer YES ...` causes object files
    to be placed in a different directory name.  Xcode provides a
    placeholder for this that we can use in `OTHER_LDFLAGS` to reference
    object files for linking the dependents of object libraries.  However,
    CMake's features for installing and exporting object libraries depend on
    knowing the real path with no placeholders.  For these cases, use the
    default object directory.  Users will then have to choose between
    sanitizers and the installation and export features, but both will work
    individually.
    
    Fixes: #16289

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 86f10dc..78040c3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3859,6 +3859,13 @@ std::string cmGeneratorTarget::GetObjectDirectory(
   // find and replace $(PROJECT_NAME) xcode placeholder
   const std::string projectName = this->LocalGenerator->GetProjectName();
   cmSystemTools::ReplaceString(obj_dir, "$(PROJECT_NAME)", projectName);
+  // Replace Xcode's placeholder for the object file directory since
+  // installation and export scripts need to know the real directory.
+  // Xcode has build-time settings (e.g. for sanitizers) that affect this,
+  // but we use the default here.  Users that want to enable sanitizers
+  // will do so at the cost of object library installation and export.
+  cmSystemTools::ReplaceString(obj_dir, "$(OBJECT_FILE_DIR_normal:base)",
+                               "Objects-normal");
 #endif
   return obj_dir;
 }
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index cc5ddb8..0bd0580 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -510,6 +510,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
   makeHelper.push_back(dir);
   makeHelper.push_back("-f");
   makeHelper.push_back(this->CurrentXCodeHackMakefile);
+  makeHelper.push_back("OBJDIR=$(OBJDIR)");
   makeHelper.push_back(""); // placeholder, see below
 
   // Add ZERO_CHECK
@@ -1662,6 +1663,7 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
   makecmd += cdir;
   makecmd += " -f ";
   makecmd += this->ConvertToRelativeForMake((makefile + "$CONFIGURATION"));
+  makecmd += " OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\")";
   makecmd += " all";
   buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
   buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
@@ -3359,7 +3361,7 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         // then remove those executables as well
         if (this->Architectures.size() > 1) {
           std::string universal = this->GetObjectsDirectory(
-            this->CurrentProject, configName, gt, "Objects-normal/");
+            this->CurrentProject, configName, gt, "$(OBJDIR)/");
           for (const auto& architecture : this->Architectures) {
             std::string universalFile = universal;
             universalFile += architecture;
@@ -3763,8 +3765,8 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory(
   cmGeneratorTarget* gt) const
 {
   std::string configName = this->GetCMakeCFGIntDir();
-  std::string dir = this->GetObjectsDirectory("$(PROJECT_NAME)", configName,
-                                              gt, "Objects-normal/");
+  std::string dir = this->GetObjectsDirectory(
+    "$(PROJECT_NAME)", configName, gt, "$(OBJECT_FILE_DIR_normal:base)/");
   dir += this->ObjectDirArch;
   dir += "/";
   gt->ObjectDirectory = dir;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eff9c69740d5d4a26025a89f517a612e446077c0
commit eff9c69740d5d4a26025a89f517a612e446077c0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 30 09:33:35 2019 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 30 10:28:05 2019 -0500

    Xcode: Place object library artifacts outside Objects-normal directory
    
    The `CONFIGURATION_BUILD_DIR` value in the Xcode project file specifies
    where to place the library artifact.  For object libraries we've used
    the `Objects-normal` directory to hide away the `.a` that we otherwise
    cannot stop Xcode from producing.  The parent of this directory is also
    specific to the target and does not vary with Xcode's sanitizer
    features, so move the artifact there.
    
    Issue: #16289

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6d15b8c..cc5ddb8 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -485,6 +485,7 @@ std::string cmGlobalXCodeGenerator::PostBuildMakeTarget(
 }
 
 #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
+#define OBJECT_LIBRARY_ARTIFACT_DIR std::string()
 
 void cmGlobalXCodeGenerator::AddExtraTargets(
   cmLocalGenerator* root, std::vector<cmLocalGenerator*>& gens)
@@ -1968,8 +1969,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
     pnbase = gtgt->GetName();
     pnsuffix = ".a";
 
-    std::string pncdir =
-      this->GetObjectsNormalDirectory(this->CurrentProject, configName, gtgt);
+    std::string pncdir = this->GetObjectsDirectory(
+      this->CurrentProject, configName, gtgt, OBJECT_LIBRARY_ARTIFACT_DIR);
     buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
                                 this->CreateString(pncdir));
   }
@@ -3199,9 +3200,9 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   return true;
 }
 
-std::string cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
+std::string cmGlobalXCodeGenerator::GetObjectsDirectory(
   const std::string& projName, const std::string& configName,
-  const cmGeneratorTarget* t) const
+  const cmGeneratorTarget* t, const std::string& variant) const
 {
   std::string dir = t->GetLocalGenerator()->GetCurrentBinaryDirectory();
   dir += "/";
@@ -3210,8 +3211,8 @@ std::string cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
   dir += configName;
   dir += "/";
   dir += t->GetName();
-  dir += ".build/Objects-normal/";
-
+  dir += ".build/";
+  dir += variant;
   return dir;
 }
 
@@ -3338,8 +3339,9 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         for (auto objLib : objlibs) {
 
           const std::string objLibName = objLib->GetName();
-          std::string d = this->GetObjectsNormalDirectory(this->CurrentProject,
-                                                          configName, objLib);
+          std::string d =
+            this->GetObjectsDirectory(this->CurrentProject, configName, objLib,
+                                      OBJECT_LIBRARY_ARTIFACT_DIR);
           d += "lib";
           d += objLibName;
           d += ".a";
@@ -3356,8 +3358,8 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         // if building for more than one architecture
         // then remove those executables as well
         if (this->Architectures.size() > 1) {
-          std::string universal = this->GetObjectsNormalDirectory(
-            this->CurrentProject, configName, gt);
+          std::string universal = this->GetObjectsDirectory(
+            this->CurrentProject, configName, gt, "Objects-normal/");
           for (const auto& architecture : this->Architectures) {
             std::string universalFile = universal;
             universalFile += architecture;
@@ -3761,8 +3763,8 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory(
   cmGeneratorTarget* gt) const
 {
   std::string configName = this->GetCMakeCFGIntDir();
-  std::string dir =
-    this->GetObjectsNormalDirectory("$(PROJECT_NAME)", configName, gt);
+  std::string dir = this->GetObjectsDirectory("$(PROJECT_NAME)", configName,
+                                              gt, "Objects-normal/");
   dir += this->ObjectDirArch;
   dir += "/";
   gt->ObjectDirectory = dir;
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 92ff258..e1e412d 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -264,9 +264,10 @@ private:
   {
   }
 
-  std::string GetObjectsNormalDirectory(const std::string& projName,
-                                        const std::string& configName,
-                                        const cmGeneratorTarget* t) const;
+  std::string GetObjectsDirectory(const std::string& projName,
+                                  const std::string& configName,
+                                  const cmGeneratorTarget* t,
+                                  const std::string& variant) const;
 
   static std::string GetDeploymentPlatform(const cmMakefile* mf);
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c68465f7908336a29c48539cb9ac0dcb32310abb
commit c68465f7908336a29c48539cb9ac0dcb32310abb
Author:     Roger Leigh <rleigh at codelibre.net>
AuthorDate: Wed Jan 30 14:20:06 2019 +0000
Commit:     Roger Leigh <rleigh at codelibre.net>
CommitDate: Wed Jan 30 14:20:06 2019 +0000

    FindXercesC, FindXalanC: Don't examine non-existent version headers

diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
index 0eba3d9..3adaa44 100644
--- a/Modules/FindXalanC.cmake
+++ b/Modules/FindXalanC.cmake
@@ -76,7 +76,7 @@ find_path(XalanC_INCLUDE_DIR
           DOC "Xalan-C++ include directory")
 mark_as_advanced(XalanC_INCLUDE_DIR)
 
-if(XalanC_INCLUDE_DIR)
+if(XalanC_INCLUDE_DIR AND EXISTS "${XalanC_INCLUDE_DIR}/xalanc/Include/XalanVersion.hpp")
   _XalanC_GET_VERSION("${XalanC_INCLUDE_DIR}/xalanc/Include/XalanVersion.hpp")
 endif()
 
diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake
index 085fafc..47bfd62 100644
--- a/Modules/FindXercesC.cmake
+++ b/Modules/FindXercesC.cmake
@@ -74,7 +74,7 @@ find_path(XercesC_INCLUDE_DIR
           DOC "Xerces-C++ include directory")
 mark_as_advanced(XercesC_INCLUDE_DIR)
 
-if(XercesC_INCLUDE_DIR)
+if(XercesC_INCLUDE_DIR AND EXISTS "${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp")
   _XercesC_GET_VERSION("${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp")
 endif()
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6fbd438c4ca89a4e5e7eec612b142f8e86faa17
commit d6fbd438c4ca89a4e5e7eec612b142f8e86faa17
Author:     Artur Ryt <artur.ryt at gmail.com>
AuthorDate: Tue Jan 29 20:51:12 2019 +0100
Commit:     Artur Ryt <artur.ryt at gmail.com>
CommitDate: Tue Jan 29 20:51:12 2019 +0100

    Autogen: Refactor std::bind calls to lambdas

diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index bc496ac..0ba5224 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -1111,8 +1111,7 @@ void cmQtAutoGeneratorMocUic::WorkerT::UVProcessStart(uv_async_t* handle)
   {
     std::lock_guard<std::mutex> lock(wrk.ProcessMutex_);
     if (wrk.Process_ && !wrk.Process_->IsStarted()) {
-      wrk.Process_->start(handle->loop,
-                          std::bind(&WorkerT::UVProcessFinished, &wrk));
+      wrk.Process_->start(handle->loop, [&wrk] { wrk.UVProcessFinished(); });
     }
   }
 }
diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx
index 43ff172..021a15f 100644
--- a/Source/cmQtAutoGeneratorRcc.cxx
+++ b/Source/cmQtAutoGeneratorRcc.cxx
@@ -10,8 +10,6 @@
 #include "cmSystemTools.h"
 #include "cmUVHandlePtr.h"
 
-#include <functional>
-
 // -- Class methods
 
 cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc()
@@ -662,8 +660,7 @@ bool cmQtAutoGeneratorRcc::StartProcess(
   Process_ = cm::make_unique<ReadOnlyProcessT>();
   Process_->setup(&ProcessResult_, mergedOutput, command, workingDirectory);
   // Start process
-  if (!Process_->start(UVLoop(),
-                       std::bind(&cm::uv_async_ptr::send, &UVRequest()))) {
+  if (!Process_->start(UVLoop(), [this] { UVRequest().send(); })) {
     Log().ErrorFile(GeneratorT::RCC, QrcFile_, ProcessResult_.ErrorMessage);
     Error_ = true;
     // Clean up

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

Summary of changes:
 .clang-tidy                                        |  2 ++
 Modules/FindXalanC.cmake                           |  2 +-
 Modules/FindXercesC.cmake                          |  2 +-
 Modules/Platform/Windows-Intel-C.cmake             |  2 ++
 Modules/Platform/Windows-Intel-CXX.cmake           |  2 ++
 Source/CTest/cmCTestBuildAndTestHandler.cxx        |  7 ++----
 Source/QtDialog/QCMake.cxx                         | 12 +++++-----
 Source/QtDialog/QCMake.h                           |  4 ++--
 Source/cmGeneratorExpressionNode.cxx               |  2 +-
 Source/cmGeneratorTarget.cxx                       |  7 ++++++
 Source/cmGlobalNinjaGenerator.cxx                  |  9 +++++++
 Source/cmGlobalNinjaGenerator.h                    |  6 +++++
 Source/cmGlobalXCodeGenerator.cxx                  | 28 ++++++++++++----------
 Source/cmGlobalXCodeGenerator.h                    |  7 +++---
 Source/cmInstallTargetGenerator.cxx                | 14 ++++++++++-
 Source/cmNinjaTargetGenerator.cxx                  | 28 +++++++++++++++++-----
 Source/cmQtAutoGeneratorMocUic.cxx                 |  3 +--
 Source/cmQtAutoGeneratorRcc.cxx                    |  5 +---
 Source/cmSetCommand.cxx                            | 11 ++++++++-
 Source/cmState.cxx                                 | 13 ++++++++--
 Source/cmState.h                                   |  2 ++
 Source/cmSystemTools.cxx                           |  4 ++--
 Source/cmSystemTools.h                             |  2 +-
 Tests/RunCMake/set/RunCMakeTest.cmake              |  1 +
 .../UnknownCacheType-stderr.txt}                   |  4 ++--
 Tests/RunCMake/set/UnknownCacheType.cmake          |  1 +
 26 files changed, 128 insertions(+), 52 deletions(-)
 copy Tests/RunCMake/{include/EmptyString-stderr.txt => set/UnknownCacheType-stderr.txt} (53%)
 create mode 100644 Tests/RunCMake/set/UnknownCacheType.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list