blob: c527208c040c84b67c6536f32225f5b46cf347c4 [file] [log] [blame]
Hal Canary181ec2f2018-01-24 13:42:38 -05001#! /usr/bin/env python
2
3# Copyright 2018 Google Inc.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7import os
8import sys
9
Hal Canaryff2742e2018-01-30 11:35:47 -050010fmt = '''
Hal Canary2331c822018-02-01 14:06:13 -050011target_cpu = "{arch}"
12is_debug = false
13ndk = "{ndk}"
14ndk_api = 26
15skia_enable_fontmgr_empty = true
16skia_enable_pdf = false
17skia_skqp_global_error_tolerance = 4
18skia_use_dng_sdk = false
19skia_use_expat = false
20skia_use_icu = false
21skia_use_libheif = false
22skia_use_lua = false
23skia_use_piex = false
24skia_use_skcms = false
Hal Canary181ec2f2018-01-24 13:42:38 -050025'''
26
27def make_args_gn(out_dir, ndk, arch):
28 if not os.path.exists(out_dir):
29 os.makedirs(out_dir)
30 with open(os.path.join(out_dir, 'args.gn'), 'w') as o:
31 o.write(fmt.format(ndk=os.path.abspath(ndk), arch=arch))
32
33def usage():
34 sys.stderr.write(
35 'Usage:\n' +
36 ' {} TARGET_BUILD_DIR ANDROID_NDK_DIR ARCHITECTURE\n\n'.format(sys.argv[0]) +
37 'ARCHITECTURE should be "arm" "arm64" "x86" or "x64"\n\n')
38 exit(1)
39
40if __name__ == '__main__':
41 if len(sys.argv) != 4:
42 usage()
43 build, android_ndk, arch = sys.argv[1:4]
44 if len(build) == 0 or len(arch) == 0 or not os.path.isdir(android_ndk):
45 usage()
46 make_args_gn(build, android_ndk, arch)
47
48