blob: b1d3c4a655370f9f3499bb01d6d48ecb4ad54953 [file] [log] [blame]
Hal Canary32498f02019-02-04 15:36:31 -05001# 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
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05005if (!defined(is_skia_standalone)) {
6 is_skia_standalone = false
Hal Canary32498f02019-02-04 15:36:31 -05007}
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05008
John Rosasco24cbdab2019-09-25 14:14:35 -07009is_skia_dev_build = is_skia_standalone && !is_official_build
Hal Canary3e710b02019-09-04 10:05:33 -040010
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -050011declare_args() {
Hal Canaryc7b263b2019-09-03 13:46:25 -040012 skia_android_serial = ""
13 skia_compile_processors = false
Chinmay Gardef832c0a2020-03-18 14:37:23 -070014 skia_enable_api_available_macro = true
Leon Scroggins III63cfb362020-04-24 13:00:48 -040015 skia_enable_android_utils = is_skia_dev_build
Hal Canaryc7b263b2019-09-03 13:46:25 -040016 skia_enable_ccpr = true
17 skia_enable_discrete_gpu = true
18 skia_enable_flutter_defines = false
19 skia_enable_fontmgr_empty = false
20 skia_enable_fontmgr_fuchsia = is_fuchsia
21 skia_enable_fontmgr_win = is_win
22 skia_enable_fontmgr_win_gdi = is_win
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -050023 skia_enable_gpu = true
Hal Canaryc7b263b2019-09-03 13:46:25 -040024 skia_enable_pdf = true
Hal Canary60ff6512020-01-21 12:39:20 -050025 skia_enable_skottie = !(is_win && is_component_build)
Florin Malita26ae40f2020-06-08 12:03:48 -040026 skia_enable_skrive = true
Hal Canaryc7b263b2019-09-03 13:46:25 -040027 skia_enable_sksl_interpreter = is_skia_dev_build
28 skia_enable_skvm_jit =
Mike Klein511cf4f2020-06-23 17:21:06 -050029 is_skia_dev_build &&
30 ((target_cpu == "x64" && (is_linux || is_mac || is_win)) ||
31 (target_cpu == "arm64" && is_android))
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -050032 skia_enable_tools = is_skia_dev_build
Jim Van Verth03b8ab22020-02-24 11:36:15 -050033 skia_enable_gpu_debug_layers = is_skia_dev_build && is_debug
Hal Canaryc7b263b2019-09-03 13:46:25 -040034 skia_generate_workarounds = false
35 skia_include_multiframe_procs = false
36 skia_lex = false
Hal Canary2dad9902019-11-20 16:01:31 -050037 skia_libgifcodec_path = "third_party/externals/libgifcodec"
Mike Klein96f64012020-04-03 10:59:37 -050038 skia_pdf_subset_harfbuzz =
39 false # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz.
Hal Canaryc7b263b2019-09-03 13:46:25 -040040 skia_qt_path = getenv("QT_PATH")
41 skia_skqp_global_error_tolerance = 0
42 skia_tools_require_resources = false
John Rosasco24cbdab2019-09-25 14:14:35 -070043 skia_update_fuchsia_sdk = false
Hal Canaryc7b263b2019-09-03 13:46:25 -040044 skia_use_angle = false
45 skia_use_dawn = false
Jim Van Verthb01e12b2020-02-18 14:34:38 -050046 skia_use_direct3d = false
Hal Canaryc7b263b2019-09-03 13:46:25 -040047 skia_use_egl = false
48 skia_use_expat = true
49 skia_use_experimental_xform = false
50 skia_use_ffmpeg = false
51 skia_use_fixed_gamma_text = is_android
52 skia_use_fontconfig = is_linux
Ben Wagnerd13487e2020-06-03 23:29:43 -040053 skia_use_fonthost_mac = is_mac || is_ios
Hal Canaryc7b263b2019-09-03 13:46:25 -040054 skia_use_freetype = is_android || is_fuchsia || is_linux
Kevin Lubick867da4b2019-02-22 15:55:39 -050055 skia_use_harfbuzz = true
John Rosascoa9b348f2019-11-08 13:18:15 -080056 skia_use_gl = !is_fuchsia
Julia Lavrovae65c5fc2020-03-09 09:59:56 -040057 skia_use_icu = !is_fuchsia
Hal Canaryc7b263b2019-09-03 13:46:25 -040058 skia_use_libheif = is_skia_dev_build
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -040059 skia_use_libjpeg_turbo_decode = true
60 skia_use_libjpeg_turbo_encode = true
61 skia_use_libpng_decode = true
62 skia_use_libpng_encode = true
63 skia_use_libwebp_decode = true
64 skia_use_libwebp_encode = true
Hal Canaryc7b263b2019-09-03 13:46:25 -040065 skia_use_lua = is_skia_dev_build && !is_ios
66 skia_use_metal = false
67 skia_use_opencl = false
68 skia_use_piex = !is_win
69 skia_use_wuffs = false
70 skia_use_x11 = is_linux
71 skia_use_xps = true
72 skia_use_zlib = true
73
Mike Klein2b54e832020-07-10 12:56:07 -050074 skia_vtune_path = ""
75
Hal Canaryc7b263b2019-09-03 13:46:25 -040076 if (is_ios) {
77 skia_ios_identity = ".*Google.*"
78 skia_ios_profile = "Google Development"
79 }
80
81 if (is_mac) {
82 skia_gl_standard = "gl"
83 } else if (is_ios) {
84 skia_gl_standard = "gles"
85 } else {
86 skia_gl_standard = ""
87 }
88
89 if (is_android) {
90 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
91 } else if (is_fuchsia) {
John Rosasco24cbdab2019-09-25 14:14:35 -070092 skia_use_vulkan = true
Hal Canaryc7b263b2019-09-03 13:46:25 -040093 } else {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -040094 skia_use_vulkan = false
Hal Canaryc7b263b2019-09-03 13:46:25 -040095 }
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -050096}
Hal Canaryc7b263b2019-09-03 13:46:25 -040097
Hal Canary2a3093c2019-02-20 11:25:45 -050098declare_args() {
Hal Canaryc7b263b2019-09-03 13:46:25 -040099 skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
Ben Wagner75626e42020-06-03 13:20:37 -0400100 skia_enable_fontmgr_custom_directory = skia_use_freetype && !is_fuchsia
101 skia_enable_fontmgr_custom_embedded = skia_use_freetype && !is_fuchsia
102 skia_enable_fontmgr_custom_empty = skia_use_freetype
103 skia_enable_fontmgr_fontconfig = skia_use_freetype && skia_use_fontconfig
104 skia_enable_fontmgr_FontConfigInterface =
105 skia_use_freetype && skia_use_fontconfig
Hal Canaryc7b263b2019-09-03 13:46:25 -0400106 skia_enable_nvpr = !skia_enable_flutter_defines
107 skia_enable_spirv_validation = is_skia_dev_build && is_debug && !skia_use_dawn
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -0400108 skia_use_dng_sdk =
109 !is_fuchsia && skia_use_libjpeg_turbo_decode && skia_use_zlib
Hal Canary2dad9902019-11-20 16:01:31 -0500110 skia_use_libgifcodec = !skia_use_wuffs
Hal Canaryc7b263b2019-09-03 13:46:25 -0400111 skia_use_sfntly = skia_use_icu
Jim Van Verth03b8ab22020-02-24 11:36:15 -0500112 skia_enable_vulkan_debug_layers = skia_enable_gpu_debug_layers
113 skia_enable_direct3d_debug_layer = skia_enable_gpu_debug_layers
Greg Danielb16beb92020-04-27 14:26:21 +0000114 skia_use_vma = skia_use_vulkan
Hal Canary2a3093c2019-02-20 11:25:45 -0500115}
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500116
Ben Wagner75626e42020-06-03 13:20:37 -0400117declare_args() {
118 # skia_fontmgr_factory should define SkFontMgr::Factory()
119 if (skia_enable_fontmgr_empty) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400120 skia_fontmgr_factory = ":fontmgr_empty_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400121 } else if (is_android && skia_enable_fontmgr_android) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400122 skia_fontmgr_factory = ":fontmgr_android_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400123 } else if (is_win && skia_enable_fontmgr_win) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400124 skia_fontmgr_factory = ":fontmgr_win_factory"
Chris Bracken72f403c2020-06-17 14:10:52 -0700125 } else if ((is_mac || is_ios) && skia_use_fonthost_mac) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400126 skia_fontmgr_factory = ":fontmgr_mac_ct_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400127 } else if (skia_enable_fontmgr_fontconfig) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400128 skia_fontmgr_factory = ":fontmgr_fontconfig_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400129 } else if (skia_enable_fontmgr_custom_directory) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400130 skia_fontmgr_factory = ":fontmgr_custom_directory_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400131 } else if (skia_enable_fontmgr_custom_embedded) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400132 skia_fontmgr_factory = ":fontmgr_custom_embedded_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400133 } else if (skia_enable_fontmgr_custom_empty) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400134 skia_fontmgr_factory = ":fontmgr_custom_empty_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400135 } else {
136 #"src/ports/SkFontMgr_FontConfigInterface_factory.cpp" #WontFix
137 #"src/ports/SkFontMgr_win_gdi_factory.cpp" # WontFix
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400138 skia_fontmgr_factory = ":fontmgr_empty_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400139 }
140}
141
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500142# Our tools require static linking (they use non-exported symbols), and the GPU backend.
143skia_enable_tools = skia_enable_tools && !is_component_build && skia_enable_gpu