GN header checker enhancements.

This makes the check_includes flag work the way one would expect. Previously we
would only skip include checking if all targets that include a file opt out.
This was coming up in the Android Java enum generator where a header file was
being processed by a script (so includes don't matter and there are no deps)
but that header was also listed as a source in a different target with header
checking enabled (which is always the case for this example).

Improves error messaging for cross-compiling. Previously if you were
cross-compiling and forgot a dependency on e.g. base, you'd get a message "you
must depend on "//base:base" or "//base:base" because it found the files in two
different toolchain builds of base. This patch prunes such duplicates when
possible, and turns on toolchain labels if things aren't all in the same
toolchain.

BUG=

Review URL: https://codereview.chromium.org/946043002

Cr-Original-Commit-Position: refs/heads/master@{#317446}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f16d8d8d34fb9403852423df5adcf741b9bb8beb
3 files changed
tree: b53c4475f663095e729aee85ab4edeed20cb43fb
  1. tools/