GN: only write targets that should be generated.

Apparently forever GN has been writing .ninja files for targets that were resolved but didn't have the "should generate" bit set. The "should generate" bit will be unset for things in non-default toolchains that aren't required to build anything in the main toolchain. This set of things is small since most things will have incomplete deps if they're not required. But it comes up for a few NaCl copy rules.

The extra files were never a problem because only "should generate" targets were written to the main ninja file, so the extra files were just unreferenced. The recent change that moves more stuff into the main file rather than subninjas exposed the bug, which now appears as multiply-defined targets.

This fix only issues the callback when an item is both resolved and "should generate" is set.

Review-Url: https://codereview.chromium.org/2195753002
Cr-Original-Commit-Position: refs/heads/master@{#408676}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: da21696cd246f78f66bdb5d6f6aa9deadf2e6abc
3 files changed
tree: f83364fe30988e1793f4db8c9695a455a2f5ff42
  1. tools/