Use the compiler's dependency output to get the list of source files,
and do not run the preprocessor to get the object hash. Instead base
the object hash on the checksums of the individual files, which we
already collect within direct mode.
In short, on a direct cache miss, immediately run the actual
compiler (with -MD/-MMD). Get the include files from the .d file and
calculate their hashes. Use these hashes for both the manifest file
and to create the object hash.
This is currently in a working but still proof of concept state:
- the -MD/-MMD flags are not added dynamically, but are required to
be already present.
- some code could be cleaner
- there are still a few FIXME comments left
- there are only a few integration tests
- the documentation has not been updated yet
Some notes on this commit:
- added new function `object_hash_from_depfile()`, which borrows some
code from `use_relative_paths_in_depfile()`.
- `remember_include_file()` has an additional param to update the hash
used for depend mode
- Because in depend mode we do not know the object hash in advance, we
cannot create temporary files based on the object hash anymore within
`to_cache()`. The new temporary files for stdout and stderr are not
necessarily on the same file system, and we cannot use
`move_file_to_cache_same_fs()` anymore. Removed the latter to
prevent "unused function" warnings.