skia2/tools/skqp/generate_gn_args
Hal Canary ff2742eba8 SkQP: slim deps. Also skia_enable_fontmgr_empty
Change-Id: I24ee2fb3a4a4ca03a60ee2f1a90e022825eee409
Reviewed-on: https://skia-review.googlesource.com/101820
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-01-30 18:57:45 +00:00

49 lines
1.4 KiB
Python
Executable File

#! /usr/bin/env python
# Copyright 2018 Google Inc.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
fmt = '''
target_cpu = "{arch}"
is_debug = false
ndk = "{ndk}"
ndk_api = 26
skia_embed_resources = true
skia_enable_fontmgr_empty = true
skia_enable_pdf = false
skia_use_dng_sdk = false
skia_use_expat = false
skia_use_icu = false
skia_use_libheif = false
skia_use_lua = false
skia_use_piex = false
skia_use_skcms = false
'''
def make_args_gn(out_dir, ndk, arch):
if not os.path.exists(out_dir):
os.makedirs(out_dir)
with open(os.path.join(out_dir, 'args.gn'), 'w') as o:
o.write(fmt.format(ndk=os.path.abspath(ndk), arch=arch))
def usage():
sys.stderr.write(
'Usage:\n' +
' {} TARGET_BUILD_DIR ANDROID_NDK_DIR ARCHITECTURE\n\n'.format(sys.argv[0]) +
'ARCHITECTURE should be "arm" "arm64" "x86" or "x64"\n\n')
exit(1)
if __name__ == '__main__':
if len(sys.argv) != 4:
usage()
build, android_ndk, arch = sys.argv[1:4]
if len(build) == 0 or len(arch) == 0 or not os.path.isdir(android_ndk):
usage()
make_args_gn(build, android_ndk, arch)