diff options
author | Ben Wagner <bungeman@google.com> | 2017-02-23 18:00:06 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-24 14:48:22 +0000 |
commit | e127523b4af6f415dd9c1dc730a264781fbd1d5b (patch) | |
tree | e073a4f03ccf4167ad14a6f1c2c04ce38fef1ee9 /gn/gn_to_bp.py | |
parent | 420e38f586ed21a51c9d216c422b4c4d5ab2dc97 (diff) |
gn_to_bp to recurse deps.
Currently gn_to_bp GrabDependentSrcs only grabs the top level deps of
a target. In a proposed change there are more levels of deps to
clarify the real dependencies. To make this work well, a number of
lists are now sets to avoid including the same file multiple times.
Change-Id: I5005718e42762fe411215920e8991ab27138c7eb
Reviewed-on: https://skia-review.googlesource.com/8936
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'gn/gn_to_bp.py')
-rw-r--r-- | gn/gn_to_bp.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py index b8b005e397..94db28b3cd 100644 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py @@ -205,7 +205,7 @@ subprocess.check_call(['gn', 'gen', tmp, '--args=%s' % gn_args, '--ide=json']) js = json.load(open(os.path.join(tmp, 'project.json'))) def strip_slashes(lst): - return [str(p.lstrip('/')) for p in lst] + return {str(p.lstrip('/')) for p in lst} srcs = strip_slashes(js['targets']['//:skia']['sources']) local_includes = strip_slashes(js['targets']['//:skia']['include_dirs']) @@ -228,16 +228,17 @@ def GrabDependentSrcs(name, srcs_to_extend, exclude): continue # We'll handle all cpu-specific sources manually later. if exclude and exclude in dep: continue - srcs_to_extend.extend(strip_slashes(js['targets'][dep].get('sources', []))) + srcs_to_extend.update(strip_slashes(js['targets'][dep].get('sources', []))) + GrabDependentSrcs(dep, srcs_to_extend, exclude) GrabDependentSrcs('//:skia', srcs, None) GrabDependentSrcs('//:dm', dm_srcs, 'skia') GrabDependentSrcs('//:nanobench', nanobench_srcs, 'skia') # No need to list headers. -srcs = [s for s in srcs if not s.endswith('.h')] -dm_srcs = [s for s in dm_srcs if not s.endswith('.h')] -nanobench_srcs = [s for s in nanobench_srcs if not s.endswith('.h')] +srcs = {s for s in srcs if not s.endswith('.h')} +dm_srcs = {s for s in dm_srcs if not s.endswith('.h')} +nanobench_srcs = {s for s in nanobench_srcs if not s.endswith('.h')} # Most defines go into SkUserConfig.h, where they're seen by Skia and its users. # Start with the defines :skia uses, minus a couple. We'll add more in a bit. |