I would refer to an earlier conversation on the cfe-dev list...
On Wed, Nov 30, 2016 at 10:34 PM Laszlo Nagy <email@example.com> wrote:
- compilation flags like -MD, -MT x, -MF x, etc... might cause "duplicate" items in the compilation database. (the only difference would be the presence of these flags) i did modify the command line and filter out these flags. but if i'm following your logic, tooling libs shall notice that there is no semantic difference between the two compilation and run only once. (which is not the case now) would you be happy with that?
If there's no semantic difference, I'd argue that there should only be one entry in the compilation db. On the other hand, I'd not object to patches making the tooling infra deduplicate :)
So, I'm preparing a patch to get rid of duplicate compilation database entries. The current version is just a scratch, did not implemented the filtering itself, but just studied how this can be done. Looking forward for you comments, ideas!