[Cmake-commits] CMake branch, master, updated. v3.14.3-875-g1628e46

Kitware Robot kwrobot at kitware.com
Tue May 7 11:13:06 EDT 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  1628e4677a25fc253e94eaae33f6e9aed13ca98a (commit)
       via  f83e4359f20034f750729e5a4123de8f54265dd9 (commit)
      from  37bf503db268c41d5a337265300357c76bda34ea (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=1628e4677a25fc253e94eaae33f6e9aed13ca98a
commit 1628e4677a25fc253e94eaae33f6e9aed13ca98a
Merge: 37bf503 f83e435
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 7 15:12:27 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue May 7 11:12:38 2019 -0400

    Merge topic 'touch-after-ranlib'
    
    f83e4359f2 Apple: Preserve high resolution mtime for static libraries
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3283


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f83e4359f20034f750729e5a4123de8f54265dd9
commit f83e4359f20034f750729e5a4123de8f54265dd9
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Thu May 2 21:37:04 2019 +0200
Commit:     Gregor Jasny <gjasny at googlemail.com>
CommitDate: Sun May 5 16:14:28 2019 +0200

    Apple: Preserve high resolution mtime for static libraries
    
    On macOS ranlib truncates the fractional part of the static achive
    file modification time.  If the archive and at least one contained
    object file were created within the same second this will make look
    the archive older than the object file.  On subsequent ninja runs
    this leads to re-achiving and updating dependent targets.
    
    As a work-around we touch the archive after ranlib.
    
    Closes: #19222

diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index cbc0103..becc424 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -537,6 +537,20 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
         std::string const& linkCmd = mf->GetRequiredDefinition(linkCmdVar);
         cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
       }
+#ifdef __APPLE__
+      // On macOS ranlib truncates the fractional part of the static archive
+      // file modification time.  If the archive and at least one contained
+      // object file were created within the same second this will make look
+      // the archive older than the object file. On subsequent ninja runs this
+      // leads to re-achiving and updating dependent targets.
+      // As a work-around we touch the archive after ranlib (see #19222).
+      {
+        std::string cmakeCommand =
+          this->GetLocalGenerator()->ConvertToOutputFormat(
+            cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL);
+        linkCmds.push_back(cmakeCommand + " -E touch $TARGET_FILE");
+      }
+#endif
       return linkCmds;
     }
     case cmStateEnums::SHARED_LIBRARY:

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

Summary of changes:
 Source/cmNinjaNormalTargetGenerator.cxx | 14 ++++++++++++++
 1 file changed, 14 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list