[Cmake-commits] CMake branch, next, updated. v2.8.7-3340-gdc4e0ba
Peter Collingbourne
peter at pcc.me.uk
Sun Mar 25 23:48:46 EDT 2012
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 dc4e0babcb387dd9e5bec83954214e46d81653f6 (commit)
via 6b5614f1642dcb75fd9de9571c813b21e4f9ce2b (commit)
from 9520737f02106dc9581df439a5b33d7ae009bf8b (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc4e0babcb387dd9e5bec83954214e46d81653f6
commit dc4e0babcb387dd9e5bec83954214e46d81653f6
Merge: 9520737 6b5614f
Author: Peter Collingbourne <peter at pcc.me.uk>
AuthorDate: Sun Mar 25 23:48:44 2012 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Mar 25 23:48:44 2012 -0400
Merge topic 'ninja-generator' into next
6b5614f Ninja: Substitute <OBJECT> and <CMAKE_C_COMPILER> in depfile flags
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b5614f1642dcb75fd9de9571c813b21e4f9ce2b
commit 6b5614f1642dcb75fd9de9571c813b21e4f9ce2b
Author: Peter Collingbourne <peter at pcc.me.uk>
AuthorDate: Mon Mar 26 04:16:15 2012 +0100
Commit: Peter Collingbourne <peter at pcc.me.uk>
CommitDate: Mon Mar 26 04:46:12 2012 +0100
Ninja: Substitute <OBJECT> and <CMAKE_C_COMPILER> in depfile flags
Patch by Amine Khaldi!
Also, start using the -MT flag to set a target name for depfiles.
This works around a bug observed in distcc, as explained in the
comment. Based on a patch by Alexander Usov.
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index bdcaf9d..c74c179 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -30,7 +30,10 @@ macro(__compiler_gnu lang)
# in try_compile mode.
GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
if(NOT _IN_TC OR CMAKE_FORCE_DEPFILES)
- set(CMAKE_DEPFILE_FLAGS_${lang} "-MMD -MF <DEPFILE>")
+ # distcc does not transform -o to -MT when invoking the preprocessor
+ # internally, as it ought to. Work around this bug by setting -MT here
+ # even though it isn't strictly necessary.
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-MMD -MT <OBJECT> -MF <DEPFILE>")
endif()
# Initial configuration flags.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 9acbc67..bea234f 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -331,6 +331,10 @@ cmNinjaTargetGenerator
depfile = "$out.d";
cmSystemTools::ReplaceString(depfileFlagsStr, "<DEPFILE>",
depfile.c_str());
+ cmSystemTools::ReplaceString(depfileFlagsStr, "<OBJECT>",
+ "$out");
+ cmSystemTools::ReplaceString(depfileFlagsStr, "<CMAKE_C_COMPILER>",
+ this->GetMakefile()->GetDefinition("CMAKE_C_COMPILER"));
flags += " " + depfileFlagsStr;
}
vars.Flags = flags.c_str();
-----------------------------------------------------------------------
Summary of changes:
Modules/Compiler/GNU.cmake | 5 ++++-
Source/cmNinjaTargetGenerator.cxx | 4 ++++
2 files changed, 8 insertions(+), 1 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list