summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2012-03-26 03:16:15 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2012-03-26 03:46:12 (GMT)
commit6b5614f1642dcb75fd9de9571c813b21e4f9ce2b (patch)
treea588742369a9c8dab2cff35b574121eed9669cff /Modules/Compiler
parentc337c7e205259d5944b19c2a6d2007f490379ddc (diff)
downloadCMake-6b5614f1642dcb75fd9de9571c813b21e4f9ce2b.zip
CMake-6b5614f1642dcb75fd9de9571c813b21e4f9ce2b.tar.gz
CMake-6b5614f1642dcb75fd9de9571c813b21e4f9ce2b.tar.bz2
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.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/GNU.cmake5
1 files changed, 4 insertions, 1 deletions
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.