blob: 78cb5dc48021525e6a958ddf4458fe4fb06384ca [file] [log] [blame]
mtkleinc04ff472016-06-23 10:29:30 -07001# Copyright 2016 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
Brian Osmanf2c90142017-07-13 15:50:03 -04006import("gn/flutter_defines.gni")
Mike Reed025f7832018-11-12 09:27:05 -05007import("gn/fuchsia_defines.gni")
mikejurka8c24f4f2016-09-12 16:51:58 -07008import("gn/shared_sources.gni")
Hal Canary45812a12019-09-04 08:58:59 -04009import("gn/skia.gni")
10
John Rosasco24cbdab2019-09-25 14:14:35 -070011if (is_fuchsia) {
12 import("//build/fuchsia/sdk.gni")
13 import("build/fuchsia/fuchsia_download_sdk.gni")
14}
15
Stephen White0d70b712019-07-10 15:51:30 -040016if (skia_use_dawn) {
17 import("third_party/externals/dawn/scripts/dawn_features.gni")
18}
19
Adam Barth54ef74a2017-10-13 10:59:38 -070020if (defined(skia_settings)) {
21 import(skia_settings)
22}
23
Hal Canary3388c1a2019-09-16 12:53:17 -040024import("gn/ios.gni")
25
mtkleinc04ff472016-06-23 10:29:30 -070026# Skia public API, generally provided by :skia.
27config("skia_public") {
Mike Klein9e25bb92019-04-29 09:46:36 -050028 include_dirs = [ "." ]
29
Mike Kleinae7e6712016-10-11 17:49:33 -040030 defines = []
Chinmay Gardef832c0a2020-03-18 14:37:23 -070031 cflags_objcc = []
Mike Kleinae7e6712016-10-11 17:49:33 -040032 if (is_component_build) {
33 defines += [ "SKIA_DLL" ]
34 }
Mike Kleinc4cbd742016-09-26 21:37:09 -040035 if (is_fuchsia || is_linux) {
Mike Kleinf0a53692019-04-24 11:42:40 -050036 defines += [ "SK_R32_SHIFT=16" ]
jcgregorio5561e3d2016-08-25 09:25:11 -070037 }
Brian Osmanf2c90142017-07-13 15:50:03 -040038 if (skia_enable_flutter_defines) {
39 defines += flutter_defines
40 }
mtklein06c35c02016-09-20 12:28:12 -070041 if (!skia_enable_gpu) {
42 defines += [ "SK_SUPPORT_GPU=0" ]
43 }
Mike Reed025f7832018-11-12 09:27:05 -050044 if (is_fuchsia) {
45 defines += fuchsia_defines
46 }
Kevin Lubick27ba7032019-03-21 08:13:54 -040047 if (skia_gl_standard == "gles") {
48 defines += [ "SK_ASSUME_GL_ES=1" ]
49 } else if (skia_gl_standard == "gl") {
50 defines += [ "SK_ASSUME_GL=1" ]
Kevin Lubick39026282019-03-28 12:46:40 -040051 } else if (skia_gl_standard == "webgl") {
Kevin Lubick2f9a0982020-08-20 10:33:39 -040052 defines += [
53 "SK_ASSUME_WEBGL=1",
54 "SK_USE_WEBGL",
55 ]
Kevin Lubick27ba7032019-03-21 08:13:54 -040056 }
Chinmay Gardef832c0a2020-03-18 14:37:23 -070057
58 # Some older versions of the Clang toolchain change the visibility of
59 # symbols decorated with API_AVAILABLE macro to be visible. Users of such
60 # toolchains suppress the use of this macro till toolchain updates are made.
61 if (is_mac || is_ios) {
62 if (skia_enable_api_available_macro) {
63 defines += [ "SK_ENABLE_API_AVAILABLE" ]
64 } else {
65 cflags_objcc += [ "-Wno-unguarded-availability" ]
66 }
67 }
mtkleinc04ff472016-06-23 10:29:30 -070068}
69
70# Skia internal APIs, used by Skia itself and a few test tools.
71config("skia_private") {
Mike Klein4f4c0642021-01-15 07:20:33 -060072 visibility = [ "./*" ]
mtkleinc04ff472016-06-23 10:29:30 -070073
Mike Reeda9e241d2017-05-03 10:52:00 -040074 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
Leon Scroggins IIIc41a5f52018-11-15 15:54:59 -050075 if (skia_use_fixed_gamma_text) {
mtkleinb37c0342016-09-09 11:07:45 -070076 defines += [
77 "SK_GAMMA_EXPONENT=1.4",
78 "SK_GAMMA_CONTRAST=0.0",
79 ]
80 }
Mike Kleinb45d8622019-04-24 14:04:01 -050081 if (is_skia_dev_build) {
82 defines += [
83 "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
84 "GR_TEST_UTILS=1",
85 ]
mtklein88a7ac02016-09-14 11:16:49 -070086 }
Brian Salomon789e25e2016-09-30 13:41:03 -040087 libs = []
88 lib_dirs = []
Brian Salomonf4ba4ec2020-03-19 15:54:28 -040089 if (skia_use_gl && skia_use_angle) {
Brian Osman34755e22016-12-05 09:46:02 -050090 defines += [ "SK_ANGLE" ]
91 }
Greg Danielb16beb92020-04-27 14:26:21 +000092 if (skia_use_vma) {
93 defines += [ "SK_USE_VMA" ]
94 }
James Clarkeb8c0dab2021-02-09 06:22:41 -080095 if (skia_enable_winuwp) {
James Clarkeb2bfa9d2021-02-18 19:54:42 -080096 defines += [ "SK_WINUWP" ]
James Clarkeb8c0dab2021-02-09 06:22:41 -080097 }
98}
99
mtkleinc04ff472016-06-23 10:29:30 -0700100# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
101config("skia_library") {
Mike Klein4f4c0642021-01-15 07:20:33 -0600102 visibility = [ "./*" ]
Mike Kleinf5f4e812019-04-29 15:45:14 +0000103 defines = [ "SKIA_IMPLEMENTATION=1" ]
mtkleinc04ff472016-06-23 10:29:30 -0700104}
105
106skia_library_configs = [
107 ":skia_public",
108 ":skia_private",
109 ":skia_library",
110]
111
mtklein9b8583d2016-08-24 17:32:30 -0700112# Use for CPU-specific Skia code that needs particular compiler flags.
113template("opts") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500114 visibility = [ ":*" ]
mtklein9b8583d2016-08-24 17:32:30 -0700115 if (invoker.enabled) {
116 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500117 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700118 forward_variables_from(invoker, "*")
119 configs += skia_library_configs
120 }
121 } else {
122 # If not enabled, a phony empty target that swallows all otherwise unused variables.
123 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500124 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700125 forward_variables_from(invoker,
126 "*",
127 [
128 "sources",
129 "cflags",
130 ])
131 }
132 }
anmittala7eaf2e2016-08-17 13:57:26 -0700133}
134
mtklein422310d2016-08-16 18:28:43 -0700135is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700136
mtklein7d6fb2c2016-08-25 14:50:44 -0700137opts("none") {
138 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700139 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700140 cflags = []
141}
142
mtklein7d6fb2c2016-08-25 14:50:44 -0700143opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700144 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700145 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700146 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700147}
148
149opts("arm64") {
150 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700151 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700152 cflags = []
153}
154
155opts("crc32") {
156 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700157 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700158 cflags = [ "-march=armv8-a+crc" ]
159}
160
mtklein9b8583d2016-08-24 17:32:30 -0700161opts("sse2") {
162 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700163 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400164 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400165 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
166 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400167 cflags = [ "-msse2" ]
168 }
mtklein9b8583d2016-08-24 17:32:30 -0700169}
mtkleinc04ff472016-06-23 10:29:30 -0700170
mtklein9b8583d2016-08-24 17:32:30 -0700171opts("ssse3") {
172 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700173 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400174 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400175 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
176 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400177 cflags = [ "-mssse3" ]
178 }
mtklein9b8583d2016-08-24 17:32:30 -0700179}
mtkleinc04ff472016-06-23 10:29:30 -0700180
mtklein9b8583d2016-08-24 17:32:30 -0700181opts("sse41") {
182 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700183 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400184 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400185 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
186 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400187 cflags = [ "-msse4.1" ]
188 }
mtklein9b8583d2016-08-24 17:32:30 -0700189}
mtklein4e976072016-08-08 09:06:27 -0700190
mtklein9b8583d2016-08-24 17:32:30 -0700191opts("sse42") {
192 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700193 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400194 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400195 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
196 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400197 cflags = [ "-msse4.2" ]
198 }
mtklein9b8583d2016-08-24 17:32:30 -0700199}
200
201opts("avx") {
202 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700203 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400204 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000205 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400206 } else {
207 cflags = [ "-mavx" ]
Mike Klein1cc767b2019-12-13 13:02:22 -0500208 if (is_mac && is_debug) {
Mike Kleinf800c1d2020-06-04 11:53:56 -0500209 cflags += [ "-fno-stack-check" ] # Work around skia:9709
Mike Klein1cc767b2019-12-13 13:02:22 -0500210 }
Mike Klein3eb71212016-10-11 17:08:53 -0400211 }
mtkleinc04ff472016-06-23 10:29:30 -0700212}
213
Mike Klein1b9b7d52018-02-27 10:37:40 -0500214opts("hsw") {
215 enabled = is_x86
216 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400217 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500218 cflags = [ "/arch:AVX2" ]
219 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000220 cflags = [ "-march=haswell" ]
Mike Kleindb380222020-01-22 13:53:18 -0600221 if (is_mac && is_debug) {
Mike Kleinf800c1d2020-06-04 11:53:56 -0500222 cflags += [ "-fno-stack-check" ] # Work around skia:9709
Mike Kleindb380222020-01-22 13:53:18 -0600223 }
Mike Klein1b9b7d52018-02-27 10:37:40 -0500224 }
Mike Klein1b9b7d52018-02-27 10:37:40 -0500225}
226
Mike Kleinad56c4c2020-06-05 06:57:30 -0500227opts("skx") {
228 enabled = is_x86
229 sources = skia_opts.skx_sources
230 if (is_win) {
231 cflags = [ "/arch:AVX512" ]
232 } else {
233 cflags = [ "-march=skylake-avx512" ]
234 if (is_mac && is_debug) {
235 cflags += [ "-fno-stack-check" ] # Work around skia:9709
236 }
237 }
238}
239
mtkleinc095df52016-08-24 12:23:52 -0700240# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700241template("optional") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500242 visibility = [ ":*" ]
mtklein457b42a2016-08-23 13:56:37 -0700243 if (invoker.enabled) {
244 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700245 if (defined(invoker.public_defines)) {
246 defines = invoker.public_defines
247 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600248 if (defined(invoker.public_configs)) {
249 configs = invoker.public_configs
250 }
Hal Canary2dad9902019-11-20 16:01:31 -0500251 if (defined(invoker.public_include_dirs)) {
252 include_dirs = invoker.public_include_dirs
253 }
mtklein457b42a2016-08-23 13:56:37 -0700254 }
255 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500256 check_includes = false
mtkleincd01b032016-08-31 04:58:19 -0700257 forward_variables_from(invoker,
258 "*",
259 [
260 "public_defines",
Ben Wagnere75021e2021-02-17 22:18:34 -0500261 "sources_for_tests",
mtkleincd01b032016-08-31 04:58:19 -0700262 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700263 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700264 ])
mtklein457b42a2016-08-23 13:56:37 -0700265 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700266 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700267 if (defined(invoker.configs_to_remove)) {
268 configs -= invoker.configs_to_remove
269 }
mtklein457b42a2016-08-23 13:56:37 -0700270 }
Ben Wagnere75021e2021-02-17 22:18:34 -0500271 if (defined(invoker.sources_for_tests) && skia_enable_tools) {
272 source_set(target_name + "_tests") {
273 check_includes = false
274 forward_variables_from(invoker,
275 "*",
276 [
277 "public_defines",
278 "sources",
279 "sources_for_tests",
280 "sources_when_disabled",
281 "configs_to_remove",
282 ])
283 testonly = true
284 sources = invoker.sources_for_tests
285 if (!defined(deps)) {
286 deps = []
287 }
288 deps += [ ":test" ]
289 all_dependent_configs = [ ":" + target_name + "_public" ]
290 configs += skia_library_configs
291 if (defined(invoker.configs_to_remove)) {
292 configs -= invoker.configs_to_remove
293 }
294 }
295 }
mtklein457b42a2016-08-23 13:56:37 -0700296 } else {
mtklein457b42a2016-08-23 13:56:37 -0700297 source_set(target_name) {
298 forward_variables_from(invoker,
299 "*",
300 [
Ben Wagnerea765a32020-06-05 13:42:30 -0400301 "public",
mtklein457b42a2016-08-23 13:56:37 -0700302 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400303 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700304 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700305 "libs",
Jim Van Verthef820be2020-08-12 10:45:00 -0400306 "frameworks",
mtklein457b42a2016-08-23 13:56:37 -0700307 "sources",
Ben Wagnere75021e2021-02-17 22:18:34 -0500308 "sources_for_tests",
mtkleincd01b032016-08-31 04:58:19 -0700309 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700310 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700311 ])
mtkleincd01b032016-08-31 04:58:19 -0700312 if (defined(invoker.sources_when_disabled)) {
313 sources = invoker.sources_when_disabled
314 }
315 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700316 }
Ben Wagnere75021e2021-02-17 22:18:34 -0500317 if (defined(invoker.sources_for_tests)) {
318 source_set(target_name + "_tests") {
319 }
320 }
mtkleineb3c4252016-08-23 07:38:09 -0700321 }
mtklein457b42a2016-08-23 13:56:37 -0700322}
mtklein457b42a2016-08-23 13:56:37 -0700323
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400324optional("android_utils") {
325 enabled = skia_enable_android_utils
326
Leon Scroggins III87caae62020-05-04 10:02:45 -0400327 public = [
328 "client_utils/android/BRDAllocator.h",
329 "client_utils/android/BitmapRegionDecoder.h",
330 "client_utils/android/FrontBufferedStream.h",
331 ]
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400332 public_defines = [ "SK_ENABLE_ANDROID_UTILS" ]
Leon Scroggins III87caae62020-05-04 10:02:45 -0400333 sources = [
334 "client_utils/android/BitmapRegionDecoder.cpp",
335 "client_utils/android/FrontBufferedStream.cpp",
336 ]
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400337}
338
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400339group("fontmgr_factory") {
340 public_deps = [ skia_fontmgr_factory ]
341}
342
343optional("fontmgr_empty_factory") {
344 enabled = true
345 sources = [ "src/ports/SkFontMgr_empty_factory.cpp" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400346}
347
mtkleina45be612016-08-29 15:22:10 -0700348optional("fontmgr_android") {
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500349 enabled = skia_enable_fontmgr_android
mtkleina45be612016-08-29 15:22:10 -0700350
351 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500352 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700353 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700354 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400355 public = [ "include/ports/SkFontMgr_android.h" ]
mtkleina45be612016-08-29 15:22:10 -0700356 sources = [
357 "src/ports/SkFontMgr_android.cpp",
mtkleina45be612016-08-29 15:22:10 -0700358 "src/ports/SkFontMgr_android_parser.cpp",
Ben Wagner75626e42020-06-03 13:20:37 -0400359 "src/ports/SkFontMgr_android_parser.h",
mtkleina45be612016-08-29 15:22:10 -0700360 ]
Ben Wagnere75021e2021-02-17 22:18:34 -0500361 sources_for_tests = [ "tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -0700362}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400363optional("fontmgr_android_factory") {
364 enabled = skia_enable_fontmgr_android
365 deps = [ ":fontmgr_android" ]
366 sources = [ "src/ports/SkFontMgr_android_factory.cpp" ]
367}
mtkleina45be612016-08-29 15:22:10 -0700368
mtkleind2e39db2016-09-07 07:52:55 -0700369optional("fontmgr_custom") {
Ben Wagner75626e42020-06-03 13:20:37 -0400370 enabled =
371 skia_enable_fontmgr_custom_directory ||
372 skia_enable_fontmgr_custom_embedded || skia_enable_fontmgr_custom_empty
mtkleind2e39db2016-09-07 07:52:55 -0700373
Mike Kleina01c6b02020-04-01 13:47:34 -0500374 deps = [ ":typeface_freetype" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400375 public = [ "src/ports/SkFontMgr_custom.h" ]
376 sources = [ "src/ports/SkFontMgr_custom.cpp" ]
377}
378
379optional("fontmgr_custom_directory") {
380 enabled = skia_enable_fontmgr_custom_directory
381
382 deps = [
383 ":fontmgr_custom",
384 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700385 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400386 public = [ "include/ports/SkFontMgr_directory.h" ]
387 sources = [ "src/ports/SkFontMgr_custom_directory.cpp" ]
388}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400389optional("fontmgr_custom_directory_factory") {
390 enabled = skia_enable_fontmgr_custom_directory
391 deps = [ ":fontmgr_custom_directory" ]
392 sources = [ "src/ports/SkFontMgr_custom_directory_factory.cpp" ]
393}
Ben Wagner75626e42020-06-03 13:20:37 -0400394
395optional("fontmgr_custom_embedded") {
396 enabled = skia_enable_fontmgr_custom_embedded
397
398 deps = [
399 ":fontmgr_custom",
400 ":typeface_freetype",
401 ]
402 sources = [ "src/ports/SkFontMgr_custom_embedded.cpp" ]
mtkleind2e39db2016-09-07 07:52:55 -0700403}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400404optional("fontmgr_custom_embedded_factory") {
405 enabled = skia_enable_fontmgr_custom_embedded
406 deps = [ ":fontmgr_custom_embedded" ]
407 sources = [ "src/ports/SkFontMgr_custom_embedded_factory.cpp" ]
408}
mtkleind2e39db2016-09-07 07:52:55 -0700409
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500410optional("fontmgr_custom_empty") {
411 enabled = skia_enable_fontmgr_custom_empty
Kevin Lubickddd0a332018-12-12 10:35:13 -0500412
Ben Wagner75626e42020-06-03 13:20:37 -0400413 deps = [
414 ":fontmgr_custom",
415 ":typeface_freetype",
Sergey Ulanovf3babcd2018-11-30 17:42:00 -0800416 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400417 public = [ "include/ports/SkFontMgr_empty.h" ]
418 sources = [ "src/ports/SkFontMgr_custom_empty.cpp" ]
Hal Canaryff2742e2018-01-30 11:35:47 -0500419}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400420optional("fontmgr_custom_empty_factory") {
421 enabled = skia_enable_fontmgr_custom_empty
422 deps = [ ":fontmgr_custom_empty" ]
423 sources = [ "src/ports/SkFontMgr_custom_empty_factory.cpp" ]
424}
Hal Canaryff2742e2018-01-30 11:35:47 -0500425
mtklein3cc22182016-08-29 13:26:14 -0700426optional("fontmgr_fontconfig") {
Ben Wagner75626e42020-06-03 13:20:37 -0400427 enabled = skia_enable_fontmgr_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700428
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400429 # The public header includes fontconfig.h and uses FcConfig*
430 public_deps = [ "//third_party:fontconfig" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400431 public = [ "include/ports/SkFontMgr_fontconfig.h" ]
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400432 deps = [ ":typeface_freetype" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400433 sources = [ "src/ports/SkFontMgr_fontconfig.cpp" ]
Ben Wagnere75021e2021-02-17 22:18:34 -0500434 sources_for_tests = [ "tests/FontMgrFontConfigTest.cpp" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400435}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400436optional("fontmgr_fontconfig_factory") {
437 enabled = skia_enable_fontmgr_fontconfig
438 deps = [ ":fontmgr_fontconfig" ]
439 sources = [ "src/ports/SkFontMgr_fontconfig_factory.cpp" ]
440}
Ben Wagner75626e42020-06-03 13:20:37 -0400441
442optional("fontmgr_FontConfigInterface") {
443 enabled = skia_enable_fontmgr_FontConfigInterface
444
445 deps = [
446 ":typeface_freetype",
447 "//third_party:fontconfig",
448 ]
449 public = [
450 "include/ports/SkFontConfigInterface.h",
451 "include/ports/SkFontMgr_FontConfigInterface.h",
452 ]
mtklein3cc22182016-08-29 13:26:14 -0700453 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700454 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700455 "src/ports/SkFontConfigInterface_direct.cpp",
456 "src/ports/SkFontConfigInterface_direct_factory.cpp",
Ben Wagner75626e42020-06-03 13:20:37 -0400457 "src/ports/SkFontConfigTypeface.h",
mtklein3cc22182016-08-29 13:26:14 -0700458 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700459 ]
460}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400461optional("fontmgr_FontConfigInterface_factory") {
462 enabled = skia_enable_fontmgr_FontConfigInterface
463 deps = [ ":fontmgr_FontConfigInterface" ]
464 sources = [ "src/ports/SkFontMgr_FontConfigInterface_factory.cpp" ]
465}
mtklein3cc22182016-08-29 13:26:14 -0700466
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500467optional("fontmgr_fuchsia") {
468 enabled = skia_enable_fontmgr_fuchsia
469
Chinmay Garde89820762019-05-06 16:44:06 -0700470 deps = []
471
472 if (is_fuchsia && using_fuchsia_sdk) {
John Rosasco24cbdab2019-09-25 14:14:35 -0700473 deps += [ "//build/fuchsia/fidl:fuchsia.fonts" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700474 } else {
Mike Kleina01c6b02020-04-01 13:47:34 -0500475 deps = [ "//sdk/fidl/fuchsia.fonts" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700476 }
Ben Wagner75626e42020-06-03 13:20:37 -0400477 public = [ "src/ports/SkFontMgr_fuchsia.h" ]
478 sources = [ "src/ports/SkFontMgr_fuchsia.cpp" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500479}
480
Ben Wagner75626e42020-06-03 13:20:37 -0400481optional("fontmgr_mac_ct") {
Ben Wagnerd13487e2020-06-03 23:29:43 -0400482 enabled = skia_use_fonthost_mac
483
Ben Wagner75626e42020-06-03 13:20:37 -0400484 public = [
485 "include/ports/SkFontMgr_mac_ct.h",
486 "include/ports/SkTypeface_mac.h",
487 ]
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400488 sources = [
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400489 "src/ports/SkFontMgr_mac_ct.cpp",
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400490 "src/ports/SkScalerContext_mac_ct.cpp",
491 "src/ports/SkScalerContext_mac_ct.h",
492 "src/ports/SkTypeface_mac_ct.cpp",
493 "src/ports/SkTypeface_mac_ct.h",
494 ]
Ben Wagnera3e5e552021-02-22 15:37:33 +0000495 sources_for_tests = [ "tests/TypefaceMacTest.cpp" ]
Ben Wagnerd13487e2020-06-03 23:29:43 -0400496
497 if (is_mac) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400498 frameworks = [
Ben Wagnerd13487e2020-06-03 23:29:43 -0400499 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
500 "AppKit.framework",
501 "ApplicationServices.framework",
502 ]
503 }
504
505 if (is_ios) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400506 frameworks = [
Ben Wagnerd13487e2020-06-03 23:29:43 -0400507 "CoreFoundation.framework",
508 "CoreGraphics.framework",
509 "CoreText.framework",
510
511 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
512 "UIKit.framework",
513 ]
514 }
515}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400516optional("fontmgr_mac_ct_factory") {
517 enabled = skia_use_fonthost_mac
518 deps = [ ":fontmgr_mac_ct" ]
519 sources = [ "src/ports/SkFontMgr_mac_ct_factory.cpp" ]
520}
Ben Wagnerd13487e2020-06-03 23:29:43 -0400521
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500522optional("fontmgr_win") {
523 enabled = skia_enable_fontmgr_win
524
Ben Wagner75626e42020-06-03 13:20:37 -0400525 public = [ "include/ports/SkTypeface_win.h" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500526 sources = [
527 "src/fonts/SkFontMgr_indirect.cpp",
528 "src/ports/SkFontMgr_win_dw.cpp",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500529 "src/ports/SkScalerContext_win_dw.cpp",
530 "src/ports/SkTypeface_win_dw.cpp",
531 ]
532}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400533optional("fontmgr_win_factory") {
534 enabled = skia_enable_fontmgr_win
535 deps = [ ":fontmgr_win" ]
536 sources = [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
537}
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500538
539optional("fontmgr_win_gdi") {
540 enabled = skia_enable_fontmgr_win_gdi
541
Ben Wagner75626e42020-06-03 13:20:37 -0400542 public = [ "include/ports/SkTypeface_win.h" ]
Mike Kleina01c6b02020-04-01 13:47:34 -0500543 sources = [ "src/ports/SkFontHost_win.cpp" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500544 libs = [ "Gdi32.lib" ]
545}
546
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700547if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400548 executable("sksllex") {
549 sources = [
550 "src/sksl/lex/Main.cpp",
551 "src/sksl/lex/NFA.cpp",
552 "src/sksl/lex/RegexNode.cpp",
553 "src/sksl/lex/RegexParser.cpp",
554 ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500555 include_dirs = [ "." ]
Ethan Nicholasca82a922017-09-07 09:39:50 -0400556 }
557
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700558 action("run_sksllex") {
559 script = "gn/run_sksllex.py"
Mike Kleina01c6b02020-04-01 13:47:34 -0500560 deps = [ ":sksllex(//gn/toolchain:$host_toolchain)" ]
561 sources = [ "src/sksl/lex/sksl.lex" ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700562
563 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
564 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
565 outputs = [
Brian Osman1e7d8aa2021-02-18 14:37:29 -0500566 "$target_out_dir/" + rebase_path("src/sksl/SkSLLexer.h", target_out_dir),
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700567 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
568 # confused due to the same file being named by two different paths
569 ]
570 sksllex_path = "$root_out_dir/"
571 sksllex_path += "sksllex"
572 if (host_os == "win") {
573 sksllex_path += ".exe"
574 }
575 args = [
576 rebase_path(sksllex_path),
577 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400578 rebase_path("bin/fetch-clang-format"),
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700579 rebase_path("src"),
580 ]
581 }
582} else {
583 group("run_sksllex") {
584 }
585}
586
John Stilesd836f842020-09-14 10:21:44 -0400587# `Compile Processors` and `Compile SkSL Tests` both rely on skslc.
588if (skia_compile_processors || skia_compile_sksl_tests) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400589 executable("skslc") {
Brian Osman8d09d4a2020-11-24 15:51:06 -0500590 defines = [
591 "SKSL_STANDALONE",
592 "SK_ENABLE_SPIRV_VALIDATION",
593 ]
Brian Osmana6ca9752020-10-02 13:41:21 -0400594 sources = [
Brian Osman47726a12020-12-17 16:02:08 -0500595 "src/core/SkCpu.cpp",
596 "src/core/SkData.cpp",
597 "src/core/SkHalf.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400598 "src/core/SkMalloc.cpp",
599 "src/core/SkMath.cpp",
John Stiles060503e2020-10-22 15:02:26 -0400600 "src/core/SkSemaphore.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500601 "src/core/SkStream.cpp",
602 "src/core/SkString.cpp",
Brian Osmane9ad19b2020-12-23 13:31:13 -0500603 "src/core/SkStringUtils.cpp",
John Stiles060503e2020-10-22 15:02:26 -0400604 "src/core/SkThreadID.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500605 "src/core/SkUtils.cpp",
606 "src/core/SkVM.cpp",
John Stiles23e68662020-10-29 10:17:15 -0400607 "src/gpu/GrBlockAllocator.cpp",
608 "src/gpu/GrMemoryPool.cpp",
Brian Osman62b039b2021-02-08 13:49:53 -0500609 "src/gpu/GrShaderUtils.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400610 "src/ports/SkMemory_malloc.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500611 "src/ports/SkOSFile_stdio.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400612 "src/sksl/SkSLMain.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500613 "src/utils/SkUTF.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400614 ]
Brian Osman47726a12020-12-17 16:02:08 -0500615 if (is_win) {
616 sources += [ "src/ports/SkOSFile_win.cpp" ]
617 } else {
618 sources += [ "src/ports/SkOSFile_posix.cpp" ]
619 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400620 sources += skia_sksl_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400621 sources += skia_sksl_gpu_sources
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500622 include_dirs = [ "." ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400623 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500624 ":run_sksllex",
Stephen White238fc242019-08-26 10:19:23 -0400625 "//third_party/spirv-tools:spvtools",
John Stilesdda1d312020-11-20 16:28:50 -0500626 "//third_party/spirv-tools:spvtools_val",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400627 ]
628 }
629
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400630 skslc_path = "$root_out_dir/"
631 if (host_toolchain != default_toolchain_name) {
632 skslc_path += "$host_toolchain/"
633 }
634 skslc_path += "skslc"
635 if (host_os == "win") {
636 skslc_path += ".exe"
637 }
638
Brian Osmandd496172020-08-08 08:17:18 -0400639 action("create_sksl_fp") {
640 script = "gn/create_sksl_fp.py"
641 sources = [
642 "include/private/GrSharedEnums.h",
643 "src/sksl/sksl_fp_raw.sksl",
644 ]
645 outputs = [ "$root_out_dir/sksl_fp.sksl" ]
646 args = [
647 rebase_path(sources[0]),
648 rebase_path(sources[1]),
649 rebase_path(outputs[0]),
650 ]
651 }
652
653 copy("sksl_pre_includes") {
654 sources = [
655 "src/sksl/sksl_frag.sksl",
656 "src/sksl/sksl_geom.sksl",
657 "src/sksl/sksl_gpu.sksl",
Brian Osmanb06301e2020-11-06 11:45:36 -0500658 "src/sksl/sksl_public.sksl",
Brian Osman91946752020-12-21 13:20:40 -0500659 "src/sksl/sksl_runtime.sksl",
Brian Osmandd496172020-08-08 08:17:18 -0400660 "src/sksl/sksl_vert.sksl",
661 ]
662 outputs = [ "$root_out_dir/{{source_file_part}}" ]
663 }
664
665 dehydrate_sksl_sources = get_target_outputs(":sksl_pre_includes")
666 dehydrate_sksl_sources += get_target_outputs(":create_sksl_fp")
667
668 dehydrate_sksl_outputs = []
669 foreach(src, dehydrate_sksl_sources) {
670 name = get_path_info(src, "name")
671
672 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
673 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
674 dehydrate_sksl_outputs += [ "$target_out_dir/" + rebase_path(
675 "src/sksl/generated/$name.dehydrated.sksl",
676 target_out_dir) ]
677 }
678
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400679 action("dehydrate_sksl") {
680 script = "gn/dehydrate_sksl.py"
Brian Osmandd496172020-08-08 08:17:18 -0400681 deps = [
682 ":create_sksl_fp",
683 ":sksl_pre_includes",
684 ":skslc(//gn/toolchain:$host_toolchain)",
685 ]
686 sources = dehydrate_sksl_sources
687 outputs = dehydrate_sksl_outputs
Brian Osmana5781382020-08-07 21:28:12 +0000688 args = [
689 rebase_path(skslc_path),
Brian Osmandd496172020-08-08 08:17:18 -0400690 rebase_path("src/sksl/generated"),
Brian Osmana5781382020-08-07 21:28:12 +0000691 ]
Brian Osmandd496172020-08-08 08:17:18 -0400692 args += rebase_path(dehydrate_sksl_sources)
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400693 }
John Stilesd836f842020-09-14 10:21:44 -0400694} else {
695 group("dehydrate_sksl") {
696 }
697}
698
699skia_gpu_processor_outputs = []
700if (skia_compile_processors) {
701 foreach(src, skia_gpu_processor_sources) {
702 dir = get_path_info(src, "dir")
703 name = get_path_info(src, "name")
704
705 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
706 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
707 skia_gpu_processor_outputs += [
708 "$target_out_dir/" +
709 rebase_path("$dir/generated/$name.h", target_out_dir),
710 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
711 # confused due to the same file being named by two different paths
712 ]
713 }
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400714
Ethan Nicholas762466e2017-06-29 10:03:38 -0400715 action("compile_processors") {
716 script = "gn/compile_processors.py"
717 deps = [
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400718 ":create_sksl_fp",
Brian Osmandd496172020-08-08 08:17:18 -0400719 ":sksl_pre_includes",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400720 ":skslc(//gn/toolchain:$host_toolchain)",
721 ]
722 sources = skia_gpu_processor_sources
723 outputs = skia_gpu_processor_outputs
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400724 args = [
725 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400726 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400727 rebase_path("bin/fetch-clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400728 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400729 args += rebase_path(skia_gpu_processor_sources)
730 }
731} else {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400732 group("compile_processors") {
733 }
John Stilesd836f842020-09-14 10:21:44 -0400734}
735
736if (skia_compile_sksl_tests) {
737 import("gn/sksl_tests.gni")
John Stilesd836f842020-09-14 10:21:44 -0400738
John Stiles7e248712020-09-24 16:42:09 -0400739 template("compile_sksl") {
740 # Compile the passed-in `sources` into `outputs` using skslc, with the given language/settings.
741 action("compile_sksl_${target_name}") {
742 script = "gn/compile_sksl_tests.py"
743 deps = [
744 ":create_sksl_fp",
745 ":sksl_pre_includes",
746 ":skslc(//gn/toolchain:$host_toolchain)",
747 ]
John Stilesda57fc02021-01-22 11:54:30 -0500748 sources = []
John Stiles7e248712020-09-24 16:42:09 -0400749 outputs = []
John Stilesb7f5e1b2021-01-27 14:05:15 -0500750 response_file_contents = []
John Stilesda57fc02021-01-22 11:54:30 -0500751 args = [
752 rebase_path(skslc_path),
753 invoker.lang,
754 invoker.settings,
John Stilesb7f5e1b2021-01-27 14:05:15 -0500755 "{{response_file_name}}",
John Stilesda57fc02021-01-22 11:54:30 -0500756 ]
757
John Stilesbfc9be02021-01-22 11:55:48 -0500758 testsDir = get_path_info("tests", "abspath")
759 resourcesDir = get_path_info("resources", "abspath")
760
761 foreach(partialPath, invoker.sources) {
762 dst = testsDir + partialPath
763 src = resourcesDir + partialPath
764
765 dir = get_path_info(dst, "dir")
766 name = get_path_info(dst, "name")
767 ext = get_path_info(dst, "extension")
John Stilesb7f5e1b2021-01-27 14:05:15 -0500768 response_file_contents += rebase_path([
769 src,
770 dir,
771 ])
John Stilesda57fc02021-01-22 11:54:30 -0500772 sources += [ src ]
John Stilesc3012182020-12-08 15:07:00 -0500773
John Stilesda57fc02021-01-22 11:54:30 -0500774 foreach(outExtension, invoker.outExtensions) {
John Stilesc3012182020-12-08 15:07:00 -0500775 # SPIR-V uses separate extensions for .vert and .geom shaders.
776 if (outExtension == ".asm.frag" && ext == "vert") {
777 outExtension = ".asm.vert"
778 } else if (outExtension == ".asm.frag" && ext == "geom") {
779 outExtension = ".asm.geom"
780 }
John Stilesbfc9be02021-01-22 11:55:48 -0500781 outputs +=
782 [ target_out_dir + "/" +
783 rebase_path(dir + "/" + name + outExtension, target_out_dir) ]
John Stiles7e248712020-09-24 16:42:09 -0400784 }
785 }
John Stiles7e248712020-09-24 16:42:09 -0400786 }
John Stilesd836f842020-09-14 10:21:44 -0400787 }
John Stiles7e248712020-09-24 16:42:09 -0400788 compile_sksl("fp_tests") {
789 sources = sksl_fp_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500790 outExtensions = [
791 ".cpp",
792 ".h",
John Stiles7e248712020-09-24 16:42:09 -0400793 ]
794 lang = "--fp"
795 settings = "--settings"
John Stiles0ed9f312020-09-16 17:46:37 -0400796 }
John Stiles7e248712020-09-24 16:42:09 -0400797 compile_sksl("glsl_tests") {
798 sources = sksl_glsl_tests_sources + sksl_glsl_settings_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500799 outExtensions = [ ".glsl" ]
John Stiles7e248712020-09-24 16:42:09 -0400800 lang = "--glsl"
801 settings = "--settings"
John Stiles0ed9f312020-09-16 17:46:37 -0400802 }
John Stiles7e248712020-09-24 16:42:09 -0400803 compile_sksl("glsl_nosettings_tests") {
John Stiles0ed9f312020-09-16 17:46:37 -0400804 sources = sksl_glsl_settings_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500805 outExtensions = [ "StandaloneSettings.glsl" ]
John Stiles7e248712020-09-24 16:42:09 -0400806 lang = "--glsl"
807 settings = "--nosettings"
John Stilesd836f842020-09-14 10:21:44 -0400808 }
John Stilesaeae3a52020-09-25 13:35:58 -0400809 compile_sksl("metal_tests") {
810 sources = sksl_metal_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500811 outExtensions = [ ".metal" ]
John Stilesaeae3a52020-09-25 13:35:58 -0400812 lang = "--metal"
813 settings = "--settings"
814 }
Brian Osman977feec2020-12-22 11:28:59 -0500815 compile_sksl("skvm_tests") {
816 sources = sksl_skvm_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500817 outExtensions = [ ".skvm" ]
Brian Osman977feec2020-12-22 11:28:59 -0500818 lang = "--skvm"
819 settings = "--settings"
820 }
Brian Osman62b039b2021-02-08 13:49:53 -0500821 compile_sksl("stage_tests") {
822 sources = sksl_stage_tests_sources
823 outExtensions = [ ".stage" ]
824 lang = "--stage"
825 settings = "--settings"
826 }
John Stilesdda1d312020-11-20 16:28:50 -0500827 compile_sksl("spirv_tests") {
828 sources = sksl_spirv_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500829 outExtensions = [ ".asm.frag" ]
John Stilesdda1d312020-11-20 16:28:50 -0500830 lang = "--spirv"
831 settings = "--settings"
832 }
John Stilesd836f842020-09-14 10:21:44 -0400833} else {
John Stiles7e248712020-09-24 16:42:09 -0400834 group("compile_sksl_fp_tests") {
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400835 }
John Stiles7e248712020-09-24 16:42:09 -0400836 group("compile_sksl_glsl_tests") {
837 }
838 group("compile_sksl_glsl_nosettings_tests") {
John Stiles0ed9f312020-09-16 17:46:37 -0400839 }
John Stilesaeae3a52020-09-25 13:35:58 -0400840 group("compile_sksl_metal_tests") {
841 }
Brian Osman977feec2020-12-22 11:28:59 -0500842 group("compile_sksl_skvm_tests") {
843 }
John Stilesdda1d312020-11-20 16:28:50 -0500844 group("compile_sksl_spirv_tests") {
845 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400846}
847
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500848optional("gpu") {
mtklein06c35c02016-09-20 12:28:12 -0700849 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400850 deps = [
851 ":compile_processors",
John Stiles7e248712020-09-24 16:42:09 -0400852 ":compile_sksl_fp_tests",
853 ":compile_sksl_glsl_nosettings_tests",
854 ":compile_sksl_glsl_tests",
John Stilesaeae3a52020-09-25 13:35:58 -0400855 ":compile_sksl_metal_tests",
Brian Osman977feec2020-12-22 11:28:59 -0500856 ":compile_sksl_skvm_tests",
John Stilesdda1d312020-11-20 16:28:50 -0500857 ":compile_sksl_spirv_tests",
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400858 ":dehydrate_sksl",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700859 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400860 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700861 if (skia_generate_workarounds) {
862 deps += [ ":workaround_list" ]
863 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800864 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600865 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400866 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700867
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400868 sources =
869 skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400870 if (!skia_enable_ccpr) {
871 sources -= skia_ccpr_sources
872 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
873 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400874 if (!skia_enable_nvpr) {
875 sources -= skia_nvpr_sources
876 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
877 }
mtklein06c35c02016-09-20 12:28:12 -0700878
Mike Klein703cf5a2016-10-13 17:18:04 -0400879 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -0400880 frameworks = []
mtkleine9fb3d52016-09-20 15:11:46 -0700881
John Rosascoa9b348f2019-11-08 13:18:15 -0800882 if (skia_use_gl) {
883 public_defines += [ "SK_GL" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400884 if (is_android) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500885 sources += [
886 "src/gpu/gl/egl/GrGLMakeEGLInterface.cpp",
887 "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
888 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400889
890 # this lib is required to link against AHardwareBuffer
891 if (defined(ndk_api) && ndk_api >= 26) {
892 libs += [ "android" ]
893 }
894 } else if (skia_use_egl) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500895 sources += [
896 "src/gpu/gl/egl/GrGLMakeEGLInterface.cpp",
897 "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
898 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400899 libs += [ "EGL" ]
Kevin Lubick204c3be2020-08-19 14:30:58 -0400900 } else if (skia_use_webgl) {
901 sources += [ "src/gpu/gl/webgl/GrGLMakeNativeInterface_webgl.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400902 } else if (is_linux && skia_use_x11) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500903 sources += [
904 "src/gpu/gl/glx/GrGLMakeGLXInterface.cpp",
905 "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp",
906 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400907 libs += [ "GL" ]
908 } else if (is_mac) {
909 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
910 } else if (is_ios) {
911 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
James Clarkeb8c0dab2021-02-09 06:22:41 -0800912 } else if (is_win && !skia_enable_winuwp) {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400913 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
914 if (target_cpu != "arm64") {
915 libs += [ "OpenGL32.lib" ]
916 }
917 } else {
918 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
919 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800920 sources += skia_gl_gpu_sources
921 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400922
mtkleine9fb3d52016-09-20 15:11:46 -0700923 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400924 public_defines += [ "SK_VULKAN" ]
Greg Danielb16beb92020-04-27 14:26:21 +0000925 if (skia_use_vma) {
926 deps += [ "third_party/vulkanmemoryallocator" ]
927 }
mtkleine9fb3d52016-09-20 15:11:46 -0700928 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700929 if (skia_enable_vulkan_debug_layers) {
930 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
931 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800932 if (is_fuchsia) {
John Rosascoe57ca492019-11-13 14:30:45 -0800933 if (using_fuchsia_sdk) {
Chinmay Garde89820762019-05-06 16:44:06 -0700934 public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
935 } else {
Brian Osman489cf882019-07-09 10:48:28 -0400936 public_deps += [ "//src/graphics/lib/vulkan" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700937 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800938 }
mtkleine9fb3d52016-09-20 15:11:46 -0700939 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400940
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400941 if (is_android && (skia_use_gl || skia_use_vulkan)) {
942 # this lib is required to link against AHardwareBuffer
943 if (defined(ndk_api) && ndk_api >= 26) {
944 libs += [ "android" ]
945 }
946 }
947
Stephen White0d70b712019-07-10 15:51:30 -0400948 if (skia_use_dawn) {
949 public_defines += [ "SK_DAWN" ]
Stephen White985741a2019-07-18 11:43:45 -0400950 sources += skia_dawn_sources
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700951 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen Whitefbffb992019-10-17 10:32:40 -0400952 deps += [
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700953 "//third_party/externals/dawn/src/dawn:dawn_proc",
954 "//third_party/externals/dawn/src/dawn:dawncpp",
955 "//third_party/externals/dawn/src/dawn_native",
Stephen White0d70b712019-07-10 15:51:30 -0400956 ]
957 if (dawn_enable_d3d12) {
958 libs += [
959 "d3d12.lib",
960 "dxgi.lib",
961 "d3dcompiler.lib",
962 ]
963 } else if (dawn_enable_metal) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400964 frameworks += [ "Metal.framework" ]
Stephen White0d70b712019-07-10 15:51:30 -0400965 }
966 }
967
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500968 if (skia_use_direct3d) {
969 public_defines += [ "SK_DIRECT3D" ]
Jim Van Verth1b89eb72020-09-23 16:29:51 -0400970 deps += [
971 "//third_party/d3d12allocator",
972 "//third_party/spirv-cross:spirv_cross",
973 ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500974 sources += skia_direct3d_sources
Jim Van Verth03b8ab22020-02-24 11:36:15 -0500975 if (skia_enable_direct3d_debug_layer) {
976 public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ]
977 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500978 libs += [
979 "d3d12.lib",
980 "dxgi.lib",
981 "d3dcompiler.lib",
982 ]
983 }
984
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400985 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400986 if (skia_use_metal) {
987 public_defines += [ "SK_METAL" ]
988 sources += skia_metal_sources
Jim Van Verthef820be2020-08-12 10:45:00 -0400989 frameworks += [ "Metal.framework" ]
Jim Van Verthef820be2020-08-12 10:45:00 -0400990 frameworks += [ "Foundation.framework" ]
Jim Van Verth36b86af2020-08-24 17:16:46 +0000991 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400992 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500993
Kevin Lubickf4def342018-10-04 12:52:50 -0400994 if (is_debug) {
995 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
996 }
mtklein06c35c02016-09-20 12:28:12 -0700997}
998
Leon Scroggins III41169202019-01-29 09:29:57 -0500999optional("gif") {
Hal Canary2dad9902019-11-20 16:01:31 -05001000 enabled = !skia_use_wuffs && skia_use_libgifcodec
Hal Canary1ec9a282019-11-21 10:15:50 -05001001 _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
1002 if ("True" ==
1003 exec_script("gn/checkpath.py",
1004 [ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
1005 "trim string")) {
1006 public_defines = [ "SK_USE_LIBGIFCODEC" ]
1007 public_include_dirs = [
1008 ".",
1009 skia_libgifcodec_path,
1010 ]
1011 include_dirs = public_include_dirs
1012 import(_libgifcodec_gni_path)
1013 sources = rebase_path(libgifcodec_sources + libgifcodec_public,
1014 ".",
1015 skia_libgifcodec_path)
1016 }
Leon Scroggins III41169202019-01-29 09:29:57 -05001017}
1018
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001019optional("heif") {
1020 enabled = skia_use_libheif
1021 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
1022
1023 deps = []
1024
Mike Kleina01c6b02020-04-01 13:47:34 -05001025 sources = [ "src/codec/SkHeifCodec.cpp" ]
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001026}
1027
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001028optional("jpeg_decode") {
1029 enabled = skia_use_libjpeg_turbo_decode
1030 public_defines = [ "SK_CODEC_DECODES_JPEG" ]
1031
Mike Kleina01c6b02020-04-01 13:47:34 -05001032 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001033 sources = [
1034 "src/codec/SkJpegCodec.cpp",
1035 "src/codec/SkJpegDecoderMgr.cpp",
1036 "src/codec/SkJpegUtility.cpp",
1037 ]
1038}
1039
1040optional("jpeg_encode") {
1041 enabled = skia_use_libjpeg_turbo_encode
1042 public_defines = [ "SK_ENCODE_JPEG" ]
mtklein63213812016-08-24 09:55:56 -07001043
Mike Kleina01c6b02020-04-01 13:47:34 -05001044 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
1045 public = [ "include/encode/SkJpegEncoder.h" ]
mtklein63213812016-08-24 09:55:56 -07001046 sources = [
mtklein63213812016-08-24 09:55:56 -07001047 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -04001048 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -07001049 ]
1050}
1051
Leon Scroggins III326b9892020-08-05 16:51:10 -04001052optional("ndk_images") {
1053 enabled = skia_use_ndk_images
1054 public_defines = [ "SK_ENABLE_NDK_IMAGES" ]
1055 sources = [
1056 "src/ports/SkImageEncoder_NDK.cpp",
1057 "src/ports/SkImageGeneratorNDK.cpp",
1058 "src/ports/SkNDKConversions.cpp",
1059 ]
Leon Scroggins IIIf21d6b92020-08-05 10:44:17 -04001060 libs = [ "jnigraphics" ]
1061}
1062
mtklein63213812016-08-24 09:55:56 -07001063optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -05001064 enabled = skia_use_zlib && skia_enable_pdf
1065 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -07001066
Mike Kleina01c6b02020-04-01 13:47:34 -05001067 deps = [ "//third_party/zlib" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001068 if (skia_use_libjpeg_turbo_decode) {
1069 deps += [ ":jpeg_decode" ]
1070 }
1071 if (skia_use_libjpeg_turbo_encode) {
1072 deps += [ ":jpeg_encode" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -04001073 }
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001074 public = skia_pdf_public
brettwb9447282016-09-01 14:24:39 -07001075 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -07001076 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
Hal Canary2a3093c2019-02-20 11:25:45 -05001077 if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
1078 deps += [ "//third_party/harfbuzz" ]
1079 defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
1080 } else if (skia_use_icu && skia_use_sfntly) {
mtklein63213812016-08-24 09:55:56 -07001081 deps += [ "//third_party/sfntly" ]
Hal Canary32498f02019-02-04 15:36:31 -05001082 defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -07001083 }
1084}
1085
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001086optional("xps") {
1087 enabled = skia_use_xps && is_win
1088 public_defines = [ "SK_SUPPORT_XPS" ]
1089 public = skia_xps_public
1090 sources = skia_xps_sources
1091}
1092
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001093optional("png_decode") {
1094 enabled = skia_use_libpng_decode
1095 public_defines = [ "SK_CODEC_DECODES_PNG" ]
mtklein63213812016-08-24 09:55:56 -07001096
Mike Kleina01c6b02020-04-01 13:47:34 -05001097 deps = [ "//third_party/libpng" ]
mtklein63213812016-08-24 09:55:56 -07001098 sources = [
1099 "src/codec/SkIcoCodec.cpp",
1100 "src/codec/SkPngCodec.cpp",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001101 ]
1102}
1103
1104optional("png_encode") {
1105 enabled = skia_use_libpng_encode
1106 public_defines = [ "SK_ENCODE_PNG" ]
1107
Mike Kleina01c6b02020-04-01 13:47:34 -05001108 deps = [ "//third_party/libpng" ]
1109 sources = [ "src/images/SkPngEncoder.cpp" ]
mtklein63213812016-08-24 09:55:56 -07001110}
1111
scroggof84ad642016-10-31 09:02:57 -07001112optional("raw") {
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001113 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -07001114 public_defines = [ "SK_CODEC_DECODES_RAW" ]
1115
1116 deps = [
1117 "//third_party/dng_sdk",
1118 "//third_party/libjpeg-turbo:libjpeg",
1119 "//third_party/piex",
1120 ]
1121
1122 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
1123 # Skia.
1124 configs_to_remove = [ "//gn:no_exceptions" ]
1125
Mike Kleina01c6b02020-04-01 13:47:34 -05001126 sources = [ "src/codec/SkRawCodec.cpp" ]
scroggof84ad642016-10-31 09:02:57 -07001127}
1128
Mike Klein852a8cb2018-05-15 10:46:58 -04001129import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -04001130source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -04001131 cflags = []
1132 if (!is_win || is_clang) {
1133 cflags += [
1134 "-w",
1135 "-std=c11",
1136 ]
1137 }
1138
Mike Kleina01c6b02020-04-01 13:47:34 -05001139 public = [ "include/third_party/skcms/skcms.h" ]
Brian Osmanea236bf2019-04-29 10:28:22 -04001140 include_dirs = [ "include/third_party/skcms" ]
Mike Klein852a8cb2018-05-15 10:46:58 -04001141 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
1142}
1143
mtklein3cc22182016-08-29 13:26:14 -07001144optional("typeface_freetype") {
1145 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -07001146
Mike Kleina01c6b02020-04-01 13:47:34 -05001147 deps = [ "//third_party/freetype2" ]
mtklein3cc22182016-08-29 13:26:14 -07001148 sources = [
1149 "src/ports/SkFontHost_FreeType.cpp",
1150 "src/ports/SkFontHost_FreeType_common.cpp",
Ben Wagner9d5c55c2020-06-27 12:52:14 -04001151 "src/ports/SkFontHost_FreeType_common.h",
mtklein3cc22182016-08-29 13:26:14 -07001152 ]
1153}
1154
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001155optional("webp_decode") {
1156 enabled = skia_use_libwebp_decode
1157 public_defines = [ "SK_CODEC_DECODES_WEBP" ]
mtklein457b42a2016-08-23 13:56:37 -07001158
Mike Kleina01c6b02020-04-01 13:47:34 -05001159 deps = [ "//third_party/libwebp" ]
1160 sources = [ "src/codec/SkWebpCodec.cpp" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001161}
1162
1163optional("webp_encode") {
1164 enabled = skia_use_libwebp_encode
1165 public_defines = [ "SK_ENCODE_WEBP" ]
1166
Mike Kleina01c6b02020-04-01 13:47:34 -05001167 deps = [ "//third_party/libwebp" ]
1168 sources = [ "src/images/SkWebpEncoder.cpp" ]
mtkleineb3c4252016-08-23 07:38:09 -07001169}
1170
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001171optional("wuffs") {
1172 enabled = skia_use_wuffs
Nigel Tao5cfa7192020-08-17 21:14:13 +10001173 public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001174
Mike Kleina01c6b02020-04-01 13:47:34 -05001175 deps = [ "//third_party/wuffs" ]
1176 sources = [ "src/codec/SkWuffsCodec.cpp" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001177}
1178
mtklein63213812016-08-24 09:55:56 -07001179optional("xml") {
1180 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +00001181 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -07001182
Mike Kleina01c6b02020-04-01 13:47:34 -05001183 deps = [ "//third_party/expat" ]
mtklein63213812016-08-24 09:55:56 -07001184 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -05001185 "src/svg/SkSVGCanvas.cpp",
1186 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -07001187 "src/xml/SkDOM.cpp",
1188 "src/xml/SkXMLParser.cpp",
1189 "src/xml/SkXMLWriter.cpp",
1190 ]
1191}
1192
Mike Klein613ad382019-06-06 11:42:02 -05001193optional("skvm_jit") {
Mike Klein13ec5442020-08-14 07:36:54 -05001194 enabled = skia_enable_skvm_jit_when_possible
1195 public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ]
Mike Klein2b54e832020-07-10 12:56:07 -05001196 if (skia_vtune_path != "") {
1197 public_defines += [ "SKVM_JIT_VTUNE" ]
1198 public_include_dirs = [ "$skia_vtune_path/include" ]
1199 libs = [ "$skia_vtune_path/lib64/jitprofiling.lib" ]
1200 }
Mike Klein613ad382019-06-06 11:42:02 -05001201}
1202
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001203if (skia_enable_gpu && skia_generate_workarounds) {
1204 action("workaround_list") {
1205 script = "tools/build_workaround_header.py"
1206
Mike Kleina01c6b02020-04-01 13:47:34 -05001207 inputs = [ "src/gpu/gpu_workaround_list.txt" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001208
1209 # see comments in skia_compile_processors about out dir path shenanigans.
1210 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -07001211 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001212
Mike Kleina01c6b02020-04-01 13:47:34 -05001213 outputs = [ "$root_out_dir/$output_file" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001214 args = [
1215 "--output-file",
1216 "$output_file",
1217 ]
1218
1219 foreach(file, inputs) {
1220 args += [ rebase_path(file, root_build_dir) ]
1221 }
1222 }
1223}
1224
mtkleinc04ff472016-06-23 10:29:30 -07001225component("skia") {
1226 public_configs = [ ":skia_public" ]
1227 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -07001228
Mike Klein607b0a72018-11-07 16:17:34 -05001229 public_deps = [
Ben Wagner32d5cfa2020-06-11 14:41:47 -04001230 ":fontmgr_FontConfigInterface",
1231 ":fontmgr_android",
1232 ":fontmgr_custom_directory",
1233 ":fontmgr_custom_embedded",
1234 ":fontmgr_custom_empty",
1235 ":fontmgr_fontconfig",
1236 ":fontmgr_fuchsia",
1237 ":fontmgr_mac_ct",
1238 ":fontmgr_win",
1239 ":fontmgr_win_gdi",
Ben Wagnere27ee6c2019-02-15 14:59:30 -05001240 ":gpu",
Mike Klein607b0a72018-11-07 16:17:34 -05001241 ":pdf",
1242 ":skcms",
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001243 ":xps",
Mike Klein607b0a72018-11-07 16:17:34 -05001244 ]
1245
mtkleinc04ff472016-06-23 10:29:30 -07001246 deps = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001247 ":android_utils",
anmittalb8b3f712016-08-25 04:55:19 -07001248 ":arm64",
1249 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -07001250 ":avx",
Mike Klein54378232018-11-08 12:08:05 +00001251 ":compile_processors",
anmittalb8b3f712016-08-25 04:55:19 -07001252 ":crc32",
Ethan Nicholasc18bb512020-07-28 14:46:53 -04001253 ":dehydrate_sksl",
Ben Wagner75626e42020-06-03 13:20:37 -04001254 ":fontmgr_factory",
Leon Scroggins III41169202019-01-29 09:29:57 -05001255 ":gif",
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001256 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -05001257 ":hsw",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001258 ":jpeg_decode",
1259 ":jpeg_encode",
Leon Scroggins III326b9892020-08-05 16:51:10 -04001260 ":ndk_images",
mtklein9b8583d2016-08-24 17:32:30 -07001261 ":none",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001262 ":png_decode",
1263 ":png_encode",
scroggof84ad642016-10-31 09:02:57 -07001264 ":raw",
Mike Klein613ad382019-06-06 11:42:02 -05001265 ":skvm_jit",
Mike Kleina9026da2020-06-05 08:57:05 -05001266 ":skx",
mtklein9b8583d2016-08-24 17:32:30 -07001267 ":sse2",
1268 ":sse41",
1269 ":sse42",
1270 ":ssse3",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001271 ":webp_decode",
1272 ":webp_encode",
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001273 ":wuffs",
mtklein63213812016-08-24 09:55:56 -07001274 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -07001275 ]
1276
Hal Canaryc25f4e92019-02-26 11:54:25 -05001277 public = skia_core_public
1278 public += skia_utils_public
1279 public += skia_effects_public
1280 public += skia_effects_imagefilter_public
Hal Canaryc25f4e92019-02-26 11:54:25 -05001281
mtkleinc04ff472016-06-23 10:29:30 -07001282 sources = []
brettwb9447282016-09-01 14:24:39 -07001283 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -07001284 sources += skia_utils_sources
Mike Klein54378232018-11-08 12:08:05 +00001285 sources += skia_effects_sources
1286 sources += skia_effects_imagefilter_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001287 sources += skia_sksl_sources
mtkleinc04ff472016-06-23 10:29:30 -07001288 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -04001289 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -05001290 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001291 "src/codec/SkAndroidCodec.cpp",
Nigel Tao612a65d2018-11-09 10:10:31 +11001292 "src/codec/SkAndroidCodecAdapter.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -04001293 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001294 "src/codec/SkBmpCodec.cpp",
1295 "src/codec/SkBmpMaskCodec.cpp",
1296 "src/codec/SkBmpRLECodec.cpp",
1297 "src/codec/SkBmpStandardCodec.cpp",
1298 "src/codec/SkCodec.cpp",
1299 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -04001300 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -04001301 "src/codec/SkEncodedInfo.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001302 "src/codec/SkMaskSwizzler.cpp",
1303 "src/codec/SkMasks.cpp",
Leon Scroggins IIIba458302019-09-24 12:40:11 -04001304 "src/codec/SkParseEncodedOrigin.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001305 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001306 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -07001307 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001308 "src/codec/SkSwizzler.cpp",
1309 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001310 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001311 "src/ports/SkDiscardableMemory_none.cpp",
Mike Klein54378232018-11-08 12:08:05 +00001312 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001313 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001314 "src/ports/SkMemory_malloc.cpp",
1315 "src/ports/SkOSFile_stdio.cpp",
1316 "src/sfnt/SkOTTable_name.cpp",
1317 "src/sfnt/SkOTUtils.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001318 ]
brettwb9447282016-09-01 14:24:39 -07001319
Leon Scroggins1340dbd2020-11-09 14:18:12 -05001320 defines = [ "SK_HAS_ANDROID_CODEC" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001321 libs = []
1322
mtkleinc04ff472016-06-23 10:29:30 -07001323 if (is_win) {
1324 sources += [
1325 "src/ports/SkDebug_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001326 "src/ports/SkImageEncoder_WIC.cpp",
1327 "src/ports/SkImageGeneratorWIC.cpp",
1328 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -07001329 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001330 ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001331 libs += [
Mike Klein4b167fc2016-10-11 18:13:53 -04001332 "Ole32.lib",
1333 "OleAut32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -04001334 ]
James Clarkeb8c0dab2021-02-09 06:22:41 -08001335
1336 if (!skia_enable_winuwp) {
1337 libs += [
1338 "FontSub.lib",
1339 "User32.lib",
1340 "Usp10.lib",
1341 ]
1342 }
mtkleinc04ff472016-06-23 10:29:30 -07001343 } else {
1344 sources += [
mtkleinc04ff472016-06-23 10:29:30 -07001345 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -07001346 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001347 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -04001348 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -07001349 }
1350
mtklein7d6fb2c2016-08-25 14:50:44 -07001351 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -05001352 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -05001353 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -05001354 deps += [ "//third_party/cpu-features" ]
1355 }
mtklein06c35c02016-09-20 12:28:12 -07001356 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001357 libs += [
1358 "EGL",
1359 "GLESv2",
1360 "log",
1361 ]
1362 }
1363
Kevin Lubick217056c2018-09-20 17:39:31 -04001364 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -07001365 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001366 if (skia_use_egl) {
1367 libs += [ "GLESv2" ]
1368 }
mtkleinc04ff472016-06-23 10:29:30 -07001369 }
1370
1371 if (is_mac) {
1372 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001373 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001374 "src/ports/SkImageEncoder_CG.cpp",
1375 "src/ports/SkImageGeneratorCG.cpp",
1376 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001377 frameworks = [
mtklein09e61f72016-08-23 13:35:28 -07001378 "ApplicationServices.framework",
1379 "OpenGL.framework",
1380 ]
mtkleinc04ff472016-06-23 10:29:30 -07001381 }
abarth6fc8ff02016-07-15 15:15:15 -07001382
Mike Klein7d302882016-11-03 14:06:31 -04001383 if (is_ios) {
1384 sources += [
1385 "src/ports/SkDebug_stdio.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001386 "src/ports/SkImageEncoder_CG.cpp",
1387 "src/ports/SkImageGeneratorCG.cpp",
1388 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001389 frameworks = [
Mike Klein7d302882016-11-03 14:06:31 -04001390 "CoreFoundation.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001391 "ImageIO.framework",
1392 "MobileCoreServices.framework",
1393 ]
1394 }
1395
abarth6fc8ff02016-07-15 15:15:15 -07001396 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001397 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001398 }
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001399
1400 if (skia_enable_spirv_validation) {
Stephen White238fc242019-08-26 10:19:23 -04001401 deps += [ "//third_party/spirv-tools:spvtools_val" ]
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001402 defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
1403 }
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -04001404
1405 if (skia_include_multiframe_procs) {
1406 sources += [ "tools/SkSharingProc.cpp" ]
1407 }
mtkleinc04ff472016-06-23 10:29:30 -07001408}
1409
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001410# DebugCanvas used in experimental/wasm-skp-debugger
1411if (target_cpu == "wasm") {
1412 static_library("debugcanvas") {
1413 public_configs = [ ":skia_public" ]
1414
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001415 sources = [
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001416 "tools/SkSharingProc.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001417 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001418 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001419 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001420 "tools/debugger/DrawCommand.cpp",
1421 "tools/debugger/JsonWriteBuffer.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001422 ]
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001423 }
1424}
1425
Kevin Lubickcbcff382018-10-02 09:02:18 -04001426static_library("pathkit") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001427 check_includes = false
Kevin Lubickcbcff382018-10-02 09:02:18 -04001428 public_configs = [ ":skia_public" ]
1429 configs += skia_library_configs
1430
1431 deps = [
1432 ":arm64",
1433 ":armv7",
1434 ":avx",
1435 ":crc32",
1436 ":hsw",
1437 ":none",
1438 ":sse2",
1439 ":sse41",
1440 ":sse42",
1441 ":ssse3",
1442 ]
1443
Kevin Lubickcbcff382018-10-02 09:02:18 -04001444 sources = []
1445 sources += skia_pathops_sources
Hal Canaryc25f4e92019-02-26 11:54:25 -05001446 sources += skia_pathops_public
Kevin Lubickcbcff382018-10-02 09:02:18 -04001447 sources += [
1448 "src/core/SkAnalyticEdge.cpp",
1449 "src/core/SkArenaAlloc.cpp",
Mike Reedcc88f3a2019-02-06 11:40:27 -05001450 "src/core/SkContourMeasure.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001451 "src/core/SkCubicMap.cpp",
1452 "src/core/SkEdge.cpp",
1453 "src/core/SkEdgeBuilder.cpp",
1454 "src/core/SkEdgeClipper.cpp",
1455 "src/core/SkGeometry.cpp",
Brian Salomon71fe9452020-03-02 16:59:40 -05001456 "src/core/SkIDChangeListener.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001457 "src/core/SkLineClipper.cpp",
Hal Canary7823aeb2019-10-30 17:26:45 -04001458 "src/core/SkMalloc.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001459 "src/core/SkMallocPixelRef.cpp",
1460 "src/core/SkMath.cpp",
1461 "src/core/SkMatrix.cpp",
1462 "src/core/SkOpts.cpp",
1463 "src/core/SkPaint.cpp",
1464 "src/core/SkPath.cpp",
Mike Reed06d7c9d2020-08-26 12:56:51 -04001465 "src/core/SkPathBuilder.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001466 "src/core/SkPathEffect.cpp",
1467 "src/core/SkPathMeasure.cpp",
1468 "src/core/SkPathRef.cpp",
1469 "src/core/SkPoint.cpp",
1470 "src/core/SkRRect.cpp",
Mike Klein45f36b52020-06-08 14:10:29 -05001471 "src/core/SkReadBuffer.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001472 "src/core/SkRect.cpp",
1473 "src/core/SkSemaphore.cpp",
1474 "src/core/SkStream.cpp",
1475 "src/core/SkString.cpp",
1476 "src/core/SkStringUtils.cpp",
1477 "src/core/SkStroke.cpp",
1478 "src/core/SkStrokeRec.cpp",
1479 "src/core/SkStrokerPriv.cpp",
1480 "src/core/SkThreadID.cpp",
1481 "src/core/SkUtils.cpp",
1482 "src/effects/SkDashPathEffect.cpp",
1483 "src/effects/SkTrimPathEffect.cpp",
1484 "src/ports/SkDebug_stdio.cpp",
1485 "src/ports/SkMemory_malloc.cpp",
1486 "src/utils/SkDashPath.cpp",
1487 "src/utils/SkParse.cpp",
1488 "src/utils/SkParsePath.cpp",
1489 "src/utils/SkUTF.cpp",
1490 ]
1491}
1492
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001493group("modules") {
1494 deps = [
Kevin Lubick96634842019-03-05 14:09:24 -05001495 "modules/particles",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001496 "modules/skottie",
Mike Reed63559a52020-06-02 11:34:24 -04001497 "modules/skparagraph",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001498 "modules/skshaper",
1499 ]
1500}
1501
Brian Osmancd28fa62020-07-07 16:01:26 -04001502config("our_vulkan_headers") {
1503 include_dirs = [ "include/third_party/vulkan" ]
1504}
1505
mtkleinc095df52016-08-24 12:23:52 -07001506# Targets guarded by skia_enable_tools may use //third_party freely.
1507if (skia_enable_tools) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001508 skia_public_includes = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001509 "client_utils/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001510 "include/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001511 "include/c",
1512 "include/codec",
1513 "include/config",
1514 "include/core",
1515 "include/docs",
1516 "include/effects",
1517 "include/encode",
1518 "include/gpu",
1519 "include/pathops",
1520 "include/ports",
1521 "include/svg",
1522 "include/utils",
1523 "include/utils/mac",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001524 "modules/particles/include",
1525 "modules/skottie/include",
Julia Lavrova70258c72020-07-15 11:28:57 -04001526 "modules/skparagraph/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001527 "modules/skshaper/include",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001528 "modules/svg/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001529 ]
1530
Mike Klein308b5ac2016-12-06 16:03:52 -05001531 # Used by gn_to_bp.py to list our public include dirs.
1532 source_set("public") {
1533 configs += [ ":skia_public" ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001534 include_dirs = skia_public_includes
Mike Klein308b5ac2016-12-06 16:03:52 -05001535 }
1536
Mike Kleinc36dedf2016-11-18 09:35:28 -05001537 config("skia.h_config") {
1538 include_dirs = [ "$target_gen_dir" ]
1539 }
1540 action("skia.h") {
1541 public_configs = [ ":skia.h_config" ]
1542 skia_h = "$target_gen_dir/skia.h"
1543 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001544
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001545 args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1546 [ rebase_path(skia_h, root_build_dir) ] +
1547 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001548 depfile = "$skia_h.deps"
Mike Kleina01c6b02020-04-01 13:47:34 -05001549 outputs = [ skia_h ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001550 }
1551
Brian Osmanc9a42472018-05-31 13:17:12 -04001552 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001553 executable("fiddle") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001554 check_includes = false
Mike Kleinc36dedf2016-11-18 09:35:28 -05001555 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001556 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001557 "tools/fiddle/draw.cpp",
1558 "tools/fiddle/fiddle_main.cpp",
1559 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001560
1561 if (skia_use_egl) {
1562 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001563 } else {
1564 sources += [ "tools/fiddle/null_context.cpp" ]
1565 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001566 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001567 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001568 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001569 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001570 ":skia",
1571 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001572 "modules/particles",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001573 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001574 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001575 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001576 "modules/svg",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001577 ]
1578 }
1579 }
1580
Mike Kleine5463e62020-06-11 13:53:53 -05001581 config("cpp14") {
1582 if (is_win) {
1583 cflags_cc = [ "/std:c++14" ]
1584 } else {
1585 cflags_cc = [ "-std=c++14" ]
1586 }
1587 }
1588
Brian Osmanc9a42472018-05-31 13:17:12 -04001589 source_set("public_headers_warnings_check") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001590 sources = [ "tools/public_headers_warnings_check.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001591 configs -= [ "//gn:warnings_except_public_headers" ]
Mike Kleine5463e62020-06-11 13:53:53 -05001592 configs += [
1593 ":our_vulkan_headers",
1594 ":cpp14",
1595 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001596 deps = [
1597 ":skia",
1598 ":skia.h",
1599 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001600 "modules/skshaper",
Brian Osmanc9a42472018-05-31 13:17:12 -04001601 ]
Stephen White0d70b712019-07-10 15:51:30 -04001602
1603 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001604 deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White0d70b712019-07-10 15:51:30 -04001605 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001606 }
1607
mtkleinc095df52016-08-24 12:23:52 -07001608 template("test_lib") {
1609 config(target_name + "_config") {
mtkleina627b5c2016-09-20 13:36:47 -07001610 if (defined(invoker.public_defines)) {
1611 defines = invoker.public_defines
1612 }
mtklein25c81d42016-07-27 13:55:26 -07001613 }
mtkleinc095df52016-08-24 12:23:52 -07001614 source_set(target_name) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001615 forward_variables_from(invoker, "*", [])
Hal Canaryc25f4e92019-02-26 11:54:25 -05001616 check_includes = false
mtkleinc095df52016-08-24 12:23:52 -07001617 public_configs = [
1618 ":" + target_name + "_config",
1619 ":skia_private",
1620 ]
1621
1622 if (!defined(deps)) {
1623 deps = []
1624 }
1625 deps += [ ":skia" ]
1626 testonly = true
1627 }
mtklein25c81d42016-07-27 13:55:26 -07001628 }
mtklein25c81d42016-07-27 13:55:26 -07001629
Mike Kleine6682eb2017-01-05 10:54:57 -05001630 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001631 if (is_ios) {
Hal Canary3388c1a2019-09-16 12:53:17 -04001632 ios_app_bundle(target_name) {
Jim Van Verth443a9132017-11-28 09:45:26 -05001633 forward_variables_from(invoker,
1634 "*",
1635 [
1636 "output_name",
1637 "visibility",
1638 "is_shared_library",
1639 ])
Mike Kleine6682eb2017-01-05 10:54:57 -05001640 testonly = true
Hal Canary3388c1a2019-09-16 12:53:17 -04001641 extra_configs = [ ":skia_private" ]
1642 launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard"
1643 data_sources = [ "resources" ]
1644 if ("True" == exec_script("//gn/checkdir.py",
1645 [ rebase_path("skps", root_build_dir) ],
1646 "trim string")) {
1647 data_sources += [ "skps" ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001648 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001649 }
1650 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001651 # !is_ios
1652
Jim Van Verth92411c72020-04-03 15:18:31 -04001653 output_dir = root_build_dir
Jim Van Verth443a9132017-11-28 09:45:26 -05001654 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1655 shared_library("lib" + target_name) {
1656 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1657 configs += [ ":skia_private" ]
1658 testonly = true
1659 }
1660 } else {
1661 _executable = target_name
1662 executable(_executable) {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001663 check_includes = false
Jim Van Verth443a9132017-11-28 09:45:26 -05001664 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1665 configs += [ ":skia_private" ]
1666 testonly = true
1667 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001668 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001669 if (is_android && skia_android_serial != "" && defined(_executable)) {
1670 action("push_" + target_name) {
1671 script = "gn/push_to_android.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05001672 deps = [ ":" + _executable ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001673 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
Mike Kleina01c6b02020-04-01 13:47:34 -05001674 outputs = [ _stamp ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001675 args = [
1676 rebase_path("$root_build_dir/$_executable"),
1677 skia_android_serial,
1678 rebase_path(_stamp),
1679 ]
1680 testonly = true
1681 }
Mike Klein7d921032017-01-05 12:20:41 -05001682 }
1683 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001684 }
1685
mtkleinc095df52016-08-24 12:23:52 -07001686 test_lib("gpu_tool_utils") {
Brian Osmanc9a42472018-05-31 13:17:12 -04001687 public_defines = []
mtkleind68f9b02016-09-23 13:18:41 -07001688
Mike Klein9e25bb92019-04-29 09:46:36 -05001689 # Bots and even devs may not have Vulkan headers, so put
1690 # include/third_party/vulkan on our path so they're always available.
1691 all_dependent_configs = [ ":our_vulkan_headers" ]
1692
Mike Klein333fb452019-04-24 08:48:11 -05001693 defines = []
1694 if (skia_enable_discrete_gpu) {
1695 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
1696 }
1697
Brian Osmanc9a42472018-05-31 13:17:12 -04001698 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001699 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001700 sources = [
Brian Salomon72c7b982020-10-06 10:07:38 -04001701 "tools/gpu/BackendSurfaceFactory.cpp",
1702 "tools/gpu/BackendSurfaceFactory.h",
Brian Salomon63a0a752020-06-26 13:32:09 -04001703 "tools/gpu/BackendTextureImageFactory.cpp",
1704 "tools/gpu/BackendTextureImageFactory.h",
Robert Phillips00f78de2020-07-01 16:09:43 -04001705 "tools/gpu/FlushFinishTracker.cpp",
1706 "tools/gpu/FlushFinishTracker.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001707 "tools/gpu/GrContextFactory.cpp",
1708 "tools/gpu/GrTest.cpp",
Brian Salomonf9b00422020-10-08 16:00:14 -04001709 "tools/gpu/ManagedBackendTexture.cpp",
1710 "tools/gpu/ManagedBackendTexture.h",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001711 "tools/gpu/MemoryCache.cpp",
1712 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001713 "tools/gpu/ProxyUtils.cpp",
1714 "tools/gpu/TestContext.cpp",
Brian Salomone21af502019-11-22 16:56:36 -05001715 "tools/gpu/TestOps.cpp",
1716 "tools/gpu/TestOps.h",
Michael Ludwigd9958f82019-03-21 13:08:36 -04001717 "tools/gpu/YUVUtils.cpp",
1718 "tools/gpu/YUVUtils.h",
Mike Kleina01c6b02020-04-01 13:47:34 -05001719 "tools/gpu/gl/GLTestContext.cpp", # See comment below about
1720 # GrContextFactory workaround.
Brian Osmanc9a42472018-05-31 13:17:12 -04001721 "tools/gpu/mock/MockTestContext.cpp",
1722 ]
Brian Salomon1171d312020-03-19 08:47:44 -04001723
1724 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001725 frameworks = []
Brian Salomon1171d312020-03-19 08:47:44 -04001726
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001727 if (skia_use_gl) {
Herb Derby64aa5132020-06-03 12:14:55 -04001728 sources +=
1729 [ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001730 if (is_ios) {
1731 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001732 frameworks += [ "OpenGLES.framework" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001733 } else if (is_mac) {
1734 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -05001735 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001736 if (skia_use_angle) {
1737 deps += [ "//third_party/angle2" ]
1738 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1739 }
Brian Salomon1171d312020-03-19 08:47:44 -04001740 }
1741
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001742 # We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in
1743 # in GrContextFactory. This only matters for OSes that can run Vulkan.
Chris Dalton2b598902020-03-25 10:50:35 -06001744 if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001745 if (is_android || skia_use_egl) {
1746 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1747 libs += [ "EGL" ]
1748 } else if (is_linux) {
1749 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
1750 libs += [
1751 "GLU",
1752 "GL",
1753 "X11",
1754 ]
1755 } else if (is_win) {
1756 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1757 libs += [ "Gdi32.lib" ]
1758 if (target_cpu != "arm64") {
1759 libs += [ "OpenGL32.lib" ]
1760 }
1761 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001762 }
Greg Daniel54200e42018-12-11 17:03:39 -05001763
Brian Osmanc9a42472018-05-31 13:17:12 -04001764 if (skia_use_vulkan) {
Robert Phillipsae413d82020-06-10 11:04:51 -04001765 sources += [ "tools/gpu/vk/VkTestContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001766 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Robert Phillips0d6ce7c2020-06-11 08:51:50 -04001767 sources += [ "tools/gpu/vk/VkTestHelper.h" ]
1768 sources += [ "tools/gpu/vk/VkTestHelper.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001769 sources += [ "tools/gpu/vk/VkTestUtils.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001770 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001771 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.h" ]
1772 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001773 }
1774 if (skia_use_metal) {
1775 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001776 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001777 if (skia_use_direct3d) {
1778 sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ]
Jim Van Verth03b8ab22020-02-24 11:36:15 -05001779 sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001780 }
Stephen White985741a2019-07-18 11:43:45 -04001781 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001782 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White985741a2019-07-18 11:43:45 -04001783 sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
Stephen White3ae5b292020-06-01 15:45:56 -04001784 if (is_clang) {
1785 cflags_cc = [ "-Wno-microsoft-cast" ]
1786 }
Stephen White985741a2019-07-18 11:43:45 -04001787 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001788
1789 if (is_fuchsia && using_fuchsia_sdk) {
1790 libs +=
1791 [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
1792 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001793 } # test_lib("gpu_tool_utils")
mtklein25c81d42016-07-27 13:55:26 -07001794
mtkleinc095df52016-08-24 12:23:52 -07001795 test_lib("flags") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001796 sources = [ "tools/flags/CommandLineFlags.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07001797 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001798
1799 test_lib("common_flags_config") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001800 sources = [ "tools/flags/CommonFlagsConfig.cpp" ]
1801 deps = [ ":flags" ]
1802 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001803 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001804 test_lib("common_flags_gpu") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001805 sources = [ "tools/flags/CommonFlagsGpu.cpp" ]
1806 deps = [ ":flags" ]
1807 public_deps = [ ":gpu_tool_utils" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001808 }
1809 test_lib("common_flags_images") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001810 sources = [ "tools/flags/CommonFlagsImages.cpp" ]
1811 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001812 }
1813 test_lib("common_flags_aa") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001814 sources = [ "tools/flags/CommonFlagsAA.cpp" ]
1815 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001816 }
mtklein25c81d42016-07-27 13:55:26 -07001817
Mike Klein499f0ac2019-03-25 13:00:12 -05001818 test_lib("trace") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001819 deps = [ ":flags" ]
Mike Klein499f0ac2019-03-25 13:00:12 -05001820 sources = [
1821 "tools/trace/ChromeTracingTracer.cpp",
1822 "tools/trace/ChromeTracingTracer.h",
1823 "tools/trace/EventTracingPriv.cpp",
1824 "tools/trace/EventTracingPriv.h",
1825 "tools/trace/SkDebugfTracer.cpp",
1826 "tools/trace/SkDebugfTracer.h",
1827 ]
1828 }
1829
mtkleinc095df52016-08-24 12:23:52 -07001830 test_lib("tool_utils") {
mtkleinc095df52016-08-24 12:23:52 -07001831 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001832 "tools/AndroidSkDebugToStdOut.cpp",
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001833 "tools/AutoreleasePool.h",
Robert Phillips96601082018-05-29 16:13:26 -04001834 "tools/DDLPromiseImageHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001835 "tools/DDLPromiseImageHelper.h",
Robert Phillips96601082018-05-29 16:13:26 -04001836 "tools/DDLTileHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001837 "tools/DDLTileHelper.h",
mtklein0590fa52016-09-01 07:06:54 -07001838 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001839 "tools/ProcStats.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001840 "tools/ProcStats.h",
mtkleinc095df52016-08-24 12:23:52 -07001841 "tools/Resources.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001842 "tools/Resources.h",
Hal Canarye574f1e2019-07-15 14:01:37 -04001843 "tools/SkMetaData.cpp",
1844 "tools/SkMetaData.h",
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001845 "tools/SkSharingProc.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001846 "tools/SkSharingProc.h",
1847 "tools/Stats.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001848 "tools/ToolUtils.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001849 "tools/ToolUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001850 "tools/UrlDataManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001851 "tools/UrlDataManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001852 "tools/debugger/DebugCanvas.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001853 "tools/debugger/DebugCanvas.h",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001854 "tools/debugger/DebugLayerManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001855 "tools/debugger/DebugLayerManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001856 "tools/debugger/DrawCommand.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001857 "tools/debugger/DrawCommand.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001858 "tools/debugger/JsonWriteBuffer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001859 "tools/debugger/JsonWriteBuffer.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001860 "tools/fonts/RandomScalerContext.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001861 "tools/fonts/RandomScalerContext.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001862 "tools/fonts/TestEmptyTypeface.h",
1863 "tools/fonts/TestFontMgr.cpp",
1864 "tools/fonts/TestFontMgr.h",
1865 "tools/fonts/TestSVGTypeface.cpp",
1866 "tools/fonts/TestSVGTypeface.h",
1867 "tools/fonts/TestTypeface.cpp",
1868 "tools/fonts/TestTypeface.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001869 "tools/fonts/ToolUtilsFont.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001870 "tools/random_parse_path.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001871 "tools/random_parse_path.h",
Hal Canary41248072019-07-11 16:32:53 -04001872 "tools/timer/TimeUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001873 "tools/timer/Timer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001874 "tools/timer/Timer.h",
mtkleinc095df52016-08-24 12:23:52 -07001875 ]
Chris Dalton2b598902020-03-25 10:50:35 -06001876 if (target_cpu != "wasm") {
1877 sources += [ "tools/CrashHandler.cpp" ]
1878 }
Mike Kleinadacaef2017-02-06 09:26:14 -05001879 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001880 frameworks = []
Mike Kleinadacaef2017-02-06 09:26:14 -05001881 if (is_ios) {
1882 sources += [ "tools/ios_utils.m" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001883 sources += [ "tools/ios_utils.h" ]
1884 if (skia_use_metal) {
1885 sources += [ "tools/AutoreleasePool.mm" ]
1886 }
Jim Van Verthef820be2020-08-12 10:45:00 -04001887 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001888 } else if (is_mac) {
1889 if (skia_use_metal) {
1890 sources += [ "tools/AutoreleasePool.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001891 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001892 }
James Clarkeb8c0dab2021-02-09 06:22:41 -08001893 } else if (is_win && !skia_enable_winuwp) {
Mike Kleinbf15b662019-04-15 11:32:16 -05001894 libs += [ "DbgHelp.lib" ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001895 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001896
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001897 defines = []
1898 if (skia_tools_require_resources) {
1899 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1900 }
mtkleinc095df52016-08-24 12:23:52 -07001901 deps = [
1902 ":flags",
Florin Malitab3418102020-10-15 18:10:29 -04001903 "modules/svg",
Mike Kleine4ad58a2019-03-26 09:05:52 -05001904 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05001905 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001906 }
mtklein25c81d42016-07-27 13:55:26 -07001907
Mike Kleine11e5c12019-04-24 12:46:06 -05001908 test_lib("etc1") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001909 sources = [ "third_party/etc1/etc1.cpp" ]
Mike Kleine11e5c12019-04-24 12:46:06 -05001910 }
1911
Mike Klein6e744122016-10-27 12:21:40 -04001912 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001913 test_lib("gm") {
mtkleinc095df52016-08-24 12:23:52 -07001914 sources = gm_sources
John Rosasco24cbdab2019-09-25 14:14:35 -07001915 if (skia_use_gl) {
1916 sources += gl_gm_sources
1917 }
mtkleinc095df52016-08-24 12:23:52 -07001918 deps = [
Mike Kleine11e5c12019-04-24 12:46:06 -05001919 ":etc1",
scroggo19b91532016-10-24 09:03:26 -07001920 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001921 ":skia",
1922 ":tool_utils",
Brian Osman84d884a2021-01-29 16:35:45 -05001923 "modules/particles",
Mike Reed2f0edd52018-05-31 14:22:30 -04001924 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001925 "modules/skottie:gm",
Mike Reed63559a52020-06-02 11:34:24 -04001926 "modules/skparagraph",
1927 "modules/skparagraph:gm",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001928 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001929 ]
Mike Kleinc4abade2019-08-09 10:11:35 -04001930 if (is_skia_dev_build) {
1931 sources += [ "gm/fiddle.cpp" ]
1932 deps += [ ":skia.h" ]
1933 }
Mike Kleina01c6b02020-04-01 13:47:34 -05001934 public_deps = [ ":gpu_tool_utils" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001935
1936 if (skia_use_ffmpeg) {
Florin Malita123e3b82020-04-24 11:10:27 -04001937 deps += [ "experimental/ffmpeg:video_decoder" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001938 sources += [ "gm/video_decoder.cpp" ]
1939 }
mtkleinc095df52016-08-24 12:23:52 -07001940 }
mtklein25c81d42016-07-27 13:55:26 -07001941
Ben Wagnerbded42a2021-02-17 22:14:34 -05001942 test_lib("test") {
1943 sources = [
1944 "tests/Test.cpp",
1945 "tests/Test.h",
1946 "tests/TestUtils.cpp",
1947 "tests/TestUtils.h",
1948 ]
1949 deps = [
1950 ":flags",
1951 ":skia",
1952 ":tool_utils",
1953 ]
1954 public_deps = [
1955 ":gpu_tool_utils", # Test.h #includes headers from this target.
1956 ]
1957 }
1958
Mike Klein6e744122016-10-27 12:21:40 -04001959 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001960 test_lib("tests") {
Mike Klein6e744122016-10-27 12:21:40 -04001961 sources = tests_sources + pathops_tests_sources
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001962 frameworks = []
Robert Phillips0c6daf02019-05-16 12:43:11 -04001963 if (skia_use_metal) {
1964 sources += metal_tests_sources
Jim Van Verth36b86af2020-08-24 17:16:46 +00001965 cflags_objcc = [ "-fobjc-arc" ]
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001966 frameworks += [ "MetalKit.framework" ]
Robert Phillips0c6daf02019-05-16 12:43:11 -04001967 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001968 if (skia_use_gl) {
1969 sources += gl_tests_sources
1970 }
mtkleinc095df52016-08-24 12:23:52 -07001971 deps = [
1972 ":flags",
Ben Wagnere75021e2021-02-17 22:18:34 -05001973 ":fontmgr_android_tests",
1974 ":fontmgr_fontconfig_tests",
Ben Wagnera3e5e552021-02-22 15:37:33 +00001975 ":fontmgr_mac_ct_tests",
mtkleinc095df52016-08-24 12:23:52 -07001976 ":skia",
Ben Wagnerbded42a2021-02-17 22:14:34 -05001977 ":test",
mtkleinc095df52016-08-24 12:23:52 -07001978 ":tool_utils",
Florin Malita26ae40f2020-06-08 12:03:48 -04001979 "experimental/skrive:tests",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001980 "modules/skottie:tests",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001981 "modules/skparagraph:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001982 "modules/sksg:tests",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001983 "modules/skshaper",
Florin Malitadec78022020-12-17 16:36:54 -05001984 "modules/svg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001985 "//third_party/libpng",
Leon Scroggins III194580d2019-02-22 12:32:16 -05001986 "//third_party/libwebp",
mtkleinc095df52016-08-24 12:23:52 -07001987 "//third_party/zlib",
1988 ]
1989 }
mtklein2f3416d2016-08-02 16:02:05 -07001990
Mike Klein6e744122016-10-27 12:21:40 -04001991 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001992 test_lib("bench") {
mtkleinc095df52016-08-24 12:23:52 -07001993 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001994 deps = [
1995 ":flags",
1996 ":gm",
1997 ":gpu_tool_utils",
1998 ":skia",
1999 ":tool_utils",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002000 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04002001 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07002002 ]
2003 }
mtklein2b6870c2016-07-28 14:17:33 -07002004
Mike Reedd62d4062019-06-12 10:20:44 -04002005 test_lib("experimental_xform") {
2006 sources = [
2007 "experimental/xform/SkShape.cpp",
2008 "experimental/xform/SkXform.cpp",
2009 "experimental/xform/XContext.cpp",
2010 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05002011 deps = [ ":skia" ]
Mike Reedd62d4062019-06-12 10:20:44 -04002012 }
2013
Florin Malitabfe876a2018-09-02 12:33:59 -04002014 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04002015 test_app("skottie_tool") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002016 deps = [ "modules/skottie:tool" ]
Florin Malita79725d32018-06-05 16:16:57 -04002017 }
Florin Malitab3418102020-10-15 18:10:29 -04002018 test_app("svg_tool") {
2019 deps = [ "modules/svg:tool" ]
2020 }
Florin Malita79725d32018-06-05 16:16:57 -04002021 }
2022
Hal Canary5b39dc82019-04-17 13:29:46 -04002023 test_app("make_skqp_model") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002024 sources = [ "tools/skqp/make_skqp_model.cpp" ]
2025 deps = [ ":skia" ]
Hal Canary5b39dc82019-04-17 13:29:46 -04002026 }
2027
Chris Dalton2b598902020-03-25 10:50:35 -06002028 import("gn/samples.gni")
2029 test_lib("samples") {
2030 sources = samples_sources
2031 if (skia_enable_ccpr) {
2032 sources += samples_sources_ccpr
Kevin Lubickebf648e2017-09-21 13:45:16 -04002033 }
Mike Kleina01c6b02020-04-01 13:47:34 -05002034 public_deps = [ ":tool_utils" ]
Chris Dalton2b598902020-03-25 10:50:35 -06002035 deps = [
Chris Dalton2b598902020-03-25 10:50:35 -06002036 ":flags",
2037 ":gpu_tool_utils",
2038 ":xml",
Jorge Betancourtb8621312020-09-10 15:16:35 -04002039 "modules/audioplayer",
Chris Dalton2b598902020-03-25 10:50:35 -06002040 "modules/skparagraph:samples",
2041 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002042 "modules/svg",
Tyler Denniston189ecd42020-10-22 15:40:49 -04002043 "//third_party/imgui",
Chris Dalton2b598902020-03-25 10:50:35 -06002044 ]
Chris Dalton2b598902020-03-25 10:50:35 -06002045 }
Kevin Lubick00398742020-10-08 10:05:07 -04002046 test_lib("hash_and_encode") {
2047 sources = [
2048 "tools/HashAndEncode.cpp",
2049 "tools/HashAndEncode.h",
2050 ]
2051 deps = [
2052 ":flags",
2053 ":skia",
2054 "//third_party/libpng",
2055 ]
2056 }
Chris Dalton2b598902020-03-25 10:50:35 -06002057 if (target_cpu != "wasm") {
Nigel Tao3ab9b1f2020-05-28 13:29:13 +10002058 test_app("convert-to-nia") {
2059 sources = [ "tools/convert-to-nia.cpp" ]
2060 deps = [ ":skia" ]
2061 }
Mike Klein7af351a2018-07-27 09:54:43 -04002062 test_app("imgcvt") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002063 sources = [ "tools/imgcvt.cpp" ]
Mike Klein7af351a2018-07-27 09:54:43 -04002064 deps = [
2065 ":skcms",
2066 ":skia",
2067 ]
2068 }
Mike Klein735c7ba2019-03-25 12:57:58 -05002069 test_app("fm") {
2070 sources = [
Mike Kleinfee00792019-11-21 16:18:47 -06002071 "dm/DMGpuTestProcs.cpp", # blech
Mike Klein735c7ba2019-03-25 12:57:58 -05002072 "tools/fm/fm.cpp",
2073 ]
2074 deps = [
2075 ":common_flags_aa",
2076 ":common_flags_gpu",
2077 ":flags",
2078 ":gm",
2079 ":gpu_tool_utils",
2080 ":hash_and_encode",
2081 ":skia",
Mike Kleinfee00792019-11-21 16:18:47 -06002082 ":tests",
Mike Klein735c7ba2019-03-25 12:57:58 -05002083 ":tool_utils",
2084 ":trace",
Mike Klein22924262019-04-02 14:14:56 -04002085 "modules/skottie",
2086 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002087 "modules/svg",
Mike Klein735c7ba2019-03-25 12:57:58 -05002088 ]
2089 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04002090 test_app("dm") {
2091 sources = [
2092 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04002093 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002094 "dm/DMJsonWriter.cpp",
2095 "dm/DMSrcSink.cpp",
2096 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04002097 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002098 ":common_flags_aa",
2099 ":common_flags_config",
2100 ":common_flags_gpu",
2101 ":common_flags_images",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002102 ":flags",
2103 ":gm",
2104 ":gpu_tool_utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05002105 ":hash_and_encode",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002106 ":skia",
2107 ":tests",
2108 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002109 ":trace",
Florin Malita02616ea2020-06-25 13:33:17 -04002110 "experimental/skrive",
Florin Malita3d856bd2018-05-26 09:49:28 -04002111 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05002112 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002113 "modules/svg",
Mike Klein38af9432016-11-11 11:39:44 -05002114 ]
2115 }
Robert Phillipscd1e3972021-02-22 17:24:22 -05002116 test_app("ddlbench") {
2117 sources = [ "experimental/ddlbench/ddlbench.cpp" ]
2118 deps = [
2119 ":flags",
2120 ":skia",
2121 ":tool_utils",
2122 ]
2123 }
Michael Ludwig30217952020-12-04 12:58:35 -05002124
2125 # optional separate library to dlopen when running CanvasStateTests.
2126 shared_library("canvas_state_lib") {
2127 sources = [
2128 "tests/CanvasStateHelpers.cpp",
2129 "tests/CanvasStateHelpers.h",
2130 ]
2131 deps = [ ":skia" ]
2132 }
Brian Osman16adfa32016-10-18 14:42:44 -04002133 }
2134
Mike Kleina8a51ce2018-01-09 12:34:11 -05002135 if (!is_win) {
2136 test_app("remote_demo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002137 sources = [ "tools/remote_demo.cpp" ]
2138 deps = [ ":skia" ]
Mike Kleina8a51ce2018-01-09 12:34:11 -05002139 }
2140 }
2141
Hal Canarye107faa2019-10-23 12:52:33 -04002142 if (!is_win) {
2143 test_app("blob_cache_sim") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002144 sources = [ "tools/blob_cache_sim.cpp" ]
2145 deps = [ ":skia" ]
Hal Canarye107faa2019-10-23 12:52:33 -04002146 }
2147 }
2148
Mike Kleine6682eb2017-01-05 10:54:57 -05002149 test_app("nanobench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002150 sources = [ "bench/nanobench.cpp" ]
mtklein2b6870c2016-07-28 14:17:33 -07002151 deps = [
2152 ":bench",
Mike Kleinc6142d82019-03-25 10:54:59 -05002153 ":common_flags_aa",
2154 ":common_flags_config",
2155 ":common_flags_gpu",
2156 ":common_flags_images",
mtklein2b6870c2016-07-28 14:17:33 -07002157 ":flags",
2158 ":gm",
2159 ":gpu_tool_utils",
2160 ":skia",
2161 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002162 ":trace",
Mike Reed63559a52020-06-02 11:34:24 -04002163 "modules/skparagraph",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002164 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002165 "modules/svg",
mtklein2b6870c2016-07-28 14:17:33 -07002166 ]
mtklein2b6870c2016-07-28 14:17:33 -07002167 }
halcanary19a97202016-08-03 15:08:04 -07002168
Ravi Mistry10d36c52017-01-31 09:49:18 -05002169 test_app("skpinfo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002170 sources = [ "tools/skpinfo.cpp" ]
Ravi Mistry10d36c52017-01-31 09:49:18 -05002171 deps = [
2172 ":flags",
2173 ":skia",
2174 ]
2175 }
2176
Mike Reedc0ee21f2019-05-28 16:11:03 -04002177 if (skia_use_ffmpeg) {
2178 test_app("skottie2movie") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002179 sources = [ "tools/skottie2movie.cpp" ]
Mike Reedc0ee21f2019-05-28 16:11:03 -04002180 deps = [
2181 ":flags",
Mike Reed5f12eaa2019-09-24 12:01:58 -04002182 ":gpu_tool_utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002183 ":skia",
Florin Malitaec403602020-04-24 12:14:03 -04002184 "experimental/ffmpeg:video_encoder",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002185 "modules/skottie",
Mike Reed5093e232019-05-30 10:10:50 -04002186 "modules/skottie:utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002187 ]
2188 }
2189 }
2190
Brian Osmanc9a42472018-05-31 13:17:12 -04002191 test_app("skpbench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002192 sources = [ "tools/skpbench/skpbench.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002193 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002194 ":common_flags_config",
2195 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002196 ":flags",
2197 ":gpu_tool_utils",
2198 ":skia",
2199 ":tool_utils",
2200 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07002201 }
2202
Mike Kleine6682eb2017-01-05 10:54:57 -05002203 test_app("sktexttopdf") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002204 sources = [ "tools/using_skia_and_harfbuzz.cpp" ]
halcanary3eee9d92016-09-10 07:01:53 -07002205 deps = [
2206 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04002207 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07002208 ]
halcanary3eee9d92016-09-10 07:01:53 -07002209 }
mtklein046cb562016-09-16 10:23:12 -07002210
Ben Wagner219f3622017-07-17 15:32:25 -04002211 test_app("create_test_font") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002212 sources = [ "tools/fonts/create_test_font.cpp" ]
2213 deps = [ ":skia" ]
Ben Wagner219f3622017-07-17 15:32:25 -04002214 assert_no_deps = [
2215 # tool_utils requires the output of this app.
2216 ":tool_utils",
2217 ]
2218 }
2219
Florin Malita5d3ff432018-07-31 16:38:43 -04002220 if (skia_use_expat) {
2221 test_app("create_test_font_color") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002222 sources = [ "tools/fonts/create_test_font_color.cpp" ]
Florin Malita5d3ff432018-07-31 16:38:43 -04002223 deps = [
2224 ":flags",
2225 ":skia",
2226 ":tool_utils",
2227 ]
2228 }
Ben Wagner97182cc2018-02-15 10:20:04 -05002229 }
2230
Mike Kleine6682eb2017-01-05 10:54:57 -05002231 test_app("get_images_from_skps") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002232 sources = [ "tools/get_images_from_skps.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07002233 deps = [
2234 ":flags",
2235 ":skia",
mtklein046cb562016-09-16 10:23:12 -07002236 ]
mtklein046cb562016-09-16 10:23:12 -07002237 }
mtkleinecbc5262016-09-22 11:51:24 -07002238
Brian Osman6788a542018-12-10 11:56:01 -05002239 if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
Mike Kleine6682eb2017-01-05 10:54:57 -05002240 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04002241 sources = [
2242 "tools/skiaserve/Request.cpp",
2243 "tools/skiaserve/Response.cpp",
2244 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002245 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
2246 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
2247 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
2248 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
2249 "tools/skiaserve/urlhandlers/DataHandler.cpp",
2250 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
2251 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
2252 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
2253 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05002254 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
2255 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002256 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
2257 "tools/skiaserve/urlhandlers/PostHandler.cpp",
2258 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
2259 "tools/skiaserve/urlhandlers/RootHandler.cpp",
2260 ]
2261 deps = [
2262 ":flags",
2263 ":gpu_tool_utils",
2264 ":skia",
2265 ":tool_utils",
Mike Klein7d302882016-11-03 14:06:31 -04002266 "//third_party/libmicrohttpd",
Mike Klein7d302882016-11-03 14:06:31 -04002267 ]
Mike Klein7d302882016-11-03 14:06:31 -04002268 }
mtkleinecbc5262016-09-22 11:51:24 -07002269 }
kjlubick14f984b2016-10-03 11:49:45 -07002270
Mike Kleine6682eb2017-01-05 10:54:57 -05002271 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07002272 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002273 "fuzz/Fuzz.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002274 "fuzz/Fuzz.h",
Hal Canary24ac42b2017-02-14 13:35:14 -05002275 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002276 "fuzz/FuzzCommon.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002277 "fuzz/FuzzCommon.h",
Zepeng Hu94007012020-07-22 14:37:46 +00002278 "fuzz/FuzzCreateDDL.cpp",
Adlai Hollerea8d1972021-02-23 13:05:32 -05002279 "fuzz/FuzzDDLThreading.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05002280 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04002281 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002282 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002283 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002284 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002285 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002286 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04002287 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04002288 "fuzz/FuzzRegionOp.cpp",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002289 "fuzz/FuzzSkParagraph.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002290 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05002291 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
2292 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002293 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002294 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04002295 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002296 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05002297 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
2298 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Zepeng Hufcb7ba02020-07-31 17:21:29 +00002299 "fuzz/oss_fuzz/FuzzSKP.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002300 "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
2301 "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
Kevin Lubick0f0a7102019-03-18 16:20:55 -04002302 "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002303 "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
Zepeng Huedaf3022020-06-12 12:20:59 +00002304 "fuzz/oss_fuzz/FuzzSVG.cpp",
Kevin Lubick2be14d32019-10-21 13:44:48 -04002305 "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp",
Weston Tracey1a771fe2021-02-04 11:09:59 -05002306 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
Zepeng Hua5783f32020-07-10 13:36:20 +00002307 "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002308 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05002309 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002310 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002311 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002312 "tools/debugger/DrawCommand.cpp",
2313 "tools/debugger/JsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002314 ]
2315 deps = [
2316 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04002317 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07002318 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04002319 "modules/skottie:fuzz",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002320 "modules/skparagraph",
kjlubick14f984b2016-10-03 11:49:45 -07002321 ]
kjlubick14f984b2016-10-03 11:49:45 -07002322 }
Mike Klein38312422016-10-05 15:41:01 -04002323
Mike Kleine6682eb2017-01-05 10:54:57 -05002324 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04002325 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04002326 rebase_path("tests/skia_test.cpp"),
2327 rebase_path("tests/Test.cpp"),
2328 ]
caryclark9feb6322016-10-25 08:58:26 -07002329 deps = [
2330 ":flags",
2331 ":gpu_tool_utils",
2332 ":skia",
2333 ":tool_utils",
2334 ]
caryclark9feb6322016-10-25 08:58:26 -07002335 }
2336
Mike Kleine6682eb2017-01-05 10:54:57 -05002337 test_app("dump_record") {
Mike Klein4a56f4c2020-08-18 16:02:52 -05002338 sources = [ "tools/dump_record.cpp" ]
Mike Klein38312422016-10-05 15:41:01 -04002339 deps = [
2340 ":flags",
2341 ":skia",
2342 ]
Mike Klein38312422016-10-05 15:41:01 -04002343 }
bungemanfe917272016-10-13 17:36:40 -04002344
Mike Kleine6682eb2017-01-05 10:54:57 -05002345 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04002346 sources = [
2347 "tools/skdiff/skdiff.cpp",
2348 "tools/skdiff/skdiff_html.cpp",
2349 "tools/skdiff/skdiff_main.cpp",
2350 "tools/skdiff/skdiff_utils.cpp",
2351 ]
2352 deps = [
2353 ":skia",
2354 ":tool_utils",
2355 ]
bungemanfe917272016-10-13 17:36:40 -04002356 }
halcanarya73d76a2016-10-17 13:19:02 -07002357
Mike Kleine6682eb2017-01-05 10:54:57 -05002358 test_app("skp_parser") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002359 sources = [ "tools/skp_parser.cpp" ]
halcanarya73d76a2016-10-17 13:19:02 -07002360 deps = [
2361 ":skia",
2362 ":tool_utils",
halcanarya73d76a2016-10-17 13:19:02 -07002363 ]
halcanarya73d76a2016-10-17 13:19:02 -07002364 }
Brian Osman16adfa32016-10-18 14:42:44 -04002365
Brian Osmanc9a42472018-05-31 13:17:12 -04002366 if (!is_win) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002367 source_set("skqp_lib") {
2368 check_includes = false
2369 testonly = true
2370 if (!is_official_build) {
2371 configs -= [ "//gn:warnings" ]
2372 }
2373 public_configs = [ ":skia_private" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05002374 defines =
2375 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary75427132017-10-11 16:00:31 -04002376 sources = [
2377 "dm/DMGpuTestProcs.cpp",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002378 "tools/skqp/src/skqp.cpp",
2379 "tools/skqp/src/skqp_model.cpp",
Hal Canary75427132017-10-11 16:00:31 -04002380 ]
2381 deps = [
2382 ":gm",
Hal Canary75427132017-10-11 16:00:31 -04002383 ":skia",
2384 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05002385 ":tool_utils",
2386 ]
2387 }
2388 test_app("skqp") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002389 sources = [ "tools/skqp/src/skqp_main.cpp" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002390 include_dirs = [ "//" ]
2391 lib_dirs = []
Mike Kleina01c6b02020-04-01 13:47:34 -05002392 deps = [ ":skqp_lib" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002393 }
2394 test_app("jitter_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002395 sources = [ "tools/skqp/jitter_gms.cpp" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002396 deps = [
2397 ":gm",
2398 ":skia",
2399 ":skqp_lib",
Hal Canary75427132017-10-11 16:00:31 -04002400 ]
2401 }
2402 }
John Rosasco24cbdab2019-09-25 14:14:35 -07002403 if (is_fuchsia) {
2404 # Build a package repository for skqp on Fuchsia.
2405 group("skqp_repo") {
2406 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002407 deps = [ "//build/fuchsia/skqp:skqp_repo" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002408 }
2409 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002410 if (is_android) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002411 shared_library("libskqp_app") {
2412 configs += [ ":skia_private" ]
2413 if (!is_official_build) {
2414 configs -= [ "//gn:warnings" ]
2415 }
2416 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002417 sources = [ "tools/skqp/src/jni_skqp.cpp" ]
Hal Canary28f89382017-12-12 09:42:14 -05002418 deps = [
2419 ":skia",
2420 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05002421 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05002422 ]
2423 libs = [ "android" ]
2424 }
2425 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002426 if (is_android && skia_use_gl) {
Stan Iliev93151722018-08-02 11:10:52 -04002427 test_app("skottie_android") {
2428 is_shared_library = true
2429
Jorge Betancourt1fcdcaa2020-06-22 14:14:32 +00002430 sources = [ "platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp" ]
Stan Iliev93151722018-08-02 11:10:52 -04002431 libs = []
2432
Stan Iliev93151722018-08-02 11:10:52 -04002433 deps = [
2434 ":skia",
2435 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04002436 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04002437 ]
2438 }
2439 }
Hal Canary75427132017-10-11 16:00:31 -04002440
Hal Canarya9de7602018-01-19 13:08:23 -05002441 test_app("list_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002442 sources = [ "tools/list_gms.cpp" ]
Hal Canarya9de7602018-01-19 13:08:23 -05002443 deps = [
2444 ":gm",
2445 ":skia",
2446 ]
2447 }
2448 test_app("list_gpu_unit_tests") {
2449 sources = [
2450 "dm/DMGpuTestProcs.cpp",
2451 "tools/list_gpu_unit_tests.cpp",
2452 ]
2453 deps = [
2454 ":skia",
2455 ":tests",
2456 ]
2457 }
2458
Brian Osmanc9a42472018-05-31 13:17:12 -04002459 test_lib("sk_app") {
Hal Canary378be8d2019-04-26 08:20:14 -04002460 public_deps = [
Hal Canary378be8d2019-04-26 08:20:14 -04002461 ":gpu_tool_utils",
Hal Canary05694472019-05-03 17:14:21 -04002462 ":skia",
Hal Canary378be8d2019-04-26 08:20:14 -04002463 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002464 sources = [
John Stilesab9578e2020-06-30 17:36:55 -04002465 "tools/sk_app/Application.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002466 "tools/sk_app/CommandSet.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002467 "tools/sk_app/CommandSet.h",
2468 "tools/sk_app/DisplayParams.h",
2469 "tools/sk_app/RasterWindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002470 "tools/sk_app/Window.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002471 "tools/sk_app/Window.h",
Robert Phillipsed653392020-07-10 13:55:21 -04002472 "tools/sk_app/WindowContext.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002473 "tools/sk_app/WindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002474 ]
2475 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04002476 frameworks = []
Brian Osmanc9a42472018-05-31 13:17:12 -04002477
2478 if (is_android) {
2479 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002480 "tools/sk_app/android/RasterWindowContext_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002481 "tools/sk_app/android/WindowContextFactory_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002482 "tools/sk_app/android/Window_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002483 "tools/sk_app/android/Window_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002484 "tools/sk_app/android/main_android.cpp",
2485 "tools/sk_app/android/surface_glue_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002486 "tools/sk_app/android/surface_glue_android.h",
Brian Osman16adfa32016-10-18 14:42:44 -04002487 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002488 libs += [ "android" ]
2489 } else if (is_linux) {
2490 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002491 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002492 "tools/sk_app/unix/WindowContextFactory_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002493 "tools/sk_app/unix/Window_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002494 "tools/sk_app/unix/Window_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002495 "tools/sk_app/unix/keysym2ucs.c",
John Stilesab9578e2020-06-30 17:36:55 -04002496 "tools/sk_app/unix/keysym2ucs.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002497 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002498 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002499 libs += [
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002500 "GL", # Used by raster window context, so cannot be behind skia_use_gl.
Brian Osmanc9a42472018-05-31 13:17:12 -04002501 "X11",
2502 ]
2503 } else if (is_win) {
2504 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002505 "tools/sk_app/win/RasterWindowContext_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002506 "tools/sk_app/win/WindowContextFactory_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002507 "tools/sk_app/win/Window_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002508 "tools/sk_app/win/Window_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002509 "tools/sk_app/win/main_win.cpp",
2510 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002511 } else if (is_mac) {
2512 sources += [
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002513 "tools/sk_app/mac/RasterWindowContext_mac.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002514 "tools/sk_app/mac/WindowContextFactory_mac.h",
2515 "tools/sk_app/mac/Window_mac.h",
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002516 "tools/sk_app/mac/Window_mac.mm",
2517 "tools/sk_app/mac/main_mac.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002518 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002519 frameworks += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002520 "QuartzCore.framework",
2521 "Cocoa.framework",
2522 "Foundation.framework",
2523 ]
2524 } else if (is_ios) {
2525 sources += [
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002526 "tools/sk_app/ios/RasterWindowContext_ios.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002527 "tools/sk_app/ios/WindowContextFactory_ios.h",
2528 "tools/sk_app/ios/Window_ios.h",
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002529 "tools/sk_app/ios/Window_ios.mm",
2530 "tools/sk_app/ios/main_ios.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002531 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002532 frameworks += [ "QuartzCore.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002533 }
2534
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002535 if (skia_use_gl) {
2536 sources += [ "tools/sk_app/GLWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002537 sources += [ "tools/sk_app/GLWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002538 if (is_android) {
2539 sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ]
2540 } else if (is_linux) {
2541 sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ]
2542 } else if (is_win) {
2543 sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ]
2544 if (skia_use_angle) {
2545 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
2546 }
2547 } else if (is_mac) {
2548 sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
2549 } else if (is_ios) {
2550 sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
2551 }
2552 }
2553
Brian Osmanc9a42472018-05-31 13:17:12 -04002554 if (skia_use_vulkan) {
2555 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002556 sources += [ "tools/sk_app/VulkanWindowContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002557 if (is_android) {
2558 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2559 } else if (is_linux) {
2560 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2561 libs += [ "X11-xcb" ]
2562 } else if (is_win) {
2563 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2564 }
2565 }
2566
Jim Van Verthbe39f712019-02-08 15:36:14 -05002567 if (skia_use_metal) {
2568 sources += [ "tools/sk_app/MetalWindowContext.mm" ]
John Stilesab9578e2020-06-30 17:36:55 -04002569 sources += [ "tools/sk_app/MetalWindowContext.h" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002570 if (is_mac) {
2571 sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002572 } else if (is_ios) {
Jim Van Verthe58d5322019-09-03 09:42:57 -04002573 sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002574 }
Jim Van Verthbe39f712019-02-08 15:36:14 -05002575 }
2576
Jim Van Verth682a2f42020-05-13 16:54:09 -04002577 if (skia_use_direct3d) {
2578 sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ]
2579 }
2580
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002581 if (skia_use_dawn) {
2582 sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002583 sources += [ "tools/sk_app/DawnWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002584 if (is_linux) {
2585 if (dawn_enable_vulkan) {
2586 sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
2587 defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
2588 libs += [ "X11-xcb" ]
2589 }
2590 } else if (is_win) {
2591 if (dawn_enable_d3d12) {
2592 sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
2593 }
2594 } else if (is_mac) {
2595 if (dawn_enable_metal) {
2596 sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
2597 }
2598 }
2599 }
2600
Mike Kleina01c6b02020-04-01 13:47:34 -05002601 deps = [ ":tool_utils" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002602 if (is_android) {
2603 deps += [ "//third_party/native_app_glue" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002604 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002605 if (skia_use_gl && skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002606 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002607 }
Brian Osman16adfa32016-10-18 14:42:44 -04002608 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002609
Hal Canary87515122019-03-15 14:22:51 -04002610 if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
2611 test_app("fiddle_examples") {
2612 sources = [
Brian Osmanc725e8f2019-04-10 14:08:44 -04002613 "tools/fiddle/all_examples.cpp",
Hal Canary87515122019-03-15 14:22:51 -04002614 "tools/fiddle/examples.cpp",
Brian Osman72ef2d52019-03-17 11:09:17 -04002615 "tools/fiddle/examples.h",
Hal Canary87515122019-03-15 14:22:51 -04002616 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002617 if (is_win) {
Hal Canary6c8422c2020-01-10 15:22:09 -05002618 cflags = [
2619 "/wd4756", # Overflow in constant arithmetic
2620 "/wd4305", # truncation from 'double' to 'float'
2621 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002622 }
Hal Canary87515122019-03-15 14:22:51 -04002623 deps = [
2624 ":skia",
2625 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002626 "modules/particles",
Hal Canary87515122019-03-15 14:22:51 -04002627 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002628 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04002629 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002630 "modules/svg",
Hal Canary87515122019-03-15 14:22:51 -04002631 ]
2632 }
2633 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002634
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002635 # sk_app can work without GL but viewer always runs raster through a GL window context.
2636 if (skia_use_gl) {
2637 test_app("viewer") {
2638 is_shared_library = is_android
2639 sources = [
2640 "tools/viewer/AnimTimer.h",
2641 "tools/viewer/BisectSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002642 "tools/viewer/BisectSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002643 "tools/viewer/GMSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002644 "tools/viewer/GMSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002645 "tools/viewer/ImGuiLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002646 "tools/viewer/ImGuiLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002647 "tools/viewer/ImageSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002648 "tools/viewer/ImageSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002649 "tools/viewer/ParticlesSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002650 "tools/viewer/ParticlesSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002651 "tools/viewer/SKPSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002652 "tools/viewer/SKPSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002653 "tools/viewer/SampleSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002654 "tools/viewer/SampleSlide.h",
Florin Malita45cd2002020-06-09 14:00:54 -04002655 "tools/viewer/SkRiveSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002656 "tools/viewer/SkRiveSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002657 "tools/viewer/SkSLSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002658 "tools/viewer/SkSLSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002659 "tools/viewer/SkottieSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002660 "tools/viewer/SkottieSlide.h",
2661 "tools/viewer/Slide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002662 "tools/viewer/SlideDir.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002663 "tools/viewer/SlideDir.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002664 "tools/viewer/StatsLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002665 "tools/viewer/StatsLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002666 "tools/viewer/SvgSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002667 "tools/viewer/SvgSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002668 "tools/viewer/TouchGesture.cpp",
2669 "tools/viewer/TouchGesture.h",
2670 "tools/viewer/Viewer.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002671 "tools/viewer/Viewer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002672 ]
2673 libs = []
2674
2675 deps = [
2676 ":common_flags_gpu",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002677 ":flags",
2678 ":gm",
2679 ":gpu_tool_utils",
2680 ":samples",
2681 ":sk_app",
2682 ":skia",
2683 ":tool_utils",
2684 ":trace",
Florin Malita45cd2002020-06-09 14:00:54 -04002685 "experimental/skrive",
Florin Malitac9c4e2e2020-08-13 12:03:37 -04002686 "modules/audioplayer",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002687 "modules/particles",
2688 "modules/skottie",
2689 "modules/skottie:utils",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002690 "modules/sksg:samples",
Florin Malitab3418102020-10-15 18:10:29 -04002691 "modules/svg",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002692 "//third_party/imgui",
2693 ]
2694 if (skia_use_experimental_xform) {
2695 deps += [ ":experimental_xform" ]
2696 sources += [ "gm/xform.cpp" ]
2697 }
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002698 if (skia_use_vulkan) {
Brian Salomon3207fbe2020-06-30 11:09:25 -04002699 deps += [
2700 "//third_party/spirv-tools:spvtools",
2701
2702 #spvtools depends on this but doesn't deps it in. Looks like upstream bug
2703 #that we replicated in our third_party/spirv-tools/BUILD.gn
2704 "//third_party/spirv-tools:spvtools_val",
2705 ]
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002706 }
Mike Reedd62d4062019-06-12 10:20:44 -04002707 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002708 }
2709
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002710 if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002711 test_app("HelloWorld") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002712 sources = [ "example/HelloWorld.cpp" ]
Brian Osmaneff04b52017-11-21 13:18:02 -05002713 libs = []
2714
Brian Osmaneff04b52017-11-21 13:18:02 -05002715 deps = [
2716 ":flags",
2717 ":gpu_tool_utils",
2718 ":sk_app",
2719 ":skia",
2720 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002721 ]
2722 }
2723 }
2724
Mike Klein9f6468f2020-05-19 13:14:40 -05002725 if (skia_use_gl && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002726 test_app("SkiaSDLExample") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002727 sources = [ "example/SkiaSDLExample.cpp" ]
Jim Van Verth4c70c752017-07-11 12:03:01 -04002728 libs = []
Jim Van Verth4c70c752017-07-11 12:03:01 -04002729 deps = [
2730 ":gpu_tool_utils",
2731 ":skia",
2732 "//third_party/libsdl",
2733 ]
2734 }
2735 }
2736
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002737 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2738 action_foreach("generate_mocs") {
2739 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002740 sources = [ "tools/mdbviz/MainWindow.h" ]
2741 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002742 args = [
2743 "$skia_qt_path" + "/bin/moc",
2744 "{{source}}",
2745 "-o",
2746 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2747 ]
2748 }
2749 action_foreach("generate_resources") {
2750 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002751 sources = [ "tools/mdbviz/resources.qrc" ]
2752 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002753 args = [
2754 "$skia_qt_path" + "/bin/rcc",
2755 "{{source}}",
2756 "-o",
2757 "gen/mdbviz/{{source_name_part}}_res.cpp",
2758 ]
2759 }
2760 test_app("mdbviz") {
2761 if (is_win) {
2762 # on Windows we need to disable some exception handling warnings due to the Qt headers
2763 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2764 }
2765 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002766 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002767 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002768 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002769 "tools/debugger/DrawCommand.cpp",
2770 "tools/debugger/JsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002771 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002772 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002773 "tools/mdbviz/main.cpp",
2774
2775 # generated files
2776 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2777 "$target_gen_dir/mdbviz/resources_res.cpp",
2778 ]
2779 lib_dirs = [ "$skia_qt_path/lib" ]
2780 libs = [
2781 "Qt5Core.lib",
2782 "Qt5Gui.lib",
2783 "Qt5Widgets.lib",
2784 ]
2785 include_dirs = [
2786 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002787 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002788 "$skia_qt_path/include/QtWidgets",
2789 ]
2790 deps = [
2791 ":generate_mocs",
2792 ":generate_resources",
2793 ":skia",
2794 ]
2795 }
2796 }
2797
Mike Kleine459afd2017-03-03 09:21:30 -05002798 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002799 copy("gdbserver") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002800 sources = [ "$ndk/$ndk_gdbserver" ]
2801 outputs = [ "$root_out_dir/gdbserver" ]
Derek Sollenberger70120c72017-01-05 11:39:04 -05002802 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002803 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002804
2805 if (skia_use_opencl) {
2806 test_app("hello-opencl") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002807 sources = [ "tools/hello-opencl.cpp" ]
2808 deps = [ "//third_party/opencl" ]
Mike Kleinf9ae6702018-06-20 14:05:05 -04002809 }
2810 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002811
Brian Osmanf564f152019-07-23 15:14:30 -04002812 executable("cpu_modules") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002813 sources = [ "tools/cpu_modules.cpp" ]
Brian Osmanf564f152019-07-23 15:14:30 -04002814 deps = [
2815 ":skia",
2816 "modules/particles",
2817 ]
2818 }
2819
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002820 if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) {
Hal Canary1f94d392019-07-30 09:27:56 -04002821 test_app("editor") {
2822 is_shared_library = is_android
Mike Kleina01c6b02020-04-01 13:47:34 -05002823 deps = [ "modules/skplaintexteditor:editor_app" ]
Hal Canary1f94d392019-07-30 09:27:56 -04002824 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002825 }
Hal Canarye5b65d22019-09-19 11:33:31 -04002826
2827 executable("image_diff_metric") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002828 sources = [ "tools/image_diff_metric.cpp" ]
2829 deps = [ ":skia" ]
Hal Canarye5b65d22019-09-19 11:33:31 -04002830 }
Chris Dalton2b598902020-03-25 10:50:35 -06002831
2832 group("modules_testonly") {
2833 testonly = true
2834 deps = []
2835 if (target_cpu == "wasm") {
2836 deps += [ "modules/canvaskit:viewer_wasm" ]
2837 }
2838 }
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002839
2840 if (skia_build_fuzzers) {
2841 template("libfuzzer_app") {
2842 output_dir = root_build_dir
2843 executable(target_name) {
2844 check_includes = false
2845 forward_variables_from(invoker, "*", [ "is_shared_library" ])
2846 configs += [ ":skia_private" ]
2847 sources += [
2848 "fuzz/Fuzz.cpp",
2849 "fuzz/FuzzCommon.cpp",
2850 ]
2851 deps += [
2852 ":flags",
2853 ":gpu_tool_utils",
2854 ":skia",
2855 ]
2856 defines = [ "SK_BUILD_FOR_LIBFUZZER" ]
2857 if (skia_use_libfuzzer_defaults) {
2858 cflags = [ "-fsanitize=fuzzer" ]
2859 ldflags = [ "-fsanitize=fuzzer" ]
2860 }
2861 testonly = true
2862 }
2863 }
2864
2865 libfuzzer_app("region_deserialize") {
2866 sources = [ "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp" ]
2867 deps = []
2868 }
2869
2870 libfuzzer_app("image_filter_deserialize") {
2871 include_dirs = [
2872 "tools",
2873 "tools/fonts",
2874 ]
2875 sources = [
2876 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
2877 "tools/Resources.cpp",
2878 "tools/fonts/TestFontMgr.cpp",
2879 "tools/fonts/TestSVGTypeface.cpp",
2880 "tools/fonts/TestTypeface.cpp",
2881 ]
Florin Malitab3418102020-10-15 18:10:29 -04002882 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002883 }
2884
2885 libfuzzer_app("region_set_path") {
2886 sources = [ "fuzz/oss_fuzz/FuzzRegionSetPath.cpp" ]
2887 deps = []
2888 }
2889
2890 libfuzzer_app("textblob_deserialize") {
2891 include_dirs = [
2892 "tools",
2893 "tools/fonts",
2894 ]
2895 sources = [
2896 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
2897 "tools/Resources.cpp",
2898 "tools/fonts/TestFontMgr.cpp",
2899 "tools/fonts/TestSVGTypeface.cpp",
2900 "tools/fonts/TestTypeface.cpp",
2901 ]
Florin Malitab3418102020-10-15 18:10:29 -04002902 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002903 }
2904
2905 libfuzzer_app("path_deserialize") {
2906 sources = [ "fuzz/oss_fuzz/FuzzPathDeserialize.cpp" ]
2907 deps = []
2908 }
2909
2910 libfuzzer_app("image_decode") {
2911 sources = [ "fuzz/oss_fuzz/FuzzImage.cpp" ]
2912 deps = []
2913 }
2914
2915 libfuzzer_app("animated_image_decode") {
2916 sources = [ "fuzz/oss_fuzz/FuzzAnimatedImage.cpp" ]
2917 deps = []
2918 }
2919
2920 libfuzzer_app("api_create_ddl") {
2921 include_dirs = [
2922 "include",
2923 "include/gpu",
2924 ]
2925 sources = [
2926 "fuzz/FuzzCreateDDL.cpp",
2927 "fuzz/oss_fuzz/FuzzAPICreateDDL.cpp",
2928 "tools/Resources.cpp",
2929 "tools/UrlDataManager.cpp",
2930 "tools/debugger/DebugCanvas.cpp",
2931 "tools/debugger/DebugLayerManager.cpp",
2932 "tools/debugger/DrawCommand.cpp",
2933 "tools/debugger/JsonWriteBuffer.cpp",
2934 "tools/fonts/TestFontMgr.cpp",
2935 "tools/fonts/TestSVGTypeface.cpp",
2936 "tools/fonts/TestTypeface.cpp",
2937 ]
2938 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04002939 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002940 "//third_party/libpng",
2941 ]
2942 }
2943
2944 libfuzzer_app("api_draw_functions") {
2945 sources = [
2946 "fuzz/FuzzDrawFunctions.cpp",
2947 "fuzz/oss_fuzz/FuzzDrawFunctions.cpp",
2948 ]
2949 deps = []
2950 }
2951
2952 libfuzzer_app("api_gradients") {
2953 sources = [
2954 "fuzz/FuzzGradients.cpp",
2955 "fuzz/oss_fuzz/FuzzGradients.cpp",
2956 ]
2957 deps = []
2958 }
2959
2960 libfuzzer_app("api_image_filter") {
2961 include_dirs = [
2962 "tools",
2963 "tools/debugger",
2964 ]
2965 sources = [
2966 "fuzz/FuzzCanvas.cpp",
2967 "fuzz/oss_fuzz/FuzzAPIImageFilter.cpp",
2968 "tools/UrlDataManager.cpp",
2969 "tools/debugger/DebugCanvas.cpp",
2970 "tools/debugger/DebugLayerManager.cpp",
2971 "tools/debugger/DrawCommand.cpp",
2972 "tools/debugger/JsonWriteBuffer.cpp",
2973 ]
2974 deps = [ "//third_party/libpng" ]
2975 }
2976
2977 libfuzzer_app("api_path_measure") {
2978 sources = [
2979 "fuzz/FuzzPathMeasure.cpp",
2980 "fuzz/oss_fuzz/FuzzPathMeasure.cpp",
2981 ]
2982 deps = []
2983 }
2984
2985 libfuzzer_app("api_pathop") {
2986 sources = [
2987 "fuzz/FuzzPathop.cpp",
2988 "fuzz/oss_fuzz/FuzzPathop.cpp",
2989 ]
2990 deps = []
2991 }
2992
2993 libfuzzer_app("api_raster_n32_canvas") {
2994 include_dirs = [
2995 "tools",
2996 "tools/debugger",
2997 "tools/fonts",
2998 ]
2999 sources = [
3000 "fuzz/FuzzCanvas.cpp",
3001 "fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp",
3002 "tools/Resources.cpp",
3003 "tools/UrlDataManager.cpp",
3004 "tools/debugger/DebugCanvas.cpp",
3005 "tools/debugger/DebugLayerManager.cpp",
3006 "tools/debugger/DrawCommand.cpp",
3007 "tools/debugger/JsonWriteBuffer.cpp",
3008 "tools/fonts/TestFontMgr.cpp",
3009 "tools/fonts/TestSVGTypeface.cpp",
3010 "tools/fonts/TestTypeface.cpp",
3011 ]
3012 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003013 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003014 "//third_party/libpng",
3015 ]
3016 }
3017
3018 if (skia_use_gl) {
3019 libfuzzer_app("api_mock_gpu_canvas") {
3020 include_dirs = [
3021 "tools",
3022 "tools/debugger",
3023 "tools/fonts",
3024 ]
3025 sources = [
3026 "fuzz/FuzzCanvas.cpp",
3027 "fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp",
3028 "tools/LsanSuppressions.cpp",
3029 "tools/Resources.cpp",
3030 "tools/UrlDataManager.cpp",
3031 "tools/debugger/DebugCanvas.cpp",
3032 "tools/debugger/DebugLayerManager.cpp",
3033 "tools/debugger/DrawCommand.cpp",
3034 "tools/debugger/JsonWriteBuffer.cpp",
3035 "tools/fonts/TestFontMgr.cpp",
3036 "tools/fonts/TestSVGTypeface.cpp",
3037 "tools/fonts/TestTypeface.cpp",
3038 ]
3039 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003040 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003041 "//third_party/libpng",
3042 ]
3043 }
3044 }
3045
3046 libfuzzer_app("api_null_canvas") {
3047 include_dirs = [
3048 "tools",
3049 "tools/debugger",
3050 "tools/fonts",
3051 ]
3052 sources = [
3053 "fuzz/FuzzCanvas.cpp",
3054 "fuzz/oss_fuzz/FuzzNullCanvas.cpp",
3055 "tools/Resources.cpp",
3056 "tools/UrlDataManager.cpp",
3057 "tools/debugger/DebugCanvas.cpp",
3058 "tools/debugger/DebugLayerManager.cpp",
3059 "tools/debugger/DrawCommand.cpp",
3060 "tools/debugger/JsonWriteBuffer.cpp",
3061 "tools/fonts/TestFontMgr.cpp",
3062 "tools/fonts/TestSVGTypeface.cpp",
3063 "tools/fonts/TestTypeface.cpp",
3064 ]
3065 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003066 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003067 "//third_party/libpng",
3068 ]
3069 }
3070
Weston Tracey1a771fe2021-02-04 11:09:59 -05003071 libfuzzer_app("api_skparagraph") {
3072 sources = [
3073 "fuzz/FuzzSkParagraph.cpp",
3074 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
3075 "tools/Resources.cpp",
3076 ]
3077 deps = [ "modules/skparagraph" ]
3078 }
3079
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003080 libfuzzer_app("api_svg_canvas") {
3081 include_dirs = [
3082 "include",
3083 "include/svg",
3084 ]
3085 sources = [
3086 "fuzz/FuzzCanvas.cpp",
3087 "fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp",
3088 "tools/Resources.cpp",
3089 "tools/UrlDataManager.cpp",
3090 "tools/debugger/DebugCanvas.cpp",
3091 "tools/debugger/DebugLayerManager.cpp",
3092 "tools/debugger/DrawCommand.cpp",
3093 "tools/debugger/JsonWriteBuffer.cpp",
3094 "tools/fonts/TestFontMgr.cpp",
3095 "tools/fonts/TestSVGTypeface.cpp",
3096 "tools/fonts/TestTypeface.cpp",
3097 ]
3098 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003099 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003100 "//third_party/libpng",
3101 ]
3102 }
3103
3104 libfuzzer_app("png_encoder") {
3105 sources = [
3106 "fuzz/FuzzEncoders.cpp",
3107 "fuzz/oss_fuzz/FuzzPNGEncoder.cpp",
3108 ]
3109 deps = []
3110 }
3111
3112 libfuzzer_app("jpeg_encoder") {
3113 sources = [
3114 "fuzz/FuzzEncoders.cpp",
3115 "fuzz/oss_fuzz/FuzzJPEGEncoder.cpp",
3116 ]
3117 deps = []
3118 }
3119
3120 libfuzzer_app("webp_encoder") {
3121 sources = [
3122 "fuzz/FuzzEncoders.cpp",
3123 "fuzz/oss_fuzz/FuzzWEBPEncoder.cpp",
3124 ]
3125 deps = []
3126 }
3127
3128 libfuzzer_app("skottie_json") {
3129 sources = [
3130 "modules/skottie/fuzz/FuzzSkottieJSON.cpp",
3131 "tools/Resources.cpp",
3132 "tools/fonts/TestFontMgr.cpp",
3133 "tools/fonts/TestSVGTypeface.cpp",
3134 "tools/fonts/TestTypeface.cpp",
3135 ]
3136 deps = [
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003137 "modules/skottie:skottie",
Florin Malitab3418102020-10-15 18:10:29 -04003138 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003139 ]
3140 }
3141
3142 libfuzzer_app("skjson") {
3143 sources = [ "fuzz/oss_fuzz/FuzzJSON.cpp" ]
3144 deps = []
3145 }
3146
3147 libfuzzer_app("api_polyutils") {
3148 sources = [
3149 "fuzz/FuzzPolyUtils.cpp",
3150 "fuzz/oss_fuzz/FuzzPolyUtils.cpp",
3151 ]
3152 deps = [ ":skia" ]
3153 }
3154
3155 libfuzzer_app("android_codec") {
3156 sources = [ "fuzz/oss_fuzz/FuzzAndroidCodec.cpp" ]
3157 deps = []
3158 }
3159
3160 libfuzzer_app("image_decode_incremental") {
3161 sources = [ "fuzz/oss_fuzz/FuzzIncrementalImage.cpp" ]
3162 deps = []
3163 }
3164
3165 libfuzzer_app("sksl2glsl") {
3166 sources = [ "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp" ]
3167 deps = []
3168 }
3169
3170 libfuzzer_app("sksl2spirv") {
3171 sources = [ "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp" ]
3172 deps = []
3173 }
3174
3175 libfuzzer_app("sksl2metal") {
3176 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp" ]
3177 deps = []
3178 }
3179
3180 libfuzzer_app("sksl2pipeline") {
3181 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp" ]
3182 deps = []
3183 }
3184
3185 libfuzzer_app("skdescriptor_deserialize") {
3186 sources = [ "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp" ]
3187 deps = []
3188 }
3189
3190 libfuzzer_app("svg_dom") {
3191 sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ]
Florin Malitab3418102020-10-15 18:10:29 -04003192 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003193 }
3194
3195 libfuzzer_app("skruntimeeffect") {
3196 sources = [ "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp" ]
3197 deps = []
3198 }
3199
3200 libfuzzer_app("skp") {
3201 sources = [ "fuzz/oss_fuzz/FuzzSKP.cpp" ]
3202 deps = []
3203 }
3204 }
mtklein25c81d42016-07-27 13:55:26 -07003205}
Hal Canary932a2c02019-09-17 10:43:18 -04003206
Chinmay Gardea1ea0a92019-10-01 16:37:10 -07003207if (is_ios && skia_use_metal && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003208 group("minimal_ios_mtl_skia_app") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003209 deps = [ "experimental/minimal_ios_mtl_skia_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003210 }
Hal Canary27483062019-12-06 15:01:08 -05003211}
3212
Hal Canary60ff6512020-01-21 12:39:20 -05003213if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003214 group("skottie_ios") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003215 deps = [ "tools/skottie_ios_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003216 }
3217}
Martin Kustermannb65d2992020-12-15 16:15:13 +01003218
3219executable("skia_c_api_example") {
3220 sources = [ "experimental/c-api-example/skia-c-example.c" ]
3221 include_dirs = [ "." ]
3222 deps = [ ":skia" ]
3223}