skia2/gn/skqp_gn_args.py
Kevin Lubick 196b172650 [sksl] Make sksl tracing optional
This removes the required dependency on our JSON code. In the Bazel
rules, this dependency is pushed down into sksl instead of required
by the cc_binary rules.

It adds a stub version of SkVMDebugTrace.cpp and removes
SkVMDebugTracePlayer unless the appropriate GN or Bazel flag
is set (skia_enable_sksl_tracing and enable_sksl_tracing,
respectively). There was an existing #define that CanvasKit
used (CK_INCLUDE_SKSL_TRACE) and this was changed to
SKSL_ENABLE_TRACING.

Users of //:skia_core no longer need to specify a JSON dep,
if sksl needs it (e.g. for tracing), then it will specify
the dependency.

This is a reland of https://skia-review.googlesource.com/c/skia/+/528837

Bug: skia:12541
Change-Id: I79612c69fdbefd3db9822a2b66df7552f7c13865
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529278
Reviewed-by: John Stiles <johnstiles@google.com>
2022-04-12 13:59:25 +00:00

46 lines
1.8 KiB
Python

# Copyright 2019 Google LLC.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def GetGNArgs(api_level, debug, arch=None, ndk=None, is_android_bp=False):
gn_args = {
'ndk_api': api_level,
'is_debug': 'true' if debug else 'false',
'skia_enable_fontmgr_android': 'false',
'skia_enable_fontmgr_empty': 'true',
'skia_enable_pdf': 'false',
'skia_enable_skottie': 'false',
'skia_enable_skshaper': 'false',
'skia_enable_sksl_tracing': 'true',
'skia_enable_sktext': 'false',
'skia_enable_svg': 'false',
'skia_enable_tools': 'true',
'skia_tools_require_resources': 'true',
'skia_use_dng_sdk': 'false',
'skia_use_expat': 'true',
'skia_use_freetype': 'false',
'skia_use_icu': 'false',
'skia_use_libgifcodec': 'false',
'skia_use_libheif': 'false',
'skia_use_lua': 'false',
'skia_use_piex': 'false',
'skia_use_vulkan': 'true',
'skia_use_wuffs': 'true',
}
def gn_quote(s):
return '"%s"' % s
if is_android_bp is True:
gn_args.update({
'target_os': gn_quote("android"),
'target_cpu': gn_quote("none"),
'is_official_build': 'true',
})
else:
gn_args.update({
'target_cpu': gn_quote(arch),
'ndk': gn_quote(ndk),
})
return gn_args