blob: 9bff3b194fb90366d631c1835e8c61bcec744347 [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
Jason Simmonsd8e94362021-01-11 15:52:03 -080024 skia_enable_icu_ubrk_safeclone = false
Hal Canaryc7b263b2019-09-03 13:46:25 -040025 skia_enable_pdf = true
Hal Canary60ff6512020-01-21 12:39:20 -050026 skia_enable_skottie = !(is_win && is_component_build)
Florin Malita26ae40f2020-06-08 12:03:48 -040027 skia_enable_skrive = true
Mike Klein13ec5442020-08-14 07:36:54 -050028 skia_enable_skvm_jit_when_possible = is_skia_dev_build
Florin Malitab3418102020-10-15 18:10:29 -040029 skia_enable_svg = true
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -050030 skia_enable_tools = is_skia_dev_build
Jim Van Verth03b8ab22020-02-24 11:36:15 -050031 skia_enable_gpu_debug_layers = is_skia_dev_build && is_debug
Hal Canaryc7b263b2019-09-03 13:46:25 -040032 skia_generate_workarounds = false
33 skia_include_multiframe_procs = false
34 skia_lex = false
Hal Canary2dad9902019-11-20 16:01:31 -050035 skia_libgifcodec_path = "third_party/externals/libgifcodec"
Mike Klein96f64012020-04-03 10:59:37 -050036 skia_pdf_subset_harfbuzz =
37 false # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz.
Hal Canaryc7b263b2019-09-03 13:46:25 -040038 skia_qt_path = getenv("QT_PATH")
39 skia_skqp_global_error_tolerance = 0
40 skia_tools_require_resources = false
John Rosasco24cbdab2019-09-25 14:14:35 -070041 skia_update_fuchsia_sdk = false
Hal Canaryc7b263b2019-09-03 13:46:25 -040042 skia_use_angle = false
43 skia_use_dawn = false
Jim Van Verthb01e12b2020-02-18 14:34:38 -050044 skia_use_direct3d = false
Hal Canaryc7b263b2019-09-03 13:46:25 -040045 skia_use_egl = false
46 skia_use_expat = true
47 skia_use_experimental_xform = false
48 skia_use_ffmpeg = false
49 skia_use_fixed_gamma_text = is_android
50 skia_use_fontconfig = is_linux
Ben Wagnerd13487e2020-06-03 23:29:43 -040051 skia_use_fonthost_mac = is_mac || is_ios
Hal Canaryc7b263b2019-09-03 13:46:25 -040052 skia_use_freetype = is_android || is_fuchsia || is_linux
Kevin Lubick867da4b2019-02-22 15:55:39 -050053 skia_use_harfbuzz = true
John Rosascoa9b348f2019-11-08 13:18:15 -080054 skia_use_gl = !is_fuchsia
Julia Lavrovae65c5fc2020-03-09 09:59:56 -040055 skia_use_icu = !is_fuchsia
Hal Canaryc7b263b2019-09-03 13:46:25 -040056 skia_use_libheif = is_skia_dev_build
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -040057 skia_use_libjpeg_turbo_decode = true
58 skia_use_libjpeg_turbo_encode = true
59 skia_use_libpng_decode = true
60 skia_use_libpng_encode = true
61 skia_use_libwebp_decode = true
62 skia_use_libwebp_encode = true
Hal Canaryc7b263b2019-09-03 13:46:25 -040063 skia_use_lua = is_skia_dev_build && !is_ios
64 skia_use_metal = false
Leon Scroggins III326b9892020-08-05 16:51:10 -040065 skia_use_ndk_images = is_android && defined(ndk_api) && ndk_api >= 30
Hal Canaryc7b263b2019-09-03 13:46:25 -040066 skia_use_opencl = false
67 skia_use_piex = !is_win
Florin Malita59a3c3b2020-08-13 14:12:10 -040068 skia_use_sfml = false
Kevin Lubick204c3be2020-08-19 14:30:58 -040069 skia_use_webgl = false
Hal Canaryc7b263b2019-09-03 13:46:25 -040070 skia_use_wuffs = false
71 skia_use_x11 = is_linux
72 skia_use_xps = true
73 skia_use_zlib = true
74
Mike Klein2b54e832020-07-10 12:56:07 -050075 skia_vtune_path = ""
76
Hal Canaryc7b263b2019-09-03 13:46:25 -040077 if (is_ios) {
78 skia_ios_identity = ".*Google.*"
79 skia_ios_profile = "Google Development"
80 }
81
82 if (is_mac) {
83 skia_gl_standard = "gl"
84 } else if (is_ios) {
85 skia_gl_standard = "gles"
86 } else {
87 skia_gl_standard = ""
88 }
89
90 if (is_android) {
91 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
92 } else if (is_fuchsia) {
John Rosasco24cbdab2019-09-25 14:14:35 -070093 skia_use_vulkan = true
Hal Canaryc7b263b2019-09-03 13:46:25 -040094 } else {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -040095 skia_use_vulkan = false
Hal Canaryc7b263b2019-09-03 13:46:25 -040096 }
Kevin Lubick272e8bc2020-09-15 10:05:41 -040097
Mike Klein6f3ed7f2020-09-15 11:01:45 -050098 skia_build_fuzzers = is_clang && is_linux && target_cpu == "x64"
Kevin Lubick272e8bc2020-09-15 10:05:41 -040099 skia_use_libfuzzer_defaults = true
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500100}
Hal Canaryc7b263b2019-09-03 13:46:25 -0400101
Hal Canary2a3093c2019-02-20 11:25:45 -0500102declare_args() {
John Stilesd836f842020-09-14 10:21:44 -0400103 skia_compile_sksl_tests = skia_compile_processors
Hal Canaryc7b263b2019-09-03 13:46:25 -0400104 skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
Ben Wagner75626e42020-06-03 13:20:37 -0400105 skia_enable_fontmgr_custom_directory = skia_use_freetype && !is_fuchsia
106 skia_enable_fontmgr_custom_embedded = skia_use_freetype && !is_fuchsia
107 skia_enable_fontmgr_custom_empty = skia_use_freetype
108 skia_enable_fontmgr_fontconfig = skia_use_freetype && skia_use_fontconfig
109 skia_enable_fontmgr_FontConfigInterface =
110 skia_use_freetype && skia_use_fontconfig
Hal Canaryc7b263b2019-09-03 13:46:25 -0400111 skia_enable_nvpr = !skia_enable_flutter_defines
112 skia_enable_spirv_validation = is_skia_dev_build && is_debug && !skia_use_dawn
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -0400113 skia_use_dng_sdk =
114 !is_fuchsia && skia_use_libjpeg_turbo_decode && skia_use_zlib
Hal Canary2dad9902019-11-20 16:01:31 -0500115 skia_use_libgifcodec = !skia_use_wuffs
Hal Canaryc7b263b2019-09-03 13:46:25 -0400116 skia_use_sfntly = skia_use_icu
Jim Van Verth03b8ab22020-02-24 11:36:15 -0500117 skia_enable_vulkan_debug_layers = skia_enable_gpu_debug_layers
118 skia_enable_direct3d_debug_layer = skia_enable_gpu_debug_layers
Greg Danielb16beb92020-04-27 14:26:21 +0000119 skia_use_vma = skia_use_vulkan
Hal Canary2a3093c2019-02-20 11:25:45 -0500120}
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500121
Ben Wagner75626e42020-06-03 13:20:37 -0400122declare_args() {
123 # skia_fontmgr_factory should define SkFontMgr::Factory()
124 if (skia_enable_fontmgr_empty) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400125 skia_fontmgr_factory = ":fontmgr_empty_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400126 } else if (is_android && skia_enable_fontmgr_android) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400127 skia_fontmgr_factory = ":fontmgr_android_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400128 } else if (is_win && skia_enable_fontmgr_win) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400129 skia_fontmgr_factory = ":fontmgr_win_factory"
Chris Bracken72f403c2020-06-17 14:10:52 -0700130 } else if ((is_mac || is_ios) && skia_use_fonthost_mac) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400131 skia_fontmgr_factory = ":fontmgr_mac_ct_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400132 } else if (skia_enable_fontmgr_fontconfig) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400133 skia_fontmgr_factory = ":fontmgr_fontconfig_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400134 } else if (skia_enable_fontmgr_custom_directory) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400135 skia_fontmgr_factory = ":fontmgr_custom_directory_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400136 } else if (skia_enable_fontmgr_custom_embedded) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400137 skia_fontmgr_factory = ":fontmgr_custom_embedded_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400138 } else if (skia_enable_fontmgr_custom_empty) {
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400139 skia_fontmgr_factory = ":fontmgr_custom_empty_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400140 } else {
141 #"src/ports/SkFontMgr_FontConfigInterface_factory.cpp" #WontFix
142 #"src/ports/SkFontMgr_win_gdi_factory.cpp" # WontFix
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400143 skia_fontmgr_factory = ":fontmgr_empty_factory"
Ben Wagner75626e42020-06-03 13:20:37 -0400144 }
145}
146
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -0500147# Our tools require static linking (they use non-exported symbols), and the GPU backend.
148skia_enable_tools = skia_enable_tools && !is_component_build && skia_enable_gpu