11 skia_dir = checkout_root.join(
'skia')
12 compiler = api.vars.builder_cfg.get(
'compiler')
13 configuration = api.vars.builder_cfg.get(
'configuration')
14 extra_tokens = api.vars.extra_tokens
15 os = api.vars.builder_cfg.get(
'os')
16 target_arch = api.vars.builder_cfg.get(
'target_arch')
18 assert compiler ==
'Clang'
22 if configuration ==
'Debug':
23 extra_cflags.append(
'-O1')
25 ndk_asset =
'android_ndk_linux'
28 ndk_asset =
'android_ndk_darwin'
31 ndk_asset =
'android_ndk_windows'
34 quote =
lambda x:
'"%s"' % x
36 'ndk': quote(api.vars.workdir.join(ndk_path)),
37 'target_cpu': quote(target_arch),
41 extra_cflags.append(
'-DREBUILD_IF_CHANGED_ndk_version=%s' %
42 api.run.asset_version(ndk_asset, skia_dir))
44 if configuration !=
'Debug':
45 args[
'is_debug'] =
'false'
46 if 'Dawn' in extra_tokens:
47 util.set_dawn_args_and_env(args, env, api, extra_tokens, skia_dir)
49 if 'Vulkan' in extra_tokens
and not 'Dawn' in extra_tokens:
51 args[
'skia_enable_vulkan_debug_layers'] =
'false'
52 args[
'skia_use_gl'] =
'false'
53 args[
'skia_use_vulkan'] =
'true'
54 if 'ASAN' in extra_tokens:
55 args[
'sanitize'] =
'"ASAN"'
56 if 'Graphite' in extra_tokens:
57 args[
'skia_enable_graphite'] =
'true'
58 if 'HWASAN' in extra_tokens:
59 args[
'sanitize'] =
'"HWASAN"'
60 if 'Wuffs' in extra_tokens:
61 args[
'skia_use_wuffs'] =
'true'
62 if configuration ==
'OptimizeForSize':
65 extra_ldflags.append(
'-Wl,--build-id=sha1')
67 'skia_use_runtime_icu':
'true',
68 'skia_enable_optimize_size':
'true',
69 'skia_use_jpeg_gainmaps':
'false',
74 if 'FrameworkWorkarounds' in extra_tokens:
75 extra_cflags.append(
'-DSK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE')
78 for t
in extra_tokens:
79 m = re.search(
r'API(\d+)', t)
80 if m
and len(m.groups()) == 1:
81 args[
'ndk_api'] = m.groups()[0]
85 args[
'extra_cflags'] = repr(extra_cflags).replace(
"'",
'"')
87 args[
'extra_ldflags'] = repr(extra_ldflags).replace(
"'",
'"')
89 gn_args =
' '.
join(
'%s=%s' % (k,v)
for (k,v)
in sorted(args.items()))
90 gn = skia_dir.join(
'bin',
'gn')
92 with api.context(cwd=skia_dir):
93 api.run(api.step,
'fetch-gn',
94 cmd=[
'python3', skia_dir.join(
'bin',
'fetch-gn')],
97 api.run(api.step,
'fetch-ninja',
98 cmd=[
'python3', skia_dir.join(
'bin',
'fetch-ninja')],
102 api.run(api.step,
'gn gen',
103 cmd=[gn,
'gen', out_dir,
'--args=' + gn_args])
104 api.run(api.step,
'ninja', cmd=[
'ninja',
'-C', out_dir])
107ANDROID_BUILD_PRODUCTS_LIST = [
117 """Copy Android build products from src to dst."""
118 util.copy_listed_files(api, src, dst, ANDROID_BUILD_PRODUCTS_LIST)
def copy_build_products(api, src, dst)
def compile_fn(api, checkout_root, out_dir)
static SkString join(const CommandLineFlags::StringArray &)