[Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-815-g7d27002

Brad King brad.king at kitware.com
Fri Oct 28 15:52:04 EDT 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  7d270027fec3938cdbf68e8e0f8df9741cf07c0c (commit)
       via  353f6362baffbcc8750b9ff9649552bf9d555a63 (commit)
      from  2d2bec4b3d42deff6f8a9b529967fb80fc1465a8 (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=7d270027fec3938cdbf68e8e0f8df9741cf07c0c
commit 7d270027fec3938cdbf68e8e0f8df9741cf07c0c
Merge: 2d2bec4 353f636
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 28 15:52:03 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Oct 28 15:52:03 2016 -0400

    Merge topic 'ninja-windows-POST_BUILD-noop' into next
    
    353f6362 Ninja: Fix POST_BUILD noop on Windows


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=353f6362baffbcc8750b9ff9649552bf9d555a63
commit 353f6362baffbcc8750b9ff9649552bf9d555a63
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 28 15:39:56 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 28 15:44:04 2016 -0400

    Ninja: Fix POST_BUILD noop on Windows
    
    Use `cd .` instead of `:` in a Windows shell.
    
    Closes: #16393

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index ee594b0..830ab7f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -34,6 +34,11 @@
 const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja";
 const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja";
 const char* cmGlobalNinjaGenerator::INDENT = "  ";
+#ifdef _WIN32
+std::string const cmGlobalNinjaGenerator::SHELL_NOOP = "cd .";
+#else
+std::string const cmGlobalNinjaGenerator::SHELL_NOOP = ":";
+#endif
 
 void cmGlobalNinjaGenerator::Indent(std::ostream& os, int count)
 {
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 81ec3eb..064ff0b 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -58,6 +58,9 @@ public:
   /// The indentation string used when generating Ninja's build file.
   static const char* INDENT;
 
+  /// The shell command used for a no-op.
+  static std::string const SHELL_NOOP;
+
   /// Write @a count times INDENT level to output stream @a os.
   static void Indent(std::ostream& os, int count);
 
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index cd9af54..c27ab09 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -299,15 +299,11 @@ void cmLocalNinjaGenerator::AppendCustomCommandDeps(
 std::string cmLocalNinjaGenerator::BuildCommandLine(
   const std::vector<std::string>& cmdLines)
 {
-  // If we have no commands but we need to build a command anyway, use ":".
+  // If we have no commands but we need to build a command anyway, use noop.
   // This happens when building a POST_BUILD value for link targets that
   // don't use POST_BUILD.
   if (cmdLines.empty()) {
-#ifdef _WIN32
-    return "cd .";
-#else
-    return ":";
-#endif
+    return cmGlobalNinjaGenerator::SHELL_NOOP;
   }
 
   std::ostringstream cmd;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 11773f9..d70bf8e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -675,7 +675,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   if (!symlinkNeeded) {
     vars["POST_BUILD"] = postBuildCmdLine;
   } else {
-    vars["POST_BUILD"] = ":";
+    vars["POST_BUILD"] = cmGlobalNinjaGenerator::SHELL_NOOP;
     symlinkVars["POST_BUILD"] = postBuildCmdLine;
   }
   cmGlobalNinjaGenerator& globalGen = *this->GetGlobalGenerator();

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

Summary of changes:
 Source/cmGlobalNinjaGenerator.cxx       |    5 +++++
 Source/cmGlobalNinjaGenerator.h         |    3 +++
 Source/cmLocalNinjaGenerator.cxx        |    8 ++------
 Source/cmNinjaNormalTargetGenerator.cxx |    2 +-
 4 files changed, 11 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list