I'd like to get actual targets of dependencies in the output instead of fixed "clang-scan-deps dependency" string. My primary motivation is ease of testing the tool despite non-deterministic order of targets in its output but I assume this might be useful in general.
Thanks for doing that! But it looks odd to attach the dependencies to the output file.
clang -MD -c foo.c -o foo.o
will attach the headers/dependencies to foo.c. foo.c includes the headers. It does not attach the headers to foo.o
It will work for make-like build systems, but it looks odd.
I realized there was an issue with adding the -o /dev/null to arguemnts in case when there was a -MD flag as Driver later adds -MT with the last -o value in case there's no -MT or -MQ. That means that for headers the target would always be /dev/null.
@dexonsmith pointed out that we could just conditionally add -MT in the adjustment. Also, we can use build directory instead of CDB index.