Debian Codegraph @

gn/skia.gni

raw ◀ ▶
1 Debian patch touch this file
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
5 if (!defined(is_skia_standalone)) {
6 is_skia_standalone = false
7 }
8
9 is_skia_dev_build = is_skia_standalone && !is_official_build
10
11 declare_args() {
12 skia_android_serial = ""
13 skia_compile_modules = false
14 skia_compile_sksl_tests = false
15 skia_dwritecore_sdk = ""
16 skia_dump_tasks = false
17 skia_enable_api_available_macro = true
18 skia_enable_android_utils = is_skia_dev_build
19 skia_enable_discrete_gpu = true
20 skia_enable_fontmgr_empty = false
21 skia_enable_fontmgr_win = is_win
22 skia_enable_gpu_debug_layers = is_skia_dev_build && is_debug
23 skia_enable_optimize_size = false
24 skia_enable_pdf = !is_wasm
25 skia_enable_precompile = true
26 skia_enable_skottie = !is_component_build
27 skia_enable_svg = !is_component_build
28 skia_enable_tools = is_skia_dev_build
29 skia_disable_tracing = is_official_build
30 skia_enable_vello_shaders = false
31 skia_disable_vma_stl_shared_mutex = false
32 skia_enable_winuwp = false
33 skia_generate_workarounds = false
34 skia_include_multiframe_procs = false
35 skia_lex = false
36 skia_print_sksl_shaders = false
37 skia_print_native_shaders = false
38 skia_tools_require_resources = false
39 skia_use_angle = false
40 skia_use_client_icu = false
41 skia_use_bidi = false
42 skia_use_crabbyavif = false
43 skia_use_dawn = false
44 skia_use_direct3d = false
45 skia_use_egl = false
46 skia_use_epoxy_egl = false
47 skia_use_expat = !is_wasm
48 skia_use_ffmpeg = false
49 skia_use_fixed_gamma_text = is_android
50 skia_use_fontconfig = is_linux
51 skia_use_fontations = false
52 skia_use_fonthost_mac = is_mac || is_ios
53 skia_use_freetype = is_android || is_linux || is_wasm
54 skia_use_harfbuzz = true
55 skia_use_gl = true
56 skia_use_icu = true
57 skia_use_icu4x = false
58 skia_use_jpeg_gainmaps = is_skia_dev_build
59 skia_use_libavif = false
60 skia_use_libgrapheme = false
61 skia_use_libjpeg_turbo_decode = true
62 skia_use_libjpeg_turbo_encode = true
63 skia_use_no_jpeg_encode = false
64 skia_use_libjxl_decode = false
65 skia_use_libpng_decode = true
66 skia_use_libpng_encode = true
67 skia_use_no_png_encode = false
68 skia_use_libwebp_decode = true
69 skia_use_libwebp_encode = !is_wasm
70 skia_use_no_webp_encode = false
71 skia_use_lua = is_skia_dev_build && !is_ios
72 skia_use_metal = false
73 skia_use_ndk_images = is_android && defined(ndk_api) && ndk_api >= 30
74 skia_use_perfetto = is_linux || is_mac || is_android
75 skia_enable_pipeline_label_tracing = false
76
77 # Currently only supported in Android framework
78 skia_android_framework_use_perfetto = false
79 skia_use_piex = !is_win && !is_wasm
80 skia_use_rust_icc = false
81 skia_use_rust_png_decode = false
82 skia_use_rust_png_encode = false
83 skia_use_rust_bmp_decode = false
84 skia_use_sfml = false
85 skia_use_webgl = is_wasm
86 skia_use_webgpu = is_wasm
87 skia_use_wuffs = true
88 skia_use_x11 = is_linux
89 skia_use_xps = true
90
91 # Use the safe mode for libcxx
92 # See: https://libcxx.llvm.org/UsingLibcxx.html#enabling-the-safe-libc-mode
93 skia_use_safe_libcxx = false
94
95 skia_enable_ganesh = true
96 skia_enable_graphite = false
97 skia_use_zlib = true
98
99 if (is_ios) {
100 skia_ios_identity = ".*Google.*"
101 skia_ios_profile = "Google Development"
102
103 # should only code sign when running on a device, not the simulator
104 skia_ios_use_signing = !ios_use_simulator
105 }
106
107 skia_build_rust_targets = false
•108
109 skia_no_pic = false
110 }
111
112 declare_args() {
113 if (is_mac) {
114 skia_gl_standard = "gl"
115 } else if (is_ios) {
116 skia_gl_standard = "gles"
117 } else if (is_wasm && skia_enable_ganesh) {
118 skia_gl_standard = "webgl"
119 } else {
120 skia_gl_standard = ""
121 }
122
123 skia_use_vulkan = false
124 skia_build_fuzzers = false
125 skia_provide_default_fuzz_engine = true
126 }
127
128 declare_args() {
129 skia_enable_skunicode =
130 skia_use_icu || skia_use_client_icu || skia_use_bidi ||
131 skia_use_libgrapheme || skia_use_icu4x
132 }
133
134 if (skia_use_angle && skia_gl_standard != "gles") {
135 skia_gl_standard = ""
136 }
137
138 declare_args() {
139 skia_pdf_subset_harfbuzz = skia_use_harfbuzz
140 }
141
142 declare_args() {
143 skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
144 skia_enable_fontmgr_android_ndk = is_android && skia_use_freetype
145 skia_enable_fontmgr_custom_directory = skia_use_freetype && !is_wasm
146 skia_enable_fontmgr_custom_embedded = skia_use_freetype
147 skia_enable_fontmgr_custom_empty = skia_use_freetype && !is_wasm
148 skia_enable_fontmgr_fontconfig = skia_use_freetype && skia_use_fontconfig
149 skia_enable_fontmgr_win_gdi = is_win && !skia_enable_winuwp
150 skia_enable_fontmgr_FontConfigInterface =
151 skia_use_freetype && skia_use_fontconfig
152 skia_enable_spirv_validation = is_skia_dev_build && is_debug && !skia_use_dawn
153 skia_use_dng_sdk = !is_wasm && skia_use_libjpeg_turbo_decode && skia_use_zlib
154 skia_enable_vulkan_debug_layers = skia_enable_gpu_debug_layers
155 skia_enable_direct3d_debug_layer = skia_enable_gpu_debug_layers
156 skia_enable_metal_debug_info = skia_enable_gpu_debug_layers
157 skia_use_vma = skia_use_vulkan
158 skia_vulkan_memory_allocator_dir =
159 "//third_party/externals/vulkanmemoryallocator"
160 skia_build_for_debugger = false
161
162 # icu_bidi sources
163 skia_icu_bidi_third_party_dir = "//third_party/icu_bidi"
164
165 # libgrapheme sources
166 skia_libgrapheme_third_party_dir = "//third_party/libgrapheme"
167 }
168
169 assert(!skia_use_dawn || skia_enable_graphite) # Dawn is Graphite-only
170
171 # We only have a GL backend for Ganesh. We make it so we can assume that if skia_use_gl is true
172 # then skia_enable_ganesh is true.
173 skia_use_gl = skia_use_gl && skia_enable_ganesh
174
175 # Ditto for D3D (no D3D Graphite backend)
176 skia_use_direct3d = skia_use_direct3d && skia_enable_ganesh
177
178 # Our tools require static linking (they use non-exported symbols)
179 skia_enable_tools = skia_enable_tools && !is_component_build
180
181 # We used to not build any of the tools without Ganesh. Then we enabled building
182 # viewer with Graphite but not Ganesh. The remaining tools and supporting libs have
183 # not been audited for building without Ganesh
184 skia_enable_tools_that_might_need_ganesh =
185 skia_enable_tools && skia_enable_ganesh
186
187 if (skia_enable_optimize_size) {
188 assert(
189 !is_debug,
190 "Must set is_debug to false for skia_enable_optimize_size to do anything. If you want to build with debug mode and the correct define, add extra_cflags=['-DSK_ENABLE_OPTIMIZE_SIZE'] to your GN args.")
191 }
192
193 # Current Perfetto integrations are mutually exclusive
194 assert(!skia_use_perfetto || !skia_android_framework_use_perfetto)
195
196 # Skia's targets may be built inside other gn build systems.
197 # Skia builds other project's build targets inside its build.
198 # This is easier if the built-in target types remain generic.
199 # Place Skia target specific configs in skia_target_default_configs.
200 # These will be applied by the 'skia_*' templates.
201 # In the Skia build these configs apply many warnings as errors.
202 # Other projects may optionally set these configs as they see fit.
203 template("skia_target") {
204 target(invoker._skia_target_type, target_name) {
205 # set_defaults(invoker._skia_target_type) might not exist or set configs
206 if (!defined(configs)) {
207 configs = []
208 }
209
210 # Explicit configs instead of set_defaults("skia_target")
211 # Allows template("skia_*") below to avoid the configs dance.
212 if (defined(skia_target_default_configs)) {
213 configs += skia_target_default_configs
214 }
215
216 # "*" clobbers the current scope; append to existing configs
217 forward_variables_from(invoker, "*", [ "configs" ])
218 if (defined(invoker.configs)) {
219 configs += invoker.configs
220 }
221 }
222 }
223
224 template("skia_executable") {
225 skia_target(target_name) {
226 assert(!defined(configs), "No set_defaults(skia_target)")
227 _skia_target_type = "executable"
228 forward_variables_from(invoker, "*")
229 }
230 }
231 template("skia_source_set") {
232 skia_target(target_name) {
233 assert(!defined(configs), "No set_defaults(skia_target)")
234 _skia_target_type = "source_set"
235 forward_variables_from(invoker, "*")
236 }
237 }
238 template("skia_static_library") {
239 skia_target(target_name) {
240 assert(!defined(configs), "No set_defaults(skia_target)")
241 _skia_target_type = "static_library"
242 forward_variables_from(invoker, "*")
243 }
244 }
245 template("skia_shared_library") {
246 skia_target(target_name) {
247 assert(!defined(configs), "No set_defaults(skia_target)")
248 _skia_target_type = "shared_library"
249 forward_variables_from(invoker, "*")
250 }
251 }
252 template("skia_component") {
253 skia_target(target_name) {
254 assert(!defined(configs), "No set_defaults(skia_target)")
255 _skia_target_type = "component"
256 forward_variables_from(invoker, "*")
257 }
258 }