blob: 8b5c9db3a95312fea39a82c7e6910a45a6028d1b [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) {
885 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
886
887 # this lib is required to link against AHardwareBuffer
888 if (defined(ndk_api) && ndk_api >= 26) {
889 libs += [ "android" ]
890 }
891 } else if (skia_use_egl) {
892 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
893 libs += [ "EGL" ]
Kevin Lubick204c3be2020-08-19 14:30:58 -0400894 } else if (skia_use_webgl) {
895 sources += [ "src/gpu/gl/webgl/GrGLMakeNativeInterface_webgl.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400896 } else if (is_linux && skia_use_x11) {
897 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
898 libs += [ "GL" ]
899 } else if (is_mac) {
900 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
901 } else if (is_ios) {
902 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
James Clarkeb8c0dab2021-02-09 06:22:41 -0800903 } else if (is_win && !skia_enable_winuwp) {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400904 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
905 if (target_cpu != "arm64") {
906 libs += [ "OpenGL32.lib" ]
907 }
908 } else {
909 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
910 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800911 sources += skia_gl_gpu_sources
912 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400913
mtkleine9fb3d52016-09-20 15:11:46 -0700914 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400915 public_defines += [ "SK_VULKAN" ]
Greg Danielb16beb92020-04-27 14:26:21 +0000916 if (skia_use_vma) {
917 deps += [ "third_party/vulkanmemoryallocator" ]
918 }
mtkleine9fb3d52016-09-20 15:11:46 -0700919 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700920 if (skia_enable_vulkan_debug_layers) {
921 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
922 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800923 if (is_fuchsia) {
John Rosascoe57ca492019-11-13 14:30:45 -0800924 if (using_fuchsia_sdk) {
Chinmay Garde89820762019-05-06 16:44:06 -0700925 public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
926 } else {
Brian Osman489cf882019-07-09 10:48:28 -0400927 public_deps += [ "//src/graphics/lib/vulkan" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700928 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800929 }
mtkleine9fb3d52016-09-20 15:11:46 -0700930 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400931
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400932 if (is_android && (skia_use_gl || skia_use_vulkan)) {
933 # this lib is required to link against AHardwareBuffer
934 if (defined(ndk_api) && ndk_api >= 26) {
935 libs += [ "android" ]
936 }
937 }
938
Stephen White0d70b712019-07-10 15:51:30 -0400939 if (skia_use_dawn) {
940 public_defines += [ "SK_DAWN" ]
Stephen White985741a2019-07-18 11:43:45 -0400941 sources += skia_dawn_sources
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700942 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen Whitefbffb992019-10-17 10:32:40 -0400943 deps += [
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700944 "//third_party/externals/dawn/src/dawn:dawn_proc",
945 "//third_party/externals/dawn/src/dawn:dawncpp",
946 "//third_party/externals/dawn/src/dawn_native",
Stephen White0d70b712019-07-10 15:51:30 -0400947 ]
948 if (dawn_enable_d3d12) {
949 libs += [
950 "d3d12.lib",
951 "dxgi.lib",
952 "d3dcompiler.lib",
953 ]
954 } else if (dawn_enable_metal) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400955 frameworks += [ "Metal.framework" ]
Stephen White0d70b712019-07-10 15:51:30 -0400956 }
957 }
958
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500959 if (skia_use_direct3d) {
960 public_defines += [ "SK_DIRECT3D" ]
Jim Van Verth1b89eb72020-09-23 16:29:51 -0400961 deps += [
962 "//third_party/d3d12allocator",
963 "//third_party/spirv-cross:spirv_cross",
964 ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500965 sources += skia_direct3d_sources
Jim Van Verth03b8ab22020-02-24 11:36:15 -0500966 if (skia_enable_direct3d_debug_layer) {
967 public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ]
968 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500969 libs += [
970 "d3d12.lib",
971 "dxgi.lib",
972 "d3dcompiler.lib",
973 ]
974 }
975
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400976 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400977 if (skia_use_metal) {
978 public_defines += [ "SK_METAL" ]
979 sources += skia_metal_sources
Jim Van Verthef820be2020-08-12 10:45:00 -0400980 frameworks += [ "Metal.framework" ]
Jim Van Verthef820be2020-08-12 10:45:00 -0400981 frameworks += [ "Foundation.framework" ]
Jim Van Verth36b86af2020-08-24 17:16:46 +0000982 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400983 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500984
Kevin Lubickf4def342018-10-04 12:52:50 -0400985 if (is_debug) {
986 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
987 }
mtklein06c35c02016-09-20 12:28:12 -0700988}
989
Leon Scroggins III41169202019-01-29 09:29:57 -0500990optional("gif") {
Hal Canary2dad9902019-11-20 16:01:31 -0500991 enabled = !skia_use_wuffs && skia_use_libgifcodec
Hal Canary1ec9a282019-11-21 10:15:50 -0500992 _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
993 if ("True" ==
994 exec_script("gn/checkpath.py",
995 [ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
996 "trim string")) {
997 public_defines = [ "SK_USE_LIBGIFCODEC" ]
998 public_include_dirs = [
999 ".",
1000 skia_libgifcodec_path,
1001 ]
1002 include_dirs = public_include_dirs
1003 import(_libgifcodec_gni_path)
1004 sources = rebase_path(libgifcodec_sources + libgifcodec_public,
1005 ".",
1006 skia_libgifcodec_path)
1007 }
Leon Scroggins III41169202019-01-29 09:29:57 -05001008}
1009
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001010optional("heif") {
1011 enabled = skia_use_libheif
1012 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
1013
1014 deps = []
1015
Mike Kleina01c6b02020-04-01 13:47:34 -05001016 sources = [ "src/codec/SkHeifCodec.cpp" ]
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001017}
1018
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001019optional("jpeg_decode") {
1020 enabled = skia_use_libjpeg_turbo_decode
1021 public_defines = [ "SK_CODEC_DECODES_JPEG" ]
1022
Mike Kleina01c6b02020-04-01 13:47:34 -05001023 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001024 sources = [
1025 "src/codec/SkJpegCodec.cpp",
1026 "src/codec/SkJpegDecoderMgr.cpp",
1027 "src/codec/SkJpegUtility.cpp",
1028 ]
1029}
1030
1031optional("jpeg_encode") {
1032 enabled = skia_use_libjpeg_turbo_encode
1033 public_defines = [ "SK_ENCODE_JPEG" ]
mtklein63213812016-08-24 09:55:56 -07001034
Mike Kleina01c6b02020-04-01 13:47:34 -05001035 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
1036 public = [ "include/encode/SkJpegEncoder.h" ]
mtklein63213812016-08-24 09:55:56 -07001037 sources = [
mtklein63213812016-08-24 09:55:56 -07001038 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -04001039 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -07001040 ]
1041}
1042
Leon Scroggins III326b9892020-08-05 16:51:10 -04001043optional("ndk_images") {
1044 enabled = skia_use_ndk_images
1045 public_defines = [ "SK_ENABLE_NDK_IMAGES" ]
1046 sources = [
1047 "src/ports/SkImageEncoder_NDK.cpp",
1048 "src/ports/SkImageGeneratorNDK.cpp",
1049 "src/ports/SkNDKConversions.cpp",
1050 ]
Leon Scroggins IIIf21d6b92020-08-05 10:44:17 -04001051 libs = [ "jnigraphics" ]
1052}
1053
mtklein63213812016-08-24 09:55:56 -07001054optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -05001055 enabled = skia_use_zlib && skia_enable_pdf
1056 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -07001057
Mike Kleina01c6b02020-04-01 13:47:34 -05001058 deps = [ "//third_party/zlib" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001059 if (skia_use_libjpeg_turbo_decode) {
1060 deps += [ ":jpeg_decode" ]
1061 }
1062 if (skia_use_libjpeg_turbo_encode) {
1063 deps += [ ":jpeg_encode" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -04001064 }
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001065 public = skia_pdf_public
brettwb9447282016-09-01 14:24:39 -07001066 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -07001067 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
Hal Canary2a3093c2019-02-20 11:25:45 -05001068 if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
1069 deps += [ "//third_party/harfbuzz" ]
1070 defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
1071 } else if (skia_use_icu && skia_use_sfntly) {
mtklein63213812016-08-24 09:55:56 -07001072 deps += [ "//third_party/sfntly" ]
Hal Canary32498f02019-02-04 15:36:31 -05001073 defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -07001074 }
1075}
1076
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001077optional("xps") {
1078 enabled = skia_use_xps && is_win
1079 public_defines = [ "SK_SUPPORT_XPS" ]
1080 public = skia_xps_public
1081 sources = skia_xps_sources
1082}
1083
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001084optional("png_decode") {
1085 enabled = skia_use_libpng_decode
1086 public_defines = [ "SK_CODEC_DECODES_PNG" ]
mtklein63213812016-08-24 09:55:56 -07001087
Mike Kleina01c6b02020-04-01 13:47:34 -05001088 deps = [ "//third_party/libpng" ]
mtklein63213812016-08-24 09:55:56 -07001089 sources = [
1090 "src/codec/SkIcoCodec.cpp",
1091 "src/codec/SkPngCodec.cpp",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001092 ]
1093}
1094
1095optional("png_encode") {
1096 enabled = skia_use_libpng_encode
1097 public_defines = [ "SK_ENCODE_PNG" ]
1098
Mike Kleina01c6b02020-04-01 13:47:34 -05001099 deps = [ "//third_party/libpng" ]
1100 sources = [ "src/images/SkPngEncoder.cpp" ]
mtklein63213812016-08-24 09:55:56 -07001101}
1102
scroggof84ad642016-10-31 09:02:57 -07001103optional("raw") {
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001104 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -07001105 public_defines = [ "SK_CODEC_DECODES_RAW" ]
1106
1107 deps = [
1108 "//third_party/dng_sdk",
1109 "//third_party/libjpeg-turbo:libjpeg",
1110 "//third_party/piex",
1111 ]
1112
1113 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
1114 # Skia.
1115 configs_to_remove = [ "//gn:no_exceptions" ]
1116
Mike Kleina01c6b02020-04-01 13:47:34 -05001117 sources = [ "src/codec/SkRawCodec.cpp" ]
scroggof84ad642016-10-31 09:02:57 -07001118}
1119
Mike Klein852a8cb2018-05-15 10:46:58 -04001120import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -04001121source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -04001122 cflags = []
1123 if (!is_win || is_clang) {
1124 cflags += [
1125 "-w",
1126 "-std=c11",
1127 ]
1128 }
1129
Mike Kleina01c6b02020-04-01 13:47:34 -05001130 public = [ "include/third_party/skcms/skcms.h" ]
Brian Osmanea236bf2019-04-29 10:28:22 -04001131 include_dirs = [ "include/third_party/skcms" ]
Mike Klein852a8cb2018-05-15 10:46:58 -04001132 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
1133}
1134
mtklein3cc22182016-08-29 13:26:14 -07001135optional("typeface_freetype") {
1136 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -07001137
Mike Kleina01c6b02020-04-01 13:47:34 -05001138 deps = [ "//third_party/freetype2" ]
mtklein3cc22182016-08-29 13:26:14 -07001139 sources = [
1140 "src/ports/SkFontHost_FreeType.cpp",
1141 "src/ports/SkFontHost_FreeType_common.cpp",
Ben Wagner9d5c55c2020-06-27 12:52:14 -04001142 "src/ports/SkFontHost_FreeType_common.h",
mtklein3cc22182016-08-29 13:26:14 -07001143 ]
1144}
1145
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001146optional("webp_decode") {
1147 enabled = skia_use_libwebp_decode
1148 public_defines = [ "SK_CODEC_DECODES_WEBP" ]
mtklein457b42a2016-08-23 13:56:37 -07001149
Mike Kleina01c6b02020-04-01 13:47:34 -05001150 deps = [ "//third_party/libwebp" ]
1151 sources = [ "src/codec/SkWebpCodec.cpp" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001152}
1153
1154optional("webp_encode") {
1155 enabled = skia_use_libwebp_encode
1156 public_defines = [ "SK_ENCODE_WEBP" ]
1157
Mike Kleina01c6b02020-04-01 13:47:34 -05001158 deps = [ "//third_party/libwebp" ]
1159 sources = [ "src/images/SkWebpEncoder.cpp" ]
mtkleineb3c4252016-08-23 07:38:09 -07001160}
1161
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001162optional("wuffs") {
1163 enabled = skia_use_wuffs
Nigel Tao5cfa7192020-08-17 21:14:13 +10001164 public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001165
Mike Kleina01c6b02020-04-01 13:47:34 -05001166 deps = [ "//third_party/wuffs" ]
1167 sources = [ "src/codec/SkWuffsCodec.cpp" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001168}
1169
mtklein63213812016-08-24 09:55:56 -07001170optional("xml") {
1171 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +00001172 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -07001173
Mike Kleina01c6b02020-04-01 13:47:34 -05001174 deps = [ "//third_party/expat" ]
mtklein63213812016-08-24 09:55:56 -07001175 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -05001176 "src/svg/SkSVGCanvas.cpp",
1177 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -07001178 "src/xml/SkDOM.cpp",
1179 "src/xml/SkXMLParser.cpp",
1180 "src/xml/SkXMLWriter.cpp",
1181 ]
1182}
1183
Mike Klein613ad382019-06-06 11:42:02 -05001184optional("skvm_jit") {
Mike Klein13ec5442020-08-14 07:36:54 -05001185 enabled = skia_enable_skvm_jit_when_possible
1186 public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ]
Mike Klein2b54e832020-07-10 12:56:07 -05001187 if (skia_vtune_path != "") {
1188 public_defines += [ "SKVM_JIT_VTUNE" ]
1189 public_include_dirs = [ "$skia_vtune_path/include" ]
1190 libs = [ "$skia_vtune_path/lib64/jitprofiling.lib" ]
1191 }
Mike Klein613ad382019-06-06 11:42:02 -05001192}
1193
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001194if (skia_enable_gpu && skia_generate_workarounds) {
1195 action("workaround_list") {
1196 script = "tools/build_workaround_header.py"
1197
Mike Kleina01c6b02020-04-01 13:47:34 -05001198 inputs = [ "src/gpu/gpu_workaround_list.txt" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001199
1200 # see comments in skia_compile_processors about out dir path shenanigans.
1201 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -07001202 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001203
Mike Kleina01c6b02020-04-01 13:47:34 -05001204 outputs = [ "$root_out_dir/$output_file" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001205 args = [
1206 "--output-file",
1207 "$output_file",
1208 ]
1209
1210 foreach(file, inputs) {
1211 args += [ rebase_path(file, root_build_dir) ]
1212 }
1213 }
1214}
1215
mtkleinc04ff472016-06-23 10:29:30 -07001216component("skia") {
1217 public_configs = [ ":skia_public" ]
1218 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -07001219
Mike Klein607b0a72018-11-07 16:17:34 -05001220 public_deps = [
Ben Wagner32d5cfa2020-06-11 14:41:47 -04001221 ":fontmgr_FontConfigInterface",
1222 ":fontmgr_android",
1223 ":fontmgr_custom_directory",
1224 ":fontmgr_custom_embedded",
1225 ":fontmgr_custom_empty",
1226 ":fontmgr_fontconfig",
1227 ":fontmgr_fuchsia",
1228 ":fontmgr_mac_ct",
1229 ":fontmgr_win",
1230 ":fontmgr_win_gdi",
Ben Wagnere27ee6c2019-02-15 14:59:30 -05001231 ":gpu",
Mike Klein607b0a72018-11-07 16:17:34 -05001232 ":pdf",
1233 ":skcms",
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001234 ":xps",
Mike Klein607b0a72018-11-07 16:17:34 -05001235 ]
1236
mtkleinc04ff472016-06-23 10:29:30 -07001237 deps = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001238 ":android_utils",
anmittalb8b3f712016-08-25 04:55:19 -07001239 ":arm64",
1240 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -07001241 ":avx",
Mike Klein54378232018-11-08 12:08:05 +00001242 ":compile_processors",
anmittalb8b3f712016-08-25 04:55:19 -07001243 ":crc32",
Ethan Nicholasc18bb512020-07-28 14:46:53 -04001244 ":dehydrate_sksl",
Ben Wagner75626e42020-06-03 13:20:37 -04001245 ":fontmgr_factory",
Leon Scroggins III41169202019-01-29 09:29:57 -05001246 ":gif",
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001247 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -05001248 ":hsw",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001249 ":jpeg_decode",
1250 ":jpeg_encode",
Leon Scroggins III326b9892020-08-05 16:51:10 -04001251 ":ndk_images",
mtklein9b8583d2016-08-24 17:32:30 -07001252 ":none",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001253 ":png_decode",
1254 ":png_encode",
scroggof84ad642016-10-31 09:02:57 -07001255 ":raw",
Mike Klein613ad382019-06-06 11:42:02 -05001256 ":skvm_jit",
Mike Kleina9026da2020-06-05 08:57:05 -05001257 ":skx",
mtklein9b8583d2016-08-24 17:32:30 -07001258 ":sse2",
1259 ":sse41",
1260 ":sse42",
1261 ":ssse3",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001262 ":webp_decode",
1263 ":webp_encode",
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001264 ":wuffs",
mtklein63213812016-08-24 09:55:56 -07001265 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -07001266 ]
1267
Hal Canaryc25f4e92019-02-26 11:54:25 -05001268 public = skia_core_public
1269 public += skia_utils_public
1270 public += skia_effects_public
1271 public += skia_effects_imagefilter_public
Hal Canaryc25f4e92019-02-26 11:54:25 -05001272
mtkleinc04ff472016-06-23 10:29:30 -07001273 sources = []
brettwb9447282016-09-01 14:24:39 -07001274 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -07001275 sources += skia_utils_sources
Mike Klein54378232018-11-08 12:08:05 +00001276 sources += skia_effects_sources
1277 sources += skia_effects_imagefilter_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001278 sources += skia_sksl_sources
mtkleinc04ff472016-06-23 10:29:30 -07001279 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -04001280 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -05001281 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001282 "src/codec/SkAndroidCodec.cpp",
Nigel Tao612a65d2018-11-09 10:10:31 +11001283 "src/codec/SkAndroidCodecAdapter.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -04001284 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001285 "src/codec/SkBmpCodec.cpp",
1286 "src/codec/SkBmpMaskCodec.cpp",
1287 "src/codec/SkBmpRLECodec.cpp",
1288 "src/codec/SkBmpStandardCodec.cpp",
1289 "src/codec/SkCodec.cpp",
1290 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -04001291 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -04001292 "src/codec/SkEncodedInfo.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001293 "src/codec/SkMaskSwizzler.cpp",
1294 "src/codec/SkMasks.cpp",
Leon Scroggins IIIba458302019-09-24 12:40:11 -04001295 "src/codec/SkParseEncodedOrigin.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001296 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001297 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -07001298 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001299 "src/codec/SkSwizzler.cpp",
1300 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001301 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001302 "src/ports/SkDiscardableMemory_none.cpp",
Mike Klein54378232018-11-08 12:08:05 +00001303 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001304 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001305 "src/ports/SkMemory_malloc.cpp",
1306 "src/ports/SkOSFile_stdio.cpp",
1307 "src/sfnt/SkOTTable_name.cpp",
1308 "src/sfnt/SkOTUtils.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001309 ]
brettwb9447282016-09-01 14:24:39 -07001310
Leon Scroggins1340dbd2020-11-09 14:18:12 -05001311 defines = [ "SK_HAS_ANDROID_CODEC" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001312 libs = []
1313
mtkleinc04ff472016-06-23 10:29:30 -07001314 if (is_win) {
1315 sources += [
1316 "src/ports/SkDebug_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001317 "src/ports/SkImageEncoder_WIC.cpp",
1318 "src/ports/SkImageGeneratorWIC.cpp",
1319 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -07001320 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001321 ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001322 libs += [
Mike Klein4b167fc2016-10-11 18:13:53 -04001323 "Ole32.lib",
1324 "OleAut32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -04001325 ]
James Clarkeb8c0dab2021-02-09 06:22:41 -08001326
1327 if (!skia_enable_winuwp) {
1328 libs += [
1329 "FontSub.lib",
1330 "User32.lib",
1331 "Usp10.lib",
1332 ]
1333 }
mtkleinc04ff472016-06-23 10:29:30 -07001334 } else {
1335 sources += [
mtkleinc04ff472016-06-23 10:29:30 -07001336 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -07001337 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001338 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -04001339 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -07001340 }
1341
mtklein7d6fb2c2016-08-25 14:50:44 -07001342 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -05001343 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -05001344 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -05001345 deps += [ "//third_party/cpu-features" ]
1346 }
mtklein06c35c02016-09-20 12:28:12 -07001347 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001348 libs += [
1349 "EGL",
1350 "GLESv2",
1351 "log",
1352 ]
1353 }
1354
Kevin Lubick217056c2018-09-20 17:39:31 -04001355 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -07001356 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001357 if (skia_use_egl) {
1358 libs += [ "GLESv2" ]
1359 }
mtkleinc04ff472016-06-23 10:29:30 -07001360 }
1361
1362 if (is_mac) {
1363 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001364 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001365 "src/ports/SkImageEncoder_CG.cpp",
1366 "src/ports/SkImageGeneratorCG.cpp",
1367 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001368 frameworks = [
mtklein09e61f72016-08-23 13:35:28 -07001369 "ApplicationServices.framework",
1370 "OpenGL.framework",
1371 ]
mtkleinc04ff472016-06-23 10:29:30 -07001372 }
abarth6fc8ff02016-07-15 15:15:15 -07001373
Mike Klein7d302882016-11-03 14:06:31 -04001374 if (is_ios) {
1375 sources += [
1376 "src/ports/SkDebug_stdio.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001377 "src/ports/SkImageEncoder_CG.cpp",
1378 "src/ports/SkImageGeneratorCG.cpp",
1379 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001380 frameworks = [
Mike Klein7d302882016-11-03 14:06:31 -04001381 "CoreFoundation.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001382 "ImageIO.framework",
1383 "MobileCoreServices.framework",
1384 ]
1385 }
1386
abarth6fc8ff02016-07-15 15:15:15 -07001387 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001388 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001389 }
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001390
1391 if (skia_enable_spirv_validation) {
Stephen White238fc242019-08-26 10:19:23 -04001392 deps += [ "//third_party/spirv-tools:spvtools_val" ]
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001393 defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
1394 }
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -04001395
1396 if (skia_include_multiframe_procs) {
1397 sources += [ "tools/SkSharingProc.cpp" ]
1398 }
mtkleinc04ff472016-06-23 10:29:30 -07001399}
1400
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001401# DebugCanvas used in experimental/wasm-skp-debugger
1402if (target_cpu == "wasm") {
1403 static_library("debugcanvas") {
1404 public_configs = [ ":skia_public" ]
1405
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001406 sources = [
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001407 "tools/SkSharingProc.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001408 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001409 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001410 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001411 "tools/debugger/DrawCommand.cpp",
1412 "tools/debugger/JsonWriteBuffer.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001413 ]
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001414 }
1415}
1416
Kevin Lubickcbcff382018-10-02 09:02:18 -04001417static_library("pathkit") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001418 check_includes = false
Kevin Lubickcbcff382018-10-02 09:02:18 -04001419 public_configs = [ ":skia_public" ]
1420 configs += skia_library_configs
1421
1422 deps = [
1423 ":arm64",
1424 ":armv7",
1425 ":avx",
1426 ":crc32",
1427 ":hsw",
1428 ":none",
1429 ":sse2",
1430 ":sse41",
1431 ":sse42",
1432 ":ssse3",
1433 ]
1434
Kevin Lubickcbcff382018-10-02 09:02:18 -04001435 sources = []
1436 sources += skia_pathops_sources
Hal Canaryc25f4e92019-02-26 11:54:25 -05001437 sources += skia_pathops_public
Kevin Lubickcbcff382018-10-02 09:02:18 -04001438 sources += [
1439 "src/core/SkAnalyticEdge.cpp",
1440 "src/core/SkArenaAlloc.cpp",
Mike Reedcc88f3a2019-02-06 11:40:27 -05001441 "src/core/SkContourMeasure.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001442 "src/core/SkCubicMap.cpp",
1443 "src/core/SkEdge.cpp",
1444 "src/core/SkEdgeBuilder.cpp",
1445 "src/core/SkEdgeClipper.cpp",
1446 "src/core/SkGeometry.cpp",
Brian Salomon71fe9452020-03-02 16:59:40 -05001447 "src/core/SkIDChangeListener.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001448 "src/core/SkLineClipper.cpp",
Hal Canary7823aeb2019-10-30 17:26:45 -04001449 "src/core/SkMalloc.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001450 "src/core/SkMallocPixelRef.cpp",
1451 "src/core/SkMath.cpp",
1452 "src/core/SkMatrix.cpp",
1453 "src/core/SkOpts.cpp",
1454 "src/core/SkPaint.cpp",
1455 "src/core/SkPath.cpp",
Mike Reed06d7c9d2020-08-26 12:56:51 -04001456 "src/core/SkPathBuilder.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001457 "src/core/SkPathEffect.cpp",
1458 "src/core/SkPathMeasure.cpp",
1459 "src/core/SkPathRef.cpp",
1460 "src/core/SkPoint.cpp",
1461 "src/core/SkRRect.cpp",
Mike Klein45f36b52020-06-08 14:10:29 -05001462 "src/core/SkReadBuffer.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001463 "src/core/SkRect.cpp",
1464 "src/core/SkSemaphore.cpp",
1465 "src/core/SkStream.cpp",
1466 "src/core/SkString.cpp",
1467 "src/core/SkStringUtils.cpp",
1468 "src/core/SkStroke.cpp",
1469 "src/core/SkStrokeRec.cpp",
1470 "src/core/SkStrokerPriv.cpp",
1471 "src/core/SkThreadID.cpp",
1472 "src/core/SkUtils.cpp",
1473 "src/effects/SkDashPathEffect.cpp",
1474 "src/effects/SkTrimPathEffect.cpp",
1475 "src/ports/SkDebug_stdio.cpp",
1476 "src/ports/SkMemory_malloc.cpp",
1477 "src/utils/SkDashPath.cpp",
1478 "src/utils/SkParse.cpp",
1479 "src/utils/SkParsePath.cpp",
1480 "src/utils/SkUTF.cpp",
1481 ]
1482}
1483
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001484group("modules") {
1485 deps = [
Kevin Lubick96634842019-03-05 14:09:24 -05001486 "modules/particles",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001487 "modules/skottie",
Mike Reed63559a52020-06-02 11:34:24 -04001488 "modules/skparagraph",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001489 "modules/skshaper",
1490 ]
1491}
1492
Brian Osmancd28fa62020-07-07 16:01:26 -04001493config("our_vulkan_headers") {
1494 include_dirs = [ "include/third_party/vulkan" ]
1495}
1496
mtkleinc095df52016-08-24 12:23:52 -07001497# Targets guarded by skia_enable_tools may use //third_party freely.
1498if (skia_enable_tools) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001499 skia_public_includes = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001500 "client_utils/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001501 "include/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001502 "include/c",
1503 "include/codec",
1504 "include/config",
1505 "include/core",
1506 "include/docs",
1507 "include/effects",
1508 "include/encode",
1509 "include/gpu",
1510 "include/pathops",
1511 "include/ports",
1512 "include/svg",
1513 "include/utils",
1514 "include/utils/mac",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001515 "modules/particles/include",
1516 "modules/skottie/include",
Julia Lavrova70258c72020-07-15 11:28:57 -04001517 "modules/skparagraph/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001518 "modules/skshaper/include",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001519 "modules/svg/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001520 ]
1521
Mike Klein308b5ac2016-12-06 16:03:52 -05001522 # Used by gn_to_bp.py to list our public include dirs.
1523 source_set("public") {
1524 configs += [ ":skia_public" ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001525 include_dirs = skia_public_includes
Mike Klein308b5ac2016-12-06 16:03:52 -05001526 }
1527
Mike Kleinc36dedf2016-11-18 09:35:28 -05001528 config("skia.h_config") {
1529 include_dirs = [ "$target_gen_dir" ]
1530 }
1531 action("skia.h") {
1532 public_configs = [ ":skia.h_config" ]
1533 skia_h = "$target_gen_dir/skia.h"
1534 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001535
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001536 args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1537 [ rebase_path(skia_h, root_build_dir) ] +
1538 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001539 depfile = "$skia_h.deps"
Mike Kleina01c6b02020-04-01 13:47:34 -05001540 outputs = [ skia_h ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001541 }
1542
Brian Osmanc9a42472018-05-31 13:17:12 -04001543 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001544 executable("fiddle") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001545 check_includes = false
Mike Kleinc36dedf2016-11-18 09:35:28 -05001546 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001547 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001548 "tools/fiddle/draw.cpp",
1549 "tools/fiddle/fiddle_main.cpp",
1550 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001551
1552 if (skia_use_egl) {
1553 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001554 } else {
1555 sources += [ "tools/fiddle/null_context.cpp" ]
1556 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001557 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001558 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001559 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001560 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001561 ":skia",
1562 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001563 "modules/particles",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001564 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001565 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001566 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001567 "modules/svg",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001568 ]
1569 }
1570 }
1571
Mike Kleine5463e62020-06-11 13:53:53 -05001572 config("cpp14") {
1573 if (is_win) {
1574 cflags_cc = [ "/std:c++14" ]
1575 } else {
1576 cflags_cc = [ "-std=c++14" ]
1577 }
1578 }
1579
Brian Osmanc9a42472018-05-31 13:17:12 -04001580 source_set("public_headers_warnings_check") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001581 sources = [ "tools/public_headers_warnings_check.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001582 configs -= [ "//gn:warnings_except_public_headers" ]
Mike Kleine5463e62020-06-11 13:53:53 -05001583 configs += [
1584 ":our_vulkan_headers",
1585 ":cpp14",
1586 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001587 deps = [
1588 ":skia",
1589 ":skia.h",
1590 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001591 "modules/skshaper",
Brian Osmanc9a42472018-05-31 13:17:12 -04001592 ]
Stephen White0d70b712019-07-10 15:51:30 -04001593
1594 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001595 deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White0d70b712019-07-10 15:51:30 -04001596 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001597 }
1598
mtkleinc095df52016-08-24 12:23:52 -07001599 template("test_lib") {
1600 config(target_name + "_config") {
mtkleina627b5c2016-09-20 13:36:47 -07001601 if (defined(invoker.public_defines)) {
1602 defines = invoker.public_defines
1603 }
mtklein25c81d42016-07-27 13:55:26 -07001604 }
mtkleinc095df52016-08-24 12:23:52 -07001605 source_set(target_name) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001606 forward_variables_from(invoker, "*", [])
Hal Canaryc25f4e92019-02-26 11:54:25 -05001607 check_includes = false
mtkleinc095df52016-08-24 12:23:52 -07001608 public_configs = [
1609 ":" + target_name + "_config",
1610 ":skia_private",
1611 ]
1612
1613 if (!defined(deps)) {
1614 deps = []
1615 }
1616 deps += [ ":skia" ]
1617 testonly = true
1618 }
mtklein25c81d42016-07-27 13:55:26 -07001619 }
mtklein25c81d42016-07-27 13:55:26 -07001620
Mike Kleine6682eb2017-01-05 10:54:57 -05001621 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001622 if (is_ios) {
Hal Canary3388c1a2019-09-16 12:53:17 -04001623 ios_app_bundle(target_name) {
Jim Van Verth443a9132017-11-28 09:45:26 -05001624 forward_variables_from(invoker,
1625 "*",
1626 [
1627 "output_name",
1628 "visibility",
1629 "is_shared_library",
1630 ])
Mike Kleine6682eb2017-01-05 10:54:57 -05001631 testonly = true
Hal Canary3388c1a2019-09-16 12:53:17 -04001632 extra_configs = [ ":skia_private" ]
1633 launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard"
1634 data_sources = [ "resources" ]
1635 if ("True" == exec_script("//gn/checkdir.py",
1636 [ rebase_path("skps", root_build_dir) ],
1637 "trim string")) {
1638 data_sources += [ "skps" ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001639 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001640 }
1641 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001642 # !is_ios
1643
Jim Van Verth92411c72020-04-03 15:18:31 -04001644 output_dir = root_build_dir
Jim Van Verth443a9132017-11-28 09:45:26 -05001645 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1646 shared_library("lib" + target_name) {
1647 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1648 configs += [ ":skia_private" ]
1649 testonly = true
1650 }
1651 } else {
1652 _executable = target_name
1653 executable(_executable) {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001654 check_includes = false
Jim Van Verth443a9132017-11-28 09:45:26 -05001655 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1656 configs += [ ":skia_private" ]
1657 testonly = true
1658 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001659 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001660 if (is_android && skia_android_serial != "" && defined(_executable)) {
1661 action("push_" + target_name) {
1662 script = "gn/push_to_android.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05001663 deps = [ ":" + _executable ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001664 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
Mike Kleina01c6b02020-04-01 13:47:34 -05001665 outputs = [ _stamp ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001666 args = [
1667 rebase_path("$root_build_dir/$_executable"),
1668 skia_android_serial,
1669 rebase_path(_stamp),
1670 ]
1671 testonly = true
1672 }
Mike Klein7d921032017-01-05 12:20:41 -05001673 }
1674 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001675 }
1676
mtkleinc095df52016-08-24 12:23:52 -07001677 test_lib("gpu_tool_utils") {
Brian Osmanc9a42472018-05-31 13:17:12 -04001678 public_defines = []
mtkleind68f9b02016-09-23 13:18:41 -07001679
Mike Klein9e25bb92019-04-29 09:46:36 -05001680 # Bots and even devs may not have Vulkan headers, so put
1681 # include/third_party/vulkan on our path so they're always available.
1682 all_dependent_configs = [ ":our_vulkan_headers" ]
1683
Mike Klein333fb452019-04-24 08:48:11 -05001684 defines = []
1685 if (skia_enable_discrete_gpu) {
1686 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
1687 }
1688
Brian Osmanc9a42472018-05-31 13:17:12 -04001689 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001690 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001691 sources = [
Brian Salomon72c7b982020-10-06 10:07:38 -04001692 "tools/gpu/BackendSurfaceFactory.cpp",
1693 "tools/gpu/BackendSurfaceFactory.h",
Brian Salomon63a0a752020-06-26 13:32:09 -04001694 "tools/gpu/BackendTextureImageFactory.cpp",
1695 "tools/gpu/BackendTextureImageFactory.h",
Robert Phillips00f78de2020-07-01 16:09:43 -04001696 "tools/gpu/FlushFinishTracker.cpp",
1697 "tools/gpu/FlushFinishTracker.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001698 "tools/gpu/GrContextFactory.cpp",
1699 "tools/gpu/GrTest.cpp",
Brian Salomonf9b00422020-10-08 16:00:14 -04001700 "tools/gpu/ManagedBackendTexture.cpp",
1701 "tools/gpu/ManagedBackendTexture.h",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001702 "tools/gpu/MemoryCache.cpp",
1703 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001704 "tools/gpu/ProxyUtils.cpp",
1705 "tools/gpu/TestContext.cpp",
Brian Salomone21af502019-11-22 16:56:36 -05001706 "tools/gpu/TestOps.cpp",
1707 "tools/gpu/TestOps.h",
Michael Ludwigd9958f82019-03-21 13:08:36 -04001708 "tools/gpu/YUVUtils.cpp",
1709 "tools/gpu/YUVUtils.h",
Mike Kleina01c6b02020-04-01 13:47:34 -05001710 "tools/gpu/gl/GLTestContext.cpp", # See comment below about
1711 # GrContextFactory workaround.
Brian Osmanc9a42472018-05-31 13:17:12 -04001712 "tools/gpu/mock/MockTestContext.cpp",
1713 ]
Brian Salomon1171d312020-03-19 08:47:44 -04001714
1715 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001716 frameworks = []
Brian Salomon1171d312020-03-19 08:47:44 -04001717
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001718 if (skia_use_gl) {
Herb Derby64aa5132020-06-03 12:14:55 -04001719 sources +=
1720 [ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001721 if (is_ios) {
1722 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001723 frameworks += [ "OpenGLES.framework" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001724 } else if (is_mac) {
1725 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -05001726 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001727 if (skia_use_angle) {
1728 deps += [ "//third_party/angle2" ]
1729 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1730 }
Brian Salomon1171d312020-03-19 08:47:44 -04001731 }
1732
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001733 # We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in
1734 # in GrContextFactory. This only matters for OSes that can run Vulkan.
Chris Dalton2b598902020-03-25 10:50:35 -06001735 if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001736 if (is_android || skia_use_egl) {
1737 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1738 libs += [ "EGL" ]
1739 } else if (is_linux) {
1740 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
1741 libs += [
1742 "GLU",
1743 "GL",
1744 "X11",
1745 ]
1746 } else if (is_win) {
1747 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1748 libs += [ "Gdi32.lib" ]
1749 if (target_cpu != "arm64") {
1750 libs += [ "OpenGL32.lib" ]
1751 }
1752 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001753 }
Greg Daniel54200e42018-12-11 17:03:39 -05001754
Brian Osmanc9a42472018-05-31 13:17:12 -04001755 if (skia_use_vulkan) {
Robert Phillipsae413d82020-06-10 11:04:51 -04001756 sources += [ "tools/gpu/vk/VkTestContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001757 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Robert Phillips0d6ce7c2020-06-11 08:51:50 -04001758 sources += [ "tools/gpu/vk/VkTestHelper.h" ]
1759 sources += [ "tools/gpu/vk/VkTestHelper.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001760 sources += [ "tools/gpu/vk/VkTestUtils.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001761 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001762 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.h" ]
1763 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001764 }
1765 if (skia_use_metal) {
1766 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001767 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001768 if (skia_use_direct3d) {
1769 sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ]
Jim Van Verth03b8ab22020-02-24 11:36:15 -05001770 sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001771 }
Stephen White985741a2019-07-18 11:43:45 -04001772 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001773 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White985741a2019-07-18 11:43:45 -04001774 sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
Stephen White3ae5b292020-06-01 15:45:56 -04001775 if (is_clang) {
1776 cflags_cc = [ "-Wno-microsoft-cast" ]
1777 }
Stephen White985741a2019-07-18 11:43:45 -04001778 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001779
1780 if (is_fuchsia && using_fuchsia_sdk) {
1781 libs +=
1782 [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
1783 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001784 } # test_lib("gpu_tool_utils")
mtklein25c81d42016-07-27 13:55:26 -07001785
mtkleinc095df52016-08-24 12:23:52 -07001786 test_lib("flags") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001787 sources = [ "tools/flags/CommandLineFlags.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07001788 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001789
1790 test_lib("common_flags_config") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001791 sources = [ "tools/flags/CommonFlagsConfig.cpp" ]
1792 deps = [ ":flags" ]
1793 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001794 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001795 test_lib("common_flags_gpu") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001796 sources = [ "tools/flags/CommonFlagsGpu.cpp" ]
1797 deps = [ ":flags" ]
1798 public_deps = [ ":gpu_tool_utils" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001799 }
1800 test_lib("common_flags_images") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001801 sources = [ "tools/flags/CommonFlagsImages.cpp" ]
1802 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001803 }
1804 test_lib("common_flags_aa") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001805 sources = [ "tools/flags/CommonFlagsAA.cpp" ]
1806 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001807 }
mtklein25c81d42016-07-27 13:55:26 -07001808
Mike Klein499f0ac2019-03-25 13:00:12 -05001809 test_lib("trace") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001810 deps = [ ":flags" ]
Mike Klein499f0ac2019-03-25 13:00:12 -05001811 sources = [
1812 "tools/trace/ChromeTracingTracer.cpp",
1813 "tools/trace/ChromeTracingTracer.h",
1814 "tools/trace/EventTracingPriv.cpp",
1815 "tools/trace/EventTracingPriv.h",
1816 "tools/trace/SkDebugfTracer.cpp",
1817 "tools/trace/SkDebugfTracer.h",
1818 ]
1819 }
1820
mtkleinc095df52016-08-24 12:23:52 -07001821 test_lib("tool_utils") {
mtkleinc095df52016-08-24 12:23:52 -07001822 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001823 "tools/AndroidSkDebugToStdOut.cpp",
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001824 "tools/AutoreleasePool.h",
Robert Phillips96601082018-05-29 16:13:26 -04001825 "tools/DDLPromiseImageHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001826 "tools/DDLPromiseImageHelper.h",
Robert Phillips96601082018-05-29 16:13:26 -04001827 "tools/DDLTileHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001828 "tools/DDLTileHelper.h",
mtklein0590fa52016-09-01 07:06:54 -07001829 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001830 "tools/ProcStats.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001831 "tools/ProcStats.h",
mtkleinc095df52016-08-24 12:23:52 -07001832 "tools/Resources.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001833 "tools/Resources.h",
Hal Canarye574f1e2019-07-15 14:01:37 -04001834 "tools/SkMetaData.cpp",
1835 "tools/SkMetaData.h",
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001836 "tools/SkSharingProc.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001837 "tools/SkSharingProc.h",
1838 "tools/Stats.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001839 "tools/ToolUtils.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001840 "tools/ToolUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001841 "tools/UrlDataManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001842 "tools/UrlDataManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001843 "tools/debugger/DebugCanvas.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001844 "tools/debugger/DebugCanvas.h",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001845 "tools/debugger/DebugLayerManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001846 "tools/debugger/DebugLayerManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001847 "tools/debugger/DrawCommand.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001848 "tools/debugger/DrawCommand.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001849 "tools/debugger/JsonWriteBuffer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001850 "tools/debugger/JsonWriteBuffer.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001851 "tools/fonts/RandomScalerContext.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001852 "tools/fonts/RandomScalerContext.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001853 "tools/fonts/TestEmptyTypeface.h",
1854 "tools/fonts/TestFontMgr.cpp",
1855 "tools/fonts/TestFontMgr.h",
1856 "tools/fonts/TestSVGTypeface.cpp",
1857 "tools/fonts/TestSVGTypeface.h",
1858 "tools/fonts/TestTypeface.cpp",
1859 "tools/fonts/TestTypeface.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001860 "tools/fonts/ToolUtilsFont.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001861 "tools/random_parse_path.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001862 "tools/random_parse_path.h",
Hal Canary41248072019-07-11 16:32:53 -04001863 "tools/timer/TimeUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001864 "tools/timer/Timer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001865 "tools/timer/Timer.h",
mtkleinc095df52016-08-24 12:23:52 -07001866 ]
Chris Dalton2b598902020-03-25 10:50:35 -06001867 if (target_cpu != "wasm") {
1868 sources += [ "tools/CrashHandler.cpp" ]
1869 }
Mike Kleinadacaef2017-02-06 09:26:14 -05001870 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001871 frameworks = []
Mike Kleinadacaef2017-02-06 09:26:14 -05001872 if (is_ios) {
1873 sources += [ "tools/ios_utils.m" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001874 sources += [ "tools/ios_utils.h" ]
1875 if (skia_use_metal) {
1876 sources += [ "tools/AutoreleasePool.mm" ]
1877 }
Jim Van Verthef820be2020-08-12 10:45:00 -04001878 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001879 } else if (is_mac) {
1880 if (skia_use_metal) {
1881 sources += [ "tools/AutoreleasePool.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001882 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001883 }
James Clarkeb8c0dab2021-02-09 06:22:41 -08001884 } else if (is_win && !skia_enable_winuwp) {
Mike Kleinbf15b662019-04-15 11:32:16 -05001885 libs += [ "DbgHelp.lib" ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001886 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001887
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001888 defines = []
1889 if (skia_tools_require_resources) {
1890 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1891 }
mtkleinc095df52016-08-24 12:23:52 -07001892 deps = [
1893 ":flags",
Florin Malitab3418102020-10-15 18:10:29 -04001894 "modules/svg",
Mike Kleine4ad58a2019-03-26 09:05:52 -05001895 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05001896 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001897 }
mtklein25c81d42016-07-27 13:55:26 -07001898
Mike Kleine11e5c12019-04-24 12:46:06 -05001899 test_lib("etc1") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001900 sources = [ "third_party/etc1/etc1.cpp" ]
Mike Kleine11e5c12019-04-24 12:46:06 -05001901 }
1902
Mike Klein6e744122016-10-27 12:21:40 -04001903 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001904 test_lib("gm") {
mtkleinc095df52016-08-24 12:23:52 -07001905 sources = gm_sources
John Rosasco24cbdab2019-09-25 14:14:35 -07001906 if (skia_use_gl) {
1907 sources += gl_gm_sources
1908 }
mtkleinc095df52016-08-24 12:23:52 -07001909 deps = [
Mike Kleine11e5c12019-04-24 12:46:06 -05001910 ":etc1",
scroggo19b91532016-10-24 09:03:26 -07001911 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001912 ":skia",
1913 ":tool_utils",
Brian Osman84d884a2021-01-29 16:35:45 -05001914 "modules/particles",
Mike Reed2f0edd52018-05-31 14:22:30 -04001915 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001916 "modules/skottie:gm",
Mike Reed63559a52020-06-02 11:34:24 -04001917 "modules/skparagraph",
1918 "modules/skparagraph:gm",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001919 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001920 ]
Mike Kleinc4abade2019-08-09 10:11:35 -04001921 if (is_skia_dev_build) {
1922 sources += [ "gm/fiddle.cpp" ]
1923 deps += [ ":skia.h" ]
1924 }
Mike Kleina01c6b02020-04-01 13:47:34 -05001925 public_deps = [ ":gpu_tool_utils" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001926
1927 if (skia_use_ffmpeg) {
Florin Malita123e3b82020-04-24 11:10:27 -04001928 deps += [ "experimental/ffmpeg:video_decoder" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001929 sources += [ "gm/video_decoder.cpp" ]
1930 }
mtkleinc095df52016-08-24 12:23:52 -07001931 }
mtklein25c81d42016-07-27 13:55:26 -07001932
Ben Wagnerbded42a2021-02-17 22:14:34 -05001933 test_lib("test") {
1934 sources = [
1935 "tests/Test.cpp",
1936 "tests/Test.h",
1937 "tests/TestUtils.cpp",
1938 "tests/TestUtils.h",
1939 ]
1940 deps = [
1941 ":flags",
1942 ":skia",
1943 ":tool_utils",
1944 ]
1945 public_deps = [
1946 ":gpu_tool_utils", # Test.h #includes headers from this target.
1947 ]
1948 }
1949
Mike Klein6e744122016-10-27 12:21:40 -04001950 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001951 test_lib("tests") {
Mike Klein6e744122016-10-27 12:21:40 -04001952 sources = tests_sources + pathops_tests_sources
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001953 frameworks = []
Robert Phillips0c6daf02019-05-16 12:43:11 -04001954 if (skia_use_metal) {
1955 sources += metal_tests_sources
Jim Van Verth36b86af2020-08-24 17:16:46 +00001956 cflags_objcc = [ "-fobjc-arc" ]
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001957 frameworks += [ "MetalKit.framework" ]
Robert Phillips0c6daf02019-05-16 12:43:11 -04001958 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001959 if (skia_use_gl) {
1960 sources += gl_tests_sources
1961 }
mtkleinc095df52016-08-24 12:23:52 -07001962 deps = [
1963 ":flags",
Ben Wagnere75021e2021-02-17 22:18:34 -05001964 ":fontmgr_android_tests",
1965 ":fontmgr_fontconfig_tests",
Ben Wagnera3e5e552021-02-22 15:37:33 +00001966 ":fontmgr_mac_ct_tests",
mtkleinc095df52016-08-24 12:23:52 -07001967 ":skia",
Ben Wagnerbded42a2021-02-17 22:14:34 -05001968 ":test",
mtkleinc095df52016-08-24 12:23:52 -07001969 ":tool_utils",
Florin Malita26ae40f2020-06-08 12:03:48 -04001970 "experimental/skrive:tests",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001971 "modules/skottie:tests",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001972 "modules/skparagraph:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001973 "modules/sksg:tests",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001974 "modules/skshaper",
Florin Malitadec78022020-12-17 16:36:54 -05001975 "modules/svg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001976 "//third_party/libpng",
Leon Scroggins III194580d2019-02-22 12:32:16 -05001977 "//third_party/libwebp",
mtkleinc095df52016-08-24 12:23:52 -07001978 "//third_party/zlib",
1979 ]
1980 }
mtklein2f3416d2016-08-02 16:02:05 -07001981
Mike Klein6e744122016-10-27 12:21:40 -04001982 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001983 test_lib("bench") {
mtkleinc095df52016-08-24 12:23:52 -07001984 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001985 deps = [
1986 ":flags",
1987 ":gm",
1988 ":gpu_tool_utils",
1989 ":skia",
1990 ":tool_utils",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001991 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04001992 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001993 ]
1994 }
mtklein2b6870c2016-07-28 14:17:33 -07001995
Mike Reedd62d4062019-06-12 10:20:44 -04001996 test_lib("experimental_xform") {
1997 sources = [
1998 "experimental/xform/SkShape.cpp",
1999 "experimental/xform/SkXform.cpp",
2000 "experimental/xform/XContext.cpp",
2001 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05002002 deps = [ ":skia" ]
Mike Reedd62d4062019-06-12 10:20:44 -04002003 }
2004
Florin Malitabfe876a2018-09-02 12:33:59 -04002005 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04002006 test_app("skottie_tool") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002007 deps = [ "modules/skottie:tool" ]
Florin Malita79725d32018-06-05 16:16:57 -04002008 }
Florin Malitab3418102020-10-15 18:10:29 -04002009 test_app("svg_tool") {
2010 deps = [ "modules/svg:tool" ]
2011 }
Florin Malita79725d32018-06-05 16:16:57 -04002012 }
2013
Hal Canary5b39dc82019-04-17 13:29:46 -04002014 test_app("make_skqp_model") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002015 sources = [ "tools/skqp/make_skqp_model.cpp" ]
2016 deps = [ ":skia" ]
Hal Canary5b39dc82019-04-17 13:29:46 -04002017 }
2018
Chris Dalton2b598902020-03-25 10:50:35 -06002019 import("gn/samples.gni")
2020 test_lib("samples") {
2021 sources = samples_sources
2022 if (skia_enable_ccpr) {
2023 sources += samples_sources_ccpr
Kevin Lubickebf648e2017-09-21 13:45:16 -04002024 }
Mike Kleina01c6b02020-04-01 13:47:34 -05002025 public_deps = [ ":tool_utils" ]
Chris Dalton2b598902020-03-25 10:50:35 -06002026 deps = [
Chris Dalton2b598902020-03-25 10:50:35 -06002027 ":flags",
2028 ":gpu_tool_utils",
2029 ":xml",
Jorge Betancourtb8621312020-09-10 15:16:35 -04002030 "modules/audioplayer",
Chris Dalton2b598902020-03-25 10:50:35 -06002031 "modules/skparagraph:samples",
2032 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002033 "modules/svg",
Tyler Denniston189ecd42020-10-22 15:40:49 -04002034 "//third_party/imgui",
Chris Dalton2b598902020-03-25 10:50:35 -06002035 ]
Chris Dalton2b598902020-03-25 10:50:35 -06002036 }
Kevin Lubick00398742020-10-08 10:05:07 -04002037 test_lib("hash_and_encode") {
2038 sources = [
2039 "tools/HashAndEncode.cpp",
2040 "tools/HashAndEncode.h",
2041 ]
2042 deps = [
2043 ":flags",
2044 ":skia",
2045 "//third_party/libpng",
2046 ]
2047 }
Chris Dalton2b598902020-03-25 10:50:35 -06002048 if (target_cpu != "wasm") {
Nigel Tao3ab9b1f2020-05-28 13:29:13 +10002049 test_app("convert-to-nia") {
2050 sources = [ "tools/convert-to-nia.cpp" ]
2051 deps = [ ":skia" ]
2052 }
Mike Klein7af351a2018-07-27 09:54:43 -04002053 test_app("imgcvt") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002054 sources = [ "tools/imgcvt.cpp" ]
Mike Klein7af351a2018-07-27 09:54:43 -04002055 deps = [
2056 ":skcms",
2057 ":skia",
2058 ]
2059 }
Mike Klein735c7ba2019-03-25 12:57:58 -05002060 test_app("fm") {
2061 sources = [
Mike Kleinfee00792019-11-21 16:18:47 -06002062 "dm/DMGpuTestProcs.cpp", # blech
Mike Klein735c7ba2019-03-25 12:57:58 -05002063 "tools/fm/fm.cpp",
2064 ]
2065 deps = [
2066 ":common_flags_aa",
2067 ":common_flags_gpu",
2068 ":flags",
2069 ":gm",
2070 ":gpu_tool_utils",
2071 ":hash_and_encode",
2072 ":skia",
Mike Kleinfee00792019-11-21 16:18:47 -06002073 ":tests",
Mike Klein735c7ba2019-03-25 12:57:58 -05002074 ":tool_utils",
2075 ":trace",
Mike Klein22924262019-04-02 14:14:56 -04002076 "modules/skottie",
2077 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002078 "modules/svg",
Mike Klein735c7ba2019-03-25 12:57:58 -05002079 ]
2080 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04002081 test_app("dm") {
2082 sources = [
2083 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04002084 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002085 "dm/DMJsonWriter.cpp",
2086 "dm/DMSrcSink.cpp",
2087 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04002088 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002089 ":common_flags_aa",
2090 ":common_flags_config",
2091 ":common_flags_gpu",
2092 ":common_flags_images",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002093 ":flags",
2094 ":gm",
2095 ":gpu_tool_utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05002096 ":hash_and_encode",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002097 ":skia",
2098 ":tests",
2099 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002100 ":trace",
Florin Malita02616ea2020-06-25 13:33:17 -04002101 "experimental/skrive",
Florin Malita3d856bd2018-05-26 09:49:28 -04002102 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05002103 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002104 "modules/svg",
Mike Klein38af9432016-11-11 11:39:44 -05002105 ]
2106 }
Robert Phillipscd1e3972021-02-22 17:24:22 -05002107 test_app("ddlbench") {
2108 sources = [ "experimental/ddlbench/ddlbench.cpp" ]
2109 deps = [
2110 ":flags",
2111 ":skia",
2112 ":tool_utils",
2113 ]
2114 }
Michael Ludwig30217952020-12-04 12:58:35 -05002115
2116 # optional separate library to dlopen when running CanvasStateTests.
2117 shared_library("canvas_state_lib") {
2118 sources = [
2119 "tests/CanvasStateHelpers.cpp",
2120 "tests/CanvasStateHelpers.h",
2121 ]
2122 deps = [ ":skia" ]
2123 }
Brian Osman16adfa32016-10-18 14:42:44 -04002124 }
2125
Mike Kleina8a51ce2018-01-09 12:34:11 -05002126 if (!is_win) {
2127 test_app("remote_demo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002128 sources = [ "tools/remote_demo.cpp" ]
2129 deps = [ ":skia" ]
Mike Kleina8a51ce2018-01-09 12:34:11 -05002130 }
2131 }
2132
Hal Canarye107faa2019-10-23 12:52:33 -04002133 if (!is_win) {
2134 test_app("blob_cache_sim") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002135 sources = [ "tools/blob_cache_sim.cpp" ]
2136 deps = [ ":skia" ]
Hal Canarye107faa2019-10-23 12:52:33 -04002137 }
2138 }
2139
Mike Kleine6682eb2017-01-05 10:54:57 -05002140 test_app("nanobench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002141 sources = [ "bench/nanobench.cpp" ]
mtklein2b6870c2016-07-28 14:17:33 -07002142 deps = [
2143 ":bench",
Mike Kleinc6142d82019-03-25 10:54:59 -05002144 ":common_flags_aa",
2145 ":common_flags_config",
2146 ":common_flags_gpu",
2147 ":common_flags_images",
mtklein2b6870c2016-07-28 14:17:33 -07002148 ":flags",
2149 ":gm",
2150 ":gpu_tool_utils",
2151 ":skia",
2152 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002153 ":trace",
Mike Reed63559a52020-06-02 11:34:24 -04002154 "modules/skparagraph",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002155 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002156 "modules/svg",
mtklein2b6870c2016-07-28 14:17:33 -07002157 ]
mtklein2b6870c2016-07-28 14:17:33 -07002158 }
halcanary19a97202016-08-03 15:08:04 -07002159
Ravi Mistry10d36c52017-01-31 09:49:18 -05002160 test_app("skpinfo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002161 sources = [ "tools/skpinfo.cpp" ]
Ravi Mistry10d36c52017-01-31 09:49:18 -05002162 deps = [
2163 ":flags",
2164 ":skia",
2165 ]
2166 }
2167
Mike Reedc0ee21f2019-05-28 16:11:03 -04002168 if (skia_use_ffmpeg) {
2169 test_app("skottie2movie") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002170 sources = [ "tools/skottie2movie.cpp" ]
Mike Reedc0ee21f2019-05-28 16:11:03 -04002171 deps = [
2172 ":flags",
Mike Reed5f12eaa2019-09-24 12:01:58 -04002173 ":gpu_tool_utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002174 ":skia",
Florin Malitaec403602020-04-24 12:14:03 -04002175 "experimental/ffmpeg:video_encoder",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002176 "modules/skottie",
Mike Reed5093e232019-05-30 10:10:50 -04002177 "modules/skottie:utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002178 ]
2179 }
2180 }
2181
Brian Osmanc9a42472018-05-31 13:17:12 -04002182 test_app("skpbench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002183 sources = [ "tools/skpbench/skpbench.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002184 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002185 ":common_flags_config",
2186 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002187 ":flags",
2188 ":gpu_tool_utils",
2189 ":skia",
2190 ":tool_utils",
2191 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07002192 }
2193
Mike Kleine6682eb2017-01-05 10:54:57 -05002194 test_app("sktexttopdf") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002195 sources = [ "tools/using_skia_and_harfbuzz.cpp" ]
halcanary3eee9d92016-09-10 07:01:53 -07002196 deps = [
2197 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04002198 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07002199 ]
halcanary3eee9d92016-09-10 07:01:53 -07002200 }
mtklein046cb562016-09-16 10:23:12 -07002201
Ben Wagner219f3622017-07-17 15:32:25 -04002202 test_app("create_test_font") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002203 sources = [ "tools/fonts/create_test_font.cpp" ]
2204 deps = [ ":skia" ]
Ben Wagner219f3622017-07-17 15:32:25 -04002205 assert_no_deps = [
2206 # tool_utils requires the output of this app.
2207 ":tool_utils",
2208 ]
2209 }
2210
Florin Malita5d3ff432018-07-31 16:38:43 -04002211 if (skia_use_expat) {
2212 test_app("create_test_font_color") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002213 sources = [ "tools/fonts/create_test_font_color.cpp" ]
Florin Malita5d3ff432018-07-31 16:38:43 -04002214 deps = [
2215 ":flags",
2216 ":skia",
2217 ":tool_utils",
2218 ]
2219 }
Ben Wagner97182cc2018-02-15 10:20:04 -05002220 }
2221
Mike Kleine6682eb2017-01-05 10:54:57 -05002222 test_app("get_images_from_skps") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002223 sources = [ "tools/get_images_from_skps.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07002224 deps = [
2225 ":flags",
2226 ":skia",
mtklein046cb562016-09-16 10:23:12 -07002227 ]
mtklein046cb562016-09-16 10:23:12 -07002228 }
mtkleinecbc5262016-09-22 11:51:24 -07002229
Brian Osman6788a542018-12-10 11:56:01 -05002230 if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
Mike Kleine6682eb2017-01-05 10:54:57 -05002231 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04002232 sources = [
2233 "tools/skiaserve/Request.cpp",
2234 "tools/skiaserve/Response.cpp",
2235 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002236 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
2237 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
2238 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
2239 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
2240 "tools/skiaserve/urlhandlers/DataHandler.cpp",
2241 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
2242 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
2243 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
2244 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05002245 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
2246 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002247 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
2248 "tools/skiaserve/urlhandlers/PostHandler.cpp",
2249 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
2250 "tools/skiaserve/urlhandlers/RootHandler.cpp",
2251 ]
2252 deps = [
2253 ":flags",
2254 ":gpu_tool_utils",
2255 ":skia",
2256 ":tool_utils",
Mike Klein7d302882016-11-03 14:06:31 -04002257 "//third_party/libmicrohttpd",
Mike Klein7d302882016-11-03 14:06:31 -04002258 ]
Mike Klein7d302882016-11-03 14:06:31 -04002259 }
mtkleinecbc5262016-09-22 11:51:24 -07002260 }
kjlubick14f984b2016-10-03 11:49:45 -07002261
Mike Kleine6682eb2017-01-05 10:54:57 -05002262 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07002263 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002264 "fuzz/Fuzz.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002265 "fuzz/Fuzz.h",
Hal Canary24ac42b2017-02-14 13:35:14 -05002266 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002267 "fuzz/FuzzCommon.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002268 "fuzz/FuzzCommon.h",
Zepeng Hu94007012020-07-22 14:37:46 +00002269 "fuzz/FuzzCreateDDL.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05002270 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04002271 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002272 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002273 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002274 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002275 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002276 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04002277 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04002278 "fuzz/FuzzRegionOp.cpp",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002279 "fuzz/FuzzSkParagraph.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002280 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05002281 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
2282 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002283 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002284 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04002285 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002286 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05002287 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
2288 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Zepeng Hufcb7ba02020-07-31 17:21:29 +00002289 "fuzz/oss_fuzz/FuzzSKP.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002290 "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
2291 "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
Kevin Lubick0f0a7102019-03-18 16:20:55 -04002292 "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002293 "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
Zepeng Huedaf3022020-06-12 12:20:59 +00002294 "fuzz/oss_fuzz/FuzzSVG.cpp",
Kevin Lubick2be14d32019-10-21 13:44:48 -04002295 "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp",
Weston Tracey1a771fe2021-02-04 11:09:59 -05002296 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
Zepeng Hua5783f32020-07-10 13:36:20 +00002297 "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002298 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05002299 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002300 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002301 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002302 "tools/debugger/DrawCommand.cpp",
2303 "tools/debugger/JsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002304 ]
2305 deps = [
2306 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04002307 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07002308 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04002309 "modules/skottie:fuzz",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002310 "modules/skparagraph",
kjlubick14f984b2016-10-03 11:49:45 -07002311 ]
kjlubick14f984b2016-10-03 11:49:45 -07002312 }
Mike Klein38312422016-10-05 15:41:01 -04002313
Mike Kleine6682eb2017-01-05 10:54:57 -05002314 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04002315 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04002316 rebase_path("tests/skia_test.cpp"),
2317 rebase_path("tests/Test.cpp"),
2318 ]
caryclark9feb6322016-10-25 08:58:26 -07002319 deps = [
2320 ":flags",
2321 ":gpu_tool_utils",
2322 ":skia",
2323 ":tool_utils",
2324 ]
caryclark9feb6322016-10-25 08:58:26 -07002325 }
2326
Mike Kleine6682eb2017-01-05 10:54:57 -05002327 test_app("dump_record") {
Mike Klein4a56f4c2020-08-18 16:02:52 -05002328 sources = [ "tools/dump_record.cpp" ]
Mike Klein38312422016-10-05 15:41:01 -04002329 deps = [
2330 ":flags",
2331 ":skia",
2332 ]
Mike Klein38312422016-10-05 15:41:01 -04002333 }
bungemanfe917272016-10-13 17:36:40 -04002334
Mike Kleine6682eb2017-01-05 10:54:57 -05002335 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04002336 sources = [
2337 "tools/skdiff/skdiff.cpp",
2338 "tools/skdiff/skdiff_html.cpp",
2339 "tools/skdiff/skdiff_main.cpp",
2340 "tools/skdiff/skdiff_utils.cpp",
2341 ]
2342 deps = [
2343 ":skia",
2344 ":tool_utils",
2345 ]
bungemanfe917272016-10-13 17:36:40 -04002346 }
halcanarya73d76a2016-10-17 13:19:02 -07002347
Mike Kleine6682eb2017-01-05 10:54:57 -05002348 test_app("skp_parser") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002349 sources = [ "tools/skp_parser.cpp" ]
halcanarya73d76a2016-10-17 13:19:02 -07002350 deps = [
2351 ":skia",
2352 ":tool_utils",
halcanarya73d76a2016-10-17 13:19:02 -07002353 ]
halcanarya73d76a2016-10-17 13:19:02 -07002354 }
Brian Osman16adfa32016-10-18 14:42:44 -04002355
Brian Osmanc9a42472018-05-31 13:17:12 -04002356 if (!is_win) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002357 source_set("skqp_lib") {
2358 check_includes = false
2359 testonly = true
2360 if (!is_official_build) {
2361 configs -= [ "//gn:warnings" ]
2362 }
2363 public_configs = [ ":skia_private" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05002364 defines =
2365 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary75427132017-10-11 16:00:31 -04002366 sources = [
2367 "dm/DMGpuTestProcs.cpp",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002368 "tools/skqp/src/skqp.cpp",
2369 "tools/skqp/src/skqp_model.cpp",
Hal Canary75427132017-10-11 16:00:31 -04002370 ]
2371 deps = [
2372 ":gm",
Hal Canary75427132017-10-11 16:00:31 -04002373 ":skia",
2374 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05002375 ":tool_utils",
2376 ]
2377 }
2378 test_app("skqp") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002379 sources = [ "tools/skqp/src/skqp_main.cpp" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002380 include_dirs = [ "//" ]
2381 lib_dirs = []
Mike Kleina01c6b02020-04-01 13:47:34 -05002382 deps = [ ":skqp_lib" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002383 }
2384 test_app("jitter_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002385 sources = [ "tools/skqp/jitter_gms.cpp" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002386 deps = [
2387 ":gm",
2388 ":skia",
2389 ":skqp_lib",
Hal Canary75427132017-10-11 16:00:31 -04002390 ]
2391 }
2392 }
John Rosasco24cbdab2019-09-25 14:14:35 -07002393 if (is_fuchsia) {
2394 # Build a package repository for skqp on Fuchsia.
2395 group("skqp_repo") {
2396 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002397 deps = [ "//build/fuchsia/skqp:skqp_repo" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002398 }
2399 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002400 if (is_android) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002401 shared_library("libskqp_app") {
2402 configs += [ ":skia_private" ]
2403 if (!is_official_build) {
2404 configs -= [ "//gn:warnings" ]
2405 }
2406 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002407 sources = [ "tools/skqp/src/jni_skqp.cpp" ]
Hal Canary28f89382017-12-12 09:42:14 -05002408 deps = [
2409 ":skia",
2410 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05002411 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05002412 ]
2413 libs = [ "android" ]
2414 }
2415 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002416 if (is_android && skia_use_gl) {
Stan Iliev93151722018-08-02 11:10:52 -04002417 test_app("skottie_android") {
2418 is_shared_library = true
2419
Jorge Betancourt1fcdcaa2020-06-22 14:14:32 +00002420 sources = [ "platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp" ]
Stan Iliev93151722018-08-02 11:10:52 -04002421 libs = []
2422
Stan Iliev93151722018-08-02 11:10:52 -04002423 deps = [
2424 ":skia",
2425 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04002426 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04002427 ]
2428 }
2429 }
Hal Canary75427132017-10-11 16:00:31 -04002430
Hal Canarya9de7602018-01-19 13:08:23 -05002431 test_app("list_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002432 sources = [ "tools/list_gms.cpp" ]
Hal Canarya9de7602018-01-19 13:08:23 -05002433 deps = [
2434 ":gm",
2435 ":skia",
2436 ]
2437 }
2438 test_app("list_gpu_unit_tests") {
2439 sources = [
2440 "dm/DMGpuTestProcs.cpp",
2441 "tools/list_gpu_unit_tests.cpp",
2442 ]
2443 deps = [
2444 ":skia",
2445 ":tests",
2446 ]
2447 }
2448
Brian Osmanc9a42472018-05-31 13:17:12 -04002449 test_lib("sk_app") {
Hal Canary378be8d2019-04-26 08:20:14 -04002450 public_deps = [
Hal Canary378be8d2019-04-26 08:20:14 -04002451 ":gpu_tool_utils",
Hal Canary05694472019-05-03 17:14:21 -04002452 ":skia",
Hal Canary378be8d2019-04-26 08:20:14 -04002453 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002454 sources = [
John Stilesab9578e2020-06-30 17:36:55 -04002455 "tools/sk_app/Application.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002456 "tools/sk_app/CommandSet.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002457 "tools/sk_app/CommandSet.h",
2458 "tools/sk_app/DisplayParams.h",
2459 "tools/sk_app/RasterWindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002460 "tools/sk_app/Window.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002461 "tools/sk_app/Window.h",
Robert Phillipsed653392020-07-10 13:55:21 -04002462 "tools/sk_app/WindowContext.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002463 "tools/sk_app/WindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002464 ]
2465 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04002466 frameworks = []
Brian Osmanc9a42472018-05-31 13:17:12 -04002467
2468 if (is_android) {
2469 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002470 "tools/sk_app/android/RasterWindowContext_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002471 "tools/sk_app/android/WindowContextFactory_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002472 "tools/sk_app/android/Window_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002473 "tools/sk_app/android/Window_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002474 "tools/sk_app/android/main_android.cpp",
2475 "tools/sk_app/android/surface_glue_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002476 "tools/sk_app/android/surface_glue_android.h",
Brian Osman16adfa32016-10-18 14:42:44 -04002477 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002478 libs += [ "android" ]
2479 } else if (is_linux) {
2480 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002481 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002482 "tools/sk_app/unix/WindowContextFactory_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002483 "tools/sk_app/unix/Window_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002484 "tools/sk_app/unix/Window_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002485 "tools/sk_app/unix/keysym2ucs.c",
John Stilesab9578e2020-06-30 17:36:55 -04002486 "tools/sk_app/unix/keysym2ucs.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002487 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002488 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002489 libs += [
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002490 "GL", # Used by raster window context, so cannot be behind skia_use_gl.
Brian Osmanc9a42472018-05-31 13:17:12 -04002491 "X11",
2492 ]
2493 } else if (is_win) {
2494 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002495 "tools/sk_app/win/RasterWindowContext_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002496 "tools/sk_app/win/WindowContextFactory_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002497 "tools/sk_app/win/Window_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002498 "tools/sk_app/win/Window_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002499 "tools/sk_app/win/main_win.cpp",
2500 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002501 } else if (is_mac) {
2502 sources += [
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002503 "tools/sk_app/mac/RasterWindowContext_mac.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002504 "tools/sk_app/mac/WindowContextFactory_mac.h",
2505 "tools/sk_app/mac/Window_mac.h",
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002506 "tools/sk_app/mac/Window_mac.mm",
2507 "tools/sk_app/mac/main_mac.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002508 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002509 frameworks += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002510 "QuartzCore.framework",
2511 "Cocoa.framework",
2512 "Foundation.framework",
2513 ]
2514 } else if (is_ios) {
2515 sources += [
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002516 "tools/sk_app/ios/RasterWindowContext_ios.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002517 "tools/sk_app/ios/WindowContextFactory_ios.h",
2518 "tools/sk_app/ios/Window_ios.h",
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002519 "tools/sk_app/ios/Window_ios.mm",
2520 "tools/sk_app/ios/main_ios.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002521 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002522 frameworks += [ "QuartzCore.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002523 }
2524
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002525 if (skia_use_gl) {
2526 sources += [ "tools/sk_app/GLWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002527 sources += [ "tools/sk_app/GLWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002528 if (is_android) {
2529 sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ]
2530 } else if (is_linux) {
2531 sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ]
2532 } else if (is_win) {
2533 sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ]
2534 if (skia_use_angle) {
2535 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
2536 }
2537 } else if (is_mac) {
2538 sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
2539 } else if (is_ios) {
2540 sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
2541 }
2542 }
2543
Brian Osmanc9a42472018-05-31 13:17:12 -04002544 if (skia_use_vulkan) {
2545 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002546 sources += [ "tools/sk_app/VulkanWindowContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002547 if (is_android) {
2548 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2549 } else if (is_linux) {
2550 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2551 libs += [ "X11-xcb" ]
2552 } else if (is_win) {
2553 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2554 }
2555 }
2556
Jim Van Verthbe39f712019-02-08 15:36:14 -05002557 if (skia_use_metal) {
2558 sources += [ "tools/sk_app/MetalWindowContext.mm" ]
John Stilesab9578e2020-06-30 17:36:55 -04002559 sources += [ "tools/sk_app/MetalWindowContext.h" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002560 if (is_mac) {
2561 sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002562 } else if (is_ios) {
Jim Van Verthe58d5322019-09-03 09:42:57 -04002563 sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002564 }
Jim Van Verthbe39f712019-02-08 15:36:14 -05002565 }
2566
Jim Van Verth682a2f42020-05-13 16:54:09 -04002567 if (skia_use_direct3d) {
2568 sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ]
2569 }
2570
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002571 if (skia_use_dawn) {
2572 sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002573 sources += [ "tools/sk_app/DawnWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002574 if (is_linux) {
2575 if (dawn_enable_vulkan) {
2576 sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
2577 defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
2578 libs += [ "X11-xcb" ]
2579 }
2580 } else if (is_win) {
2581 if (dawn_enable_d3d12) {
2582 sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
2583 }
2584 } else if (is_mac) {
2585 if (dawn_enable_metal) {
2586 sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
2587 }
2588 }
2589 }
2590
Mike Kleina01c6b02020-04-01 13:47:34 -05002591 deps = [ ":tool_utils" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002592 if (is_android) {
2593 deps += [ "//third_party/native_app_glue" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002594 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002595 if (skia_use_gl && skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002596 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002597 }
Brian Osman16adfa32016-10-18 14:42:44 -04002598 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002599
Hal Canary87515122019-03-15 14:22:51 -04002600 if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
2601 test_app("fiddle_examples") {
2602 sources = [
Brian Osmanc725e8f2019-04-10 14:08:44 -04002603 "tools/fiddle/all_examples.cpp",
Hal Canary87515122019-03-15 14:22:51 -04002604 "tools/fiddle/examples.cpp",
Brian Osman72ef2d52019-03-17 11:09:17 -04002605 "tools/fiddle/examples.h",
Hal Canary87515122019-03-15 14:22:51 -04002606 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002607 if (is_win) {
Hal Canary6c8422c2020-01-10 15:22:09 -05002608 cflags = [
2609 "/wd4756", # Overflow in constant arithmetic
2610 "/wd4305", # truncation from 'double' to 'float'
2611 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002612 }
Hal Canary87515122019-03-15 14:22:51 -04002613 deps = [
2614 ":skia",
2615 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002616 "modules/particles",
Hal Canary87515122019-03-15 14:22:51 -04002617 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002618 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04002619 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002620 "modules/svg",
Hal Canary87515122019-03-15 14:22:51 -04002621 ]
2622 }
2623 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002624
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002625 # sk_app can work without GL but viewer always runs raster through a GL window context.
2626 if (skia_use_gl) {
2627 test_app("viewer") {
2628 is_shared_library = is_android
2629 sources = [
2630 "tools/viewer/AnimTimer.h",
2631 "tools/viewer/BisectSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002632 "tools/viewer/BisectSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002633 "tools/viewer/GMSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002634 "tools/viewer/GMSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002635 "tools/viewer/ImGuiLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002636 "tools/viewer/ImGuiLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002637 "tools/viewer/ImageSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002638 "tools/viewer/ImageSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002639 "tools/viewer/ParticlesSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002640 "tools/viewer/ParticlesSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002641 "tools/viewer/SKPSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002642 "tools/viewer/SKPSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002643 "tools/viewer/SampleSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002644 "tools/viewer/SampleSlide.h",
Florin Malita45cd2002020-06-09 14:00:54 -04002645 "tools/viewer/SkRiveSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002646 "tools/viewer/SkRiveSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002647 "tools/viewer/SkSLSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002648 "tools/viewer/SkSLSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002649 "tools/viewer/SkottieSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002650 "tools/viewer/SkottieSlide.h",
2651 "tools/viewer/Slide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002652 "tools/viewer/SlideDir.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002653 "tools/viewer/SlideDir.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002654 "tools/viewer/StatsLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002655 "tools/viewer/StatsLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002656 "tools/viewer/SvgSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002657 "tools/viewer/SvgSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002658 "tools/viewer/TouchGesture.cpp",
2659 "tools/viewer/TouchGesture.h",
2660 "tools/viewer/Viewer.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002661 "tools/viewer/Viewer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002662 ]
2663 libs = []
2664
2665 deps = [
2666 ":common_flags_gpu",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002667 ":flags",
2668 ":gm",
2669 ":gpu_tool_utils",
2670 ":samples",
2671 ":sk_app",
2672 ":skia",
2673 ":tool_utils",
2674 ":trace",
Florin Malita45cd2002020-06-09 14:00:54 -04002675 "experimental/skrive",
Florin Malitac9c4e2e2020-08-13 12:03:37 -04002676 "modules/audioplayer",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002677 "modules/particles",
2678 "modules/skottie",
2679 "modules/skottie:utils",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002680 "modules/sksg:samples",
Florin Malitab3418102020-10-15 18:10:29 -04002681 "modules/svg",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002682 "//third_party/imgui",
2683 ]
2684 if (skia_use_experimental_xform) {
2685 deps += [ ":experimental_xform" ]
2686 sources += [ "gm/xform.cpp" ]
2687 }
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002688 if (skia_use_vulkan) {
Brian Salomon3207fbe2020-06-30 11:09:25 -04002689 deps += [
2690 "//third_party/spirv-tools:spvtools",
2691
2692 #spvtools depends on this but doesn't deps it in. Looks like upstream bug
2693 #that we replicated in our third_party/spirv-tools/BUILD.gn
2694 "//third_party/spirv-tools:spvtools_val",
2695 ]
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002696 }
Mike Reedd62d4062019-06-12 10:20:44 -04002697 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002698 }
2699
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002700 if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002701 test_app("HelloWorld") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002702 sources = [ "example/HelloWorld.cpp" ]
Brian Osmaneff04b52017-11-21 13:18:02 -05002703 libs = []
2704
Brian Osmaneff04b52017-11-21 13:18:02 -05002705 deps = [
2706 ":flags",
2707 ":gpu_tool_utils",
2708 ":sk_app",
2709 ":skia",
2710 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002711 ]
2712 }
2713 }
2714
Mike Klein9f6468f2020-05-19 13:14:40 -05002715 if (skia_use_gl && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002716 test_app("SkiaSDLExample") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002717 sources = [ "example/SkiaSDLExample.cpp" ]
Jim Van Verth4c70c752017-07-11 12:03:01 -04002718 libs = []
Jim Van Verth4c70c752017-07-11 12:03:01 -04002719 deps = [
2720 ":gpu_tool_utils",
2721 ":skia",
2722 "//third_party/libsdl",
2723 ]
2724 }
2725 }
2726
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002727 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2728 action_foreach("generate_mocs") {
2729 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002730 sources = [ "tools/mdbviz/MainWindow.h" ]
2731 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002732 args = [
2733 "$skia_qt_path" + "/bin/moc",
2734 "{{source}}",
2735 "-o",
2736 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2737 ]
2738 }
2739 action_foreach("generate_resources") {
2740 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002741 sources = [ "tools/mdbviz/resources.qrc" ]
2742 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002743 args = [
2744 "$skia_qt_path" + "/bin/rcc",
2745 "{{source}}",
2746 "-o",
2747 "gen/mdbviz/{{source_name_part}}_res.cpp",
2748 ]
2749 }
2750 test_app("mdbviz") {
2751 if (is_win) {
2752 # on Windows we need to disable some exception handling warnings due to the Qt headers
2753 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2754 }
2755 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002756 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002757 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002758 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002759 "tools/debugger/DrawCommand.cpp",
2760 "tools/debugger/JsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002761 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002762 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002763 "tools/mdbviz/main.cpp",
2764
2765 # generated files
2766 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2767 "$target_gen_dir/mdbviz/resources_res.cpp",
2768 ]
2769 lib_dirs = [ "$skia_qt_path/lib" ]
2770 libs = [
2771 "Qt5Core.lib",
2772 "Qt5Gui.lib",
2773 "Qt5Widgets.lib",
2774 ]
2775 include_dirs = [
2776 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002777 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002778 "$skia_qt_path/include/QtWidgets",
2779 ]
2780 deps = [
2781 ":generate_mocs",
2782 ":generate_resources",
2783 ":skia",
2784 ]
2785 }
2786 }
2787
Mike Kleine459afd2017-03-03 09:21:30 -05002788 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002789 copy("gdbserver") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002790 sources = [ "$ndk/$ndk_gdbserver" ]
2791 outputs = [ "$root_out_dir/gdbserver" ]
Derek Sollenberger70120c72017-01-05 11:39:04 -05002792 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002793 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002794
2795 if (skia_use_opencl) {
2796 test_app("hello-opencl") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002797 sources = [ "tools/hello-opencl.cpp" ]
2798 deps = [ "//third_party/opencl" ]
Mike Kleinf9ae6702018-06-20 14:05:05 -04002799 }
2800 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002801
Brian Osmanf564f152019-07-23 15:14:30 -04002802 executable("cpu_modules") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002803 sources = [ "tools/cpu_modules.cpp" ]
Brian Osmanf564f152019-07-23 15:14:30 -04002804 deps = [
2805 ":skia",
2806 "modules/particles",
2807 ]
2808 }
2809
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002810 if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) {
Hal Canary1f94d392019-07-30 09:27:56 -04002811 test_app("editor") {
2812 is_shared_library = is_android
Mike Kleina01c6b02020-04-01 13:47:34 -05002813 deps = [ "modules/skplaintexteditor:editor_app" ]
Hal Canary1f94d392019-07-30 09:27:56 -04002814 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002815 }
Hal Canarye5b65d22019-09-19 11:33:31 -04002816
2817 executable("image_diff_metric") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002818 sources = [ "tools/image_diff_metric.cpp" ]
2819 deps = [ ":skia" ]
Hal Canarye5b65d22019-09-19 11:33:31 -04002820 }
Chris Dalton2b598902020-03-25 10:50:35 -06002821
2822 group("modules_testonly") {
2823 testonly = true
2824 deps = []
2825 if (target_cpu == "wasm") {
2826 deps += [ "modules/canvaskit:viewer_wasm" ]
2827 }
2828 }
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002829
2830 if (skia_build_fuzzers) {
2831 template("libfuzzer_app") {
2832 output_dir = root_build_dir
2833 executable(target_name) {
2834 check_includes = false
2835 forward_variables_from(invoker, "*", [ "is_shared_library" ])
2836 configs += [ ":skia_private" ]
2837 sources += [
2838 "fuzz/Fuzz.cpp",
2839 "fuzz/FuzzCommon.cpp",
2840 ]
2841 deps += [
2842 ":flags",
2843 ":gpu_tool_utils",
2844 ":skia",
2845 ]
2846 defines = [ "SK_BUILD_FOR_LIBFUZZER" ]
2847 if (skia_use_libfuzzer_defaults) {
2848 cflags = [ "-fsanitize=fuzzer" ]
2849 ldflags = [ "-fsanitize=fuzzer" ]
2850 }
2851 testonly = true
2852 }
2853 }
2854
2855 libfuzzer_app("region_deserialize") {
2856 sources = [ "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp" ]
2857 deps = []
2858 }
2859
2860 libfuzzer_app("image_filter_deserialize") {
2861 include_dirs = [
2862 "tools",
2863 "tools/fonts",
2864 ]
2865 sources = [
2866 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
2867 "tools/Resources.cpp",
2868 "tools/fonts/TestFontMgr.cpp",
2869 "tools/fonts/TestSVGTypeface.cpp",
2870 "tools/fonts/TestTypeface.cpp",
2871 ]
Florin Malitab3418102020-10-15 18:10:29 -04002872 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002873 }
2874
2875 libfuzzer_app("region_set_path") {
2876 sources = [ "fuzz/oss_fuzz/FuzzRegionSetPath.cpp" ]
2877 deps = []
2878 }
2879
2880 libfuzzer_app("textblob_deserialize") {
2881 include_dirs = [
2882 "tools",
2883 "tools/fonts",
2884 ]
2885 sources = [
2886 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
2887 "tools/Resources.cpp",
2888 "tools/fonts/TestFontMgr.cpp",
2889 "tools/fonts/TestSVGTypeface.cpp",
2890 "tools/fonts/TestTypeface.cpp",
2891 ]
Florin Malitab3418102020-10-15 18:10:29 -04002892 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002893 }
2894
2895 libfuzzer_app("path_deserialize") {
2896 sources = [ "fuzz/oss_fuzz/FuzzPathDeserialize.cpp" ]
2897 deps = []
2898 }
2899
2900 libfuzzer_app("image_decode") {
2901 sources = [ "fuzz/oss_fuzz/FuzzImage.cpp" ]
2902 deps = []
2903 }
2904
2905 libfuzzer_app("animated_image_decode") {
2906 sources = [ "fuzz/oss_fuzz/FuzzAnimatedImage.cpp" ]
2907 deps = []
2908 }
2909
2910 libfuzzer_app("api_create_ddl") {
2911 include_dirs = [
2912 "include",
2913 "include/gpu",
2914 ]
2915 sources = [
2916 "fuzz/FuzzCreateDDL.cpp",
2917 "fuzz/oss_fuzz/FuzzAPICreateDDL.cpp",
2918 "tools/Resources.cpp",
2919 "tools/UrlDataManager.cpp",
2920 "tools/debugger/DebugCanvas.cpp",
2921 "tools/debugger/DebugLayerManager.cpp",
2922 "tools/debugger/DrawCommand.cpp",
2923 "tools/debugger/JsonWriteBuffer.cpp",
2924 "tools/fonts/TestFontMgr.cpp",
2925 "tools/fonts/TestSVGTypeface.cpp",
2926 "tools/fonts/TestTypeface.cpp",
2927 ]
2928 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04002929 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002930 "//third_party/libpng",
2931 ]
2932 }
2933
2934 libfuzzer_app("api_draw_functions") {
2935 sources = [
2936 "fuzz/FuzzDrawFunctions.cpp",
2937 "fuzz/oss_fuzz/FuzzDrawFunctions.cpp",
2938 ]
2939 deps = []
2940 }
2941
2942 libfuzzer_app("api_gradients") {
2943 sources = [
2944 "fuzz/FuzzGradients.cpp",
2945 "fuzz/oss_fuzz/FuzzGradients.cpp",
2946 ]
2947 deps = []
2948 }
2949
2950 libfuzzer_app("api_image_filter") {
2951 include_dirs = [
2952 "tools",
2953 "tools/debugger",
2954 ]
2955 sources = [
2956 "fuzz/FuzzCanvas.cpp",
2957 "fuzz/oss_fuzz/FuzzAPIImageFilter.cpp",
2958 "tools/UrlDataManager.cpp",
2959 "tools/debugger/DebugCanvas.cpp",
2960 "tools/debugger/DebugLayerManager.cpp",
2961 "tools/debugger/DrawCommand.cpp",
2962 "tools/debugger/JsonWriteBuffer.cpp",
2963 ]
2964 deps = [ "//third_party/libpng" ]
2965 }
2966
2967 libfuzzer_app("api_path_measure") {
2968 sources = [
2969 "fuzz/FuzzPathMeasure.cpp",
2970 "fuzz/oss_fuzz/FuzzPathMeasure.cpp",
2971 ]
2972 deps = []
2973 }
2974
2975 libfuzzer_app("api_pathop") {
2976 sources = [
2977 "fuzz/FuzzPathop.cpp",
2978 "fuzz/oss_fuzz/FuzzPathop.cpp",
2979 ]
2980 deps = []
2981 }
2982
2983 libfuzzer_app("api_raster_n32_canvas") {
2984 include_dirs = [
2985 "tools",
2986 "tools/debugger",
2987 "tools/fonts",
2988 ]
2989 sources = [
2990 "fuzz/FuzzCanvas.cpp",
2991 "fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp",
2992 "tools/Resources.cpp",
2993 "tools/UrlDataManager.cpp",
2994 "tools/debugger/DebugCanvas.cpp",
2995 "tools/debugger/DebugLayerManager.cpp",
2996 "tools/debugger/DrawCommand.cpp",
2997 "tools/debugger/JsonWriteBuffer.cpp",
2998 "tools/fonts/TestFontMgr.cpp",
2999 "tools/fonts/TestSVGTypeface.cpp",
3000 "tools/fonts/TestTypeface.cpp",
3001 ]
3002 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003003 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003004 "//third_party/libpng",
3005 ]
3006 }
3007
3008 if (skia_use_gl) {
3009 libfuzzer_app("api_mock_gpu_canvas") {
3010 include_dirs = [
3011 "tools",
3012 "tools/debugger",
3013 "tools/fonts",
3014 ]
3015 sources = [
3016 "fuzz/FuzzCanvas.cpp",
3017 "fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp",
3018 "tools/LsanSuppressions.cpp",
3019 "tools/Resources.cpp",
3020 "tools/UrlDataManager.cpp",
3021 "tools/debugger/DebugCanvas.cpp",
3022 "tools/debugger/DebugLayerManager.cpp",
3023 "tools/debugger/DrawCommand.cpp",
3024 "tools/debugger/JsonWriteBuffer.cpp",
3025 "tools/fonts/TestFontMgr.cpp",
3026 "tools/fonts/TestSVGTypeface.cpp",
3027 "tools/fonts/TestTypeface.cpp",
3028 ]
3029 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003030 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003031 "//third_party/libpng",
3032 ]
3033 }
3034 }
3035
3036 libfuzzer_app("api_null_canvas") {
3037 include_dirs = [
3038 "tools",
3039 "tools/debugger",
3040 "tools/fonts",
3041 ]
3042 sources = [
3043 "fuzz/FuzzCanvas.cpp",
3044 "fuzz/oss_fuzz/FuzzNullCanvas.cpp",
3045 "tools/Resources.cpp",
3046 "tools/UrlDataManager.cpp",
3047 "tools/debugger/DebugCanvas.cpp",
3048 "tools/debugger/DebugLayerManager.cpp",
3049 "tools/debugger/DrawCommand.cpp",
3050 "tools/debugger/JsonWriteBuffer.cpp",
3051 "tools/fonts/TestFontMgr.cpp",
3052 "tools/fonts/TestSVGTypeface.cpp",
3053 "tools/fonts/TestTypeface.cpp",
3054 ]
3055 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003056 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003057 "//third_party/libpng",
3058 ]
3059 }
3060
Weston Tracey1a771fe2021-02-04 11:09:59 -05003061 libfuzzer_app("api_skparagraph") {
3062 sources = [
3063 "fuzz/FuzzSkParagraph.cpp",
3064 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
3065 "tools/Resources.cpp",
3066 ]
3067 deps = [ "modules/skparagraph" ]
3068 }
3069
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003070 libfuzzer_app("api_svg_canvas") {
3071 include_dirs = [
3072 "include",
3073 "include/svg",
3074 ]
3075 sources = [
3076 "fuzz/FuzzCanvas.cpp",
3077 "fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp",
3078 "tools/Resources.cpp",
3079 "tools/UrlDataManager.cpp",
3080 "tools/debugger/DebugCanvas.cpp",
3081 "tools/debugger/DebugLayerManager.cpp",
3082 "tools/debugger/DrawCommand.cpp",
3083 "tools/debugger/JsonWriteBuffer.cpp",
3084 "tools/fonts/TestFontMgr.cpp",
3085 "tools/fonts/TestSVGTypeface.cpp",
3086 "tools/fonts/TestTypeface.cpp",
3087 ]
3088 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003089 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003090 "//third_party/libpng",
3091 ]
3092 }
3093
3094 libfuzzer_app("png_encoder") {
3095 sources = [
3096 "fuzz/FuzzEncoders.cpp",
3097 "fuzz/oss_fuzz/FuzzPNGEncoder.cpp",
3098 ]
3099 deps = []
3100 }
3101
3102 libfuzzer_app("jpeg_encoder") {
3103 sources = [
3104 "fuzz/FuzzEncoders.cpp",
3105 "fuzz/oss_fuzz/FuzzJPEGEncoder.cpp",
3106 ]
3107 deps = []
3108 }
3109
3110 libfuzzer_app("webp_encoder") {
3111 sources = [
3112 "fuzz/FuzzEncoders.cpp",
3113 "fuzz/oss_fuzz/FuzzWEBPEncoder.cpp",
3114 ]
3115 deps = []
3116 }
3117
3118 libfuzzer_app("skottie_json") {
3119 sources = [
3120 "modules/skottie/fuzz/FuzzSkottieJSON.cpp",
3121 "tools/Resources.cpp",
3122 "tools/fonts/TestFontMgr.cpp",
3123 "tools/fonts/TestSVGTypeface.cpp",
3124 "tools/fonts/TestTypeface.cpp",
3125 ]
3126 deps = [
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003127 "modules/skottie:skottie",
Florin Malitab3418102020-10-15 18:10:29 -04003128 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003129 ]
3130 }
3131
3132 libfuzzer_app("skjson") {
3133 sources = [ "fuzz/oss_fuzz/FuzzJSON.cpp" ]
3134 deps = []
3135 }
3136
3137 libfuzzer_app("api_polyutils") {
3138 sources = [
3139 "fuzz/FuzzPolyUtils.cpp",
3140 "fuzz/oss_fuzz/FuzzPolyUtils.cpp",
3141 ]
3142 deps = [ ":skia" ]
3143 }
3144
3145 libfuzzer_app("android_codec") {
3146 sources = [ "fuzz/oss_fuzz/FuzzAndroidCodec.cpp" ]
3147 deps = []
3148 }
3149
3150 libfuzzer_app("image_decode_incremental") {
3151 sources = [ "fuzz/oss_fuzz/FuzzIncrementalImage.cpp" ]
3152 deps = []
3153 }
3154
3155 libfuzzer_app("sksl2glsl") {
3156 sources = [ "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp" ]
3157 deps = []
3158 }
3159
3160 libfuzzer_app("sksl2spirv") {
3161 sources = [ "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp" ]
3162 deps = []
3163 }
3164
3165 libfuzzer_app("sksl2metal") {
3166 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp" ]
3167 deps = []
3168 }
3169
3170 libfuzzer_app("sksl2pipeline") {
3171 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp" ]
3172 deps = []
3173 }
3174
3175 libfuzzer_app("skdescriptor_deserialize") {
3176 sources = [ "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp" ]
3177 deps = []
3178 }
3179
3180 libfuzzer_app("svg_dom") {
3181 sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ]
Florin Malitab3418102020-10-15 18:10:29 -04003182 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003183 }
3184
3185 libfuzzer_app("skruntimeeffect") {
3186 sources = [ "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp" ]
3187 deps = []
3188 }
3189
3190 libfuzzer_app("skp") {
3191 sources = [ "fuzz/oss_fuzz/FuzzSKP.cpp" ]
3192 deps = []
3193 }
3194 }
mtklein25c81d42016-07-27 13:55:26 -07003195}
Hal Canary932a2c02019-09-17 10:43:18 -04003196
Chinmay Gardea1ea0a92019-10-01 16:37:10 -07003197if (is_ios && skia_use_metal && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003198 group("minimal_ios_mtl_skia_app") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003199 deps = [ "experimental/minimal_ios_mtl_skia_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003200 }
Hal Canary27483062019-12-06 15:01:08 -05003201}
3202
Hal Canary60ff6512020-01-21 12:39:20 -05003203if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003204 group("skottie_ios") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003205 deps = [ "tools/skottie_ios_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003206 }
3207}
Martin Kustermannb65d2992020-12-15 16:15:13 +01003208
3209executable("skia_c_api_example") {
3210 sources = [ "experimental/c-api-example/skia-c-example.c" ]
3211 include_dirs = [ "." ]
3212 deps = [ ":skia" ]
3213}