GN: Use source root as base for gn gen filters

When running gn gen with filters for the IDE output from ninja,
the gn gen command used the working directory (//out/foo) as the
base for resolving the filters, rather than "//" as is done when
running gn gen directly.

This CL fixes that by always using "//" as the root_dir. It also
fixes filter labels that have had the leading "/" in "//" removed
by Git Bash.

R=dpranke@chromium.org

Change-Id: I6c6e6f5e720d50b325d8b368f94ee1b3b5931627
Reviewed-on: https://chromium-review.googlesource.com/941209
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Yngve Pettersen <yngve@vivaldi.com>
Cr-Original-Commit-Position: refs/heads/master@{#548215}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f7ccdc763eb515b93850db40cc6ea44c02e2015a
1 file changed
tree: 36d8bf9dc4c23cc8a0353ada63f7441cce392931
  1. tools/