]> git.ipfire.org Git - thirdparty/ccache.git/commit
Send dependency arguments to compiler if run_second_cpp is true
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 16 Jan 2020 20:04:09 +0000 (21:04 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 16 Jan 2020 20:04:09 +0000 (21:04 +0100)
commit07b55f13e119a2a35d166a73929643911ea69d52
tree0048374e754a1964e02fadf797c24a1bdc941395
parent810a194e30c229a77ccbea004ee5e7498a19f932
Send dependency arguments to compiler if run_second_cpp is true

If we run the compiler on the real source code on a cache miss (i.e.,
run_second_cpp is true) we can send the dependency arguments (-MD, etc.)
to the compiler instead of the preprocessor. When doing this there is no
need to add an implicit -MQ option to get the correct object file
location in the dependency file. Do so and also avoid adding an implicit
-MF option since that isn’t needed either. This should re-add support
for EDG-based compilers (see 6d453769 and #460).

If we run the compiler on the preprocessed source code on a cache miss
(i.e., run_second_cpp is false) we still need to let the preprocessor
generate the dependency file (the compiler doesn’t generate a dependency
file when compiling preprocessed source code) and thus we need to add
implicit -MQ and -MF.

This change reverts a fix (97b27781) for the Intel C++ compiler, but if
the Intel compiler still has problems the user can simply avoid setting
run_second_cpp to false.
src/ccache.cpp
test/suites/base.bash
test/suites/direct.bash
unittest/test_argument_processing.cpp