GN: do not make indirect dependency to direct dependency

If a target is hard dep, there is no need to have the action targets's
recursive deps as direct dependency, because such dependency is
transitive.

This is found by pcc in gn-dev
https://groups.google.com/a/chromium.org/forum/#!topic/gn-dev/BcrSfPQE84E

With this change, generated android's toolchain.ninja size is reduced
from 262MB to 31MB. And ninja's startup time reduced from 4.9~5.1s to
2.6s.
I used args.gn same with android_n5x_swarming_rel bot.

Also this patch reduced the time of `gn gen` from 9.5~10.3s to 6.8~7.2s
on my machine.

Change-Id: I0f0214d3abe74143516b263da839e98b3987fb64
Reviewed-on: https://chromium-review.googlesource.com/1041506
Reviewed-by: Brett Wilson <brettw@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#557365}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e8a3ce9119189ad6ba5ecaa62bb0b53b07c895f4
3 files changed
tree: ab8d9e5f0072e583fed34aa711edd729644e18c9
  1. tools/