Make sure abs-path gn labels have separate target_gen_dirs

Use gen/ABS_PATH/... for target_gen_dir of build files outside of the
source tree, to mimic obj/ABS_PATH that's used for object directories
for such build files.

Previously, all build files outside of the source tree would use
root_gen_dir (e.g. out/Default/gen) as target_gen_dir. This broke the
"target_gen_dir is unique between different BUILD.gn files" assumption,
causing strange behavior and "ninja: multiple targets generate ..."
warnings for users of absolute path BUILD.gn files outside of //.

BUG=445454
R=brettw@chromium.org

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

Cr-Original-Commit-Position: refs/heads/master@{#356011}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5b6813c06deae18ca309fba9913ee18e28150122
3 files changed
tree: 0994821a711377fd7ea13ca01014102154a0c8b7
  1. tools/