aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xgn/find_headers.py30
-rw-r--r--modules/skottie/BUILD.gn5
2 files changed, 22 insertions, 13 deletions
diff --git a/gn/find_headers.py b/gn/find_headers.py
index cbb59b5d95..d02bd906b7 100755
--- a/gn/find_headers.py
+++ b/gn/find_headers.py
@@ -27,27 +27,35 @@ include_dirs = [os.path.join(os.path.normpath(include_dir), '')
for include_dir in include_dirs]
include_dirs.sort(key=len, reverse=True)
-# If skia ever uses 'public' that will need to be considered as well or instead.
-gn_sources_cmd = [gn, 'desc', '.', '--root=%s' % absolute_source,
- '--format=json', '*', 'sources']
+gn_desc_cmd = [gn, 'desc', '.', '--root=%s' % absolute_source, '--format=json',
+ '*']
-sources_json_txt = ''
+desc_json_txt = ''
try:
- sources_json_txt = subprocess.check_output(gn_sources_cmd)
+ desc_json_txt = subprocess.check_output(gn_desc_cmd)
except subprocess.CalledProcessError as e:
print e.output
raise
-sources_json = {}
+desc_json = {}
try:
- sources_json = json.loads(sources_json_txt)
+ desc_json = json.loads(desc_json_txt)
except ValueError:
- print sources_json_txt
+ print desc_json_txt
raise
-sources = {os.path.join(absolute_source, os.path.normpath(source[2:]))
- for target in sources_json.itervalues()
- for source in target.get('sources', [])}
+sources = set()
+
+for target in desc_json.itervalues():
+ # We'll use `public` headers if they're listed, or pull them from `sources`
+ # if not. GN sneaks in a default "public": "*" into the JSON if you don't
+ # set one explicitly.
+ search_list = target.get('public')
+ if search_list == '*':
+ search_list = target.get('sources', [])
+
+ for name in search_list:
+ sources.add(os.path.join(absolute_source, os.path.normpath(name[2:])))
Header = collections.namedtuple('Header', ['absolute', 'include'])
headers = {}
diff --git a/modules/skottie/BUILD.gn b/modules/skottie/BUILD.gn
index 1e8ccb2df8..59223de916 100644
--- a/modules/skottie/BUILD.gn
+++ b/modules/skottie/BUILD.gn
@@ -17,9 +17,10 @@ config("public_config") {
source_set("skottie") {
if (skia_enable_skottie) {
public_configs = [ ":public_config" ]
- sources = [
- # TODO: move this to public
+ public = [
"include/Skottie.h",
+ ]
+ sources = [
"src/Skottie.cpp",
"src/SkottieAdapter.cpp",
"src/SkottieAdapter.h",