xref: /aosp_15_r20/external/skia/gn/skqp_gn_args.py (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1# Copyright 2019 Google LLC.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5def GetGNArgs(api_level, debug, arch=None, ndk=None, is_android_bp=False):
6    gn_args = {
7        'ndk_api':                          api_level,
8        'is_debug':                         'true' if debug else 'false',
9        'skia_enable_fontmgr_android':      'false',
10        'skia_enable_fontmgr_empty':        'true',
11        'skia_enable_graphite':             'true',
12        'skia_enable_pdf':                  'false',
13        'skia_enable_skottie':              'false',
14        'skia_enable_skshaper':             'false',
15        'skia_enable_svg':                  'false',
16        'skia_enable_tools':                'true',
17        'skia_tools_require_resources':     'true',
18        'skia_use_dng_sdk':                 'false',
19        'skia_use_expat':                   'true',
20        'skia_use_freetype':                'false',
21        'skia_use_icu':                     'false',
22        'skia_use_libheif':                 'false',
23        'skia_use_lua':                     'false',
24        'skia_use_piex':                    'false',
25        'skia_use_vulkan':                  'true',
26        'skia_use_wuffs':                   'true',
27    }
28
29    def gn_quote(s):
30        return '"%s"' % s
31
32    if is_android_bp is True:
33        gn_args.update({
34            'target_os':          gn_quote("android"),
35            'target_cpu':         gn_quote("none"),
36            'is_official_build':  'true',
37            # gn_to_bp.py copies vk_mem_alloc.h to //vma_android/include
38            'skia_vulkan_memory_allocator_dir': '"//vma_android"',
39        })
40    else:
41        gn_args.update({
42            'target_cpu':  gn_quote(arch),
43            'ndk':         gn_quote(ndk),
44        })
45    return gn_args
46