ChuanqiXu added a comment.

> IMO, this is not suitable; there must be *one* depfile for Ninja to work 
> (otherwise build tools will need to manually collate all of this into one for 
> ninja.

Yeah, but the producer of the compilation database is able to create a 
compilation db with the same `-MF` option. Do you mean you will feel much 
better that the clang-scan-deps will have a strong check?

>> 2. (The original way) Specify -MF in the command line of clang-scan-deps.
>
> I feel this scales and communicates what is happening much better because it 
> actually is a flag for clang-scan-deps itself.

There is a related problem that how do we set the target of the dependency? In 
per file mode, we can easily specify it in the command line of clang-scan-deps. 
But we have to extract them ("-MT") from the command line with compilation 
database. (Otherwise all the targets have the same name, which is incorrect). 
Do you think it is acceptable?

> In what mode will clang output #include information without erroring about 
> missing .pcm files for import statements? -E -fdirectives-only perhaps? This 
> further exacerbates the need for "fake" command lines and costs on platforms 
> with expensive process execution.

After we land D137526 <https://reviews.llvm.org/D137526>, we are able to do 
this by: `-M -MF <dep_file> -E`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139168/new/

https://reviews.llvm.org/D139168

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to