Include compiler-only arguments in the hash
After
5d8585b5 (#312), arguments that are not considered affecting the
preprocessor output won’t be passed to the preprocessor. -Werror and
-Wno-error are also not passed to the preprocessor so that options not
properly marked as “compiler only” will only trigger warnings, not
errors. This was a workaround for Clang complaining about unused
arguments in the preprocessor step performed by ccache.
However, it also introduced a regression: -Werror and the other options
were excluded from the hash as well. This means that
cc -c file_with_warnings.c
would be cached by ccache, including the warning message. A later
cc -Werror -c file_with_warnings.c
call would then be a cache hit, resulting in a compilation warning
instead of an error.
This commit fixes the problem by also including the compiler-only
arguments in the hash.
(cherry picked from commit
6be00a0070d3898fe7201f6db44a9a3c42627bf8)