blob: 33c7b9b9838fa9fd612d2f6d123cc1e99ef8199e [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",
Brian Osmand010f652021-02-24 13:59:39 -0500592 "SK_DISABLE_TRACING",
Brian Osman8d09d4a2020-11-24 15:51:06 -0500593 "SK_ENABLE_SPIRV_VALIDATION",
594 ]
Brian Osmana6ca9752020-10-02 13:41:21 -0400595 sources = [
Brian Osman47726a12020-12-17 16:02:08 -0500596 "src/core/SkCpu.cpp",
597 "src/core/SkData.cpp",
598 "src/core/SkHalf.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400599 "src/core/SkMalloc.cpp",
600 "src/core/SkMath.cpp",
John Stiles060503e2020-10-22 15:02:26 -0400601 "src/core/SkSemaphore.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500602 "src/core/SkStream.cpp",
603 "src/core/SkString.cpp",
Brian Osmane9ad19b2020-12-23 13:31:13 -0500604 "src/core/SkStringUtils.cpp",
John Stiles060503e2020-10-22 15:02:26 -0400605 "src/core/SkThreadID.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500606 "src/core/SkUtils.cpp",
607 "src/core/SkVM.cpp",
John Stiles23e68662020-10-29 10:17:15 -0400608 "src/gpu/GrBlockAllocator.cpp",
609 "src/gpu/GrMemoryPool.cpp",
Brian Osman62b039b2021-02-08 13:49:53 -0500610 "src/gpu/GrShaderUtils.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400611 "src/ports/SkMemory_malloc.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500612 "src/ports/SkOSFile_stdio.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400613 "src/sksl/SkSLMain.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500614 "src/utils/SkUTF.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400615 ]
Brian Osman47726a12020-12-17 16:02:08 -0500616 if (is_win) {
617 sources += [ "src/ports/SkOSFile_win.cpp" ]
618 } else {
619 sources += [ "src/ports/SkOSFile_posix.cpp" ]
620 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400621 sources += skia_sksl_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400622 sources += skia_sksl_gpu_sources
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500623 include_dirs = [ "." ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400624 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500625 ":run_sksllex",
Corentin Wallez89d6e792021-03-08 15:25:34 +0100626 "//third_party/externals/spirv-tools:spvtools",
627 "//third_party/externals/spirv-tools:spvtools_val",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400628 ]
629 }
630
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400631 skslc_path = "$root_out_dir/"
632 if (host_toolchain != default_toolchain_name) {
633 skslc_path += "$host_toolchain/"
634 }
635 skslc_path += "skslc"
636 if (host_os == "win") {
637 skslc_path += ".exe"
638 }
639
Brian Osmandd496172020-08-08 08:17:18 -0400640 action("create_sksl_fp") {
641 script = "gn/create_sksl_fp.py"
642 sources = [
643 "include/private/GrSharedEnums.h",
644 "src/sksl/sksl_fp_raw.sksl",
645 ]
646 outputs = [ "$root_out_dir/sksl_fp.sksl" ]
647 args = [
648 rebase_path(sources[0]),
649 rebase_path(sources[1]),
650 rebase_path(outputs[0]),
651 ]
652 }
653
654 copy("sksl_pre_includes") {
655 sources = [
656 "src/sksl/sksl_frag.sksl",
657 "src/sksl/sksl_geom.sksl",
658 "src/sksl/sksl_gpu.sksl",
Brian Osmanb06301e2020-11-06 11:45:36 -0500659 "src/sksl/sksl_public.sksl",
Brian Osman91946752020-12-21 13:20:40 -0500660 "src/sksl/sksl_runtime.sksl",
Brian Osmandd496172020-08-08 08:17:18 -0400661 "src/sksl/sksl_vert.sksl",
662 ]
663 outputs = [ "$root_out_dir/{{source_file_part}}" ]
664 }
665
666 dehydrate_sksl_sources = get_target_outputs(":sksl_pre_includes")
667 dehydrate_sksl_sources += get_target_outputs(":create_sksl_fp")
668
669 dehydrate_sksl_outputs = []
670 foreach(src, dehydrate_sksl_sources) {
671 name = get_path_info(src, "name")
672
673 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
674 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
675 dehydrate_sksl_outputs += [ "$target_out_dir/" + rebase_path(
676 "src/sksl/generated/$name.dehydrated.sksl",
677 target_out_dir) ]
678 }
679
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400680 action("dehydrate_sksl") {
681 script = "gn/dehydrate_sksl.py"
Brian Osmandd496172020-08-08 08:17:18 -0400682 deps = [
683 ":create_sksl_fp",
684 ":sksl_pre_includes",
685 ":skslc(//gn/toolchain:$host_toolchain)",
686 ]
687 sources = dehydrate_sksl_sources
688 outputs = dehydrate_sksl_outputs
Brian Osmana5781382020-08-07 21:28:12 +0000689 args = [
690 rebase_path(skslc_path),
Brian Osmandd496172020-08-08 08:17:18 -0400691 rebase_path("src/sksl/generated"),
Brian Osmana5781382020-08-07 21:28:12 +0000692 ]
Brian Osmandd496172020-08-08 08:17:18 -0400693 args += rebase_path(dehydrate_sksl_sources)
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400694 }
John Stilesd836f842020-09-14 10:21:44 -0400695} else {
696 group("dehydrate_sksl") {
697 }
698}
699
700skia_gpu_processor_outputs = []
701if (skia_compile_processors) {
702 foreach(src, skia_gpu_processor_sources) {
703 dir = get_path_info(src, "dir")
704 name = get_path_info(src, "name")
705
706 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
707 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
708 skia_gpu_processor_outputs += [
709 "$target_out_dir/" +
710 rebase_path("$dir/generated/$name.h", target_out_dir),
711 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
712 # confused due to the same file being named by two different paths
713 ]
714 }
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400715
Ethan Nicholas762466e2017-06-29 10:03:38 -0400716 action("compile_processors") {
717 script = "gn/compile_processors.py"
718 deps = [
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400719 ":create_sksl_fp",
Brian Osmandd496172020-08-08 08:17:18 -0400720 ":sksl_pre_includes",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400721 ":skslc(//gn/toolchain:$host_toolchain)",
722 ]
723 sources = skia_gpu_processor_sources
724 outputs = skia_gpu_processor_outputs
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400725 args = [
726 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400727 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400728 rebase_path("bin/fetch-clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400729 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400730 args += rebase_path(skia_gpu_processor_sources)
731 }
732} else {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400733 group("compile_processors") {
734 }
John Stilesd836f842020-09-14 10:21:44 -0400735}
736
737if (skia_compile_sksl_tests) {
738 import("gn/sksl_tests.gni")
John Stilesd836f842020-09-14 10:21:44 -0400739
John Stiles7e248712020-09-24 16:42:09 -0400740 template("compile_sksl") {
741 # Compile the passed-in `sources` into `outputs` using skslc, with the given language/settings.
742 action("compile_sksl_${target_name}") {
743 script = "gn/compile_sksl_tests.py"
744 deps = [
745 ":create_sksl_fp",
746 ":sksl_pre_includes",
747 ":skslc(//gn/toolchain:$host_toolchain)",
748 ]
John Stilesda57fc02021-01-22 11:54:30 -0500749 sources = []
John Stiles7e248712020-09-24 16:42:09 -0400750 outputs = []
John Stilesb7f5e1b2021-01-27 14:05:15 -0500751 response_file_contents = []
John Stilesda57fc02021-01-22 11:54:30 -0500752 args = [
753 rebase_path(skslc_path),
754 invoker.lang,
755 invoker.settings,
John Stilesb7f5e1b2021-01-27 14:05:15 -0500756 "{{response_file_name}}",
John Stilesda57fc02021-01-22 11:54:30 -0500757 ]
758
John Stilesbfc9be02021-01-22 11:55:48 -0500759 testsDir = get_path_info("tests", "abspath")
760 resourcesDir = get_path_info("resources", "abspath")
761
762 foreach(partialPath, invoker.sources) {
763 dst = testsDir + partialPath
764 src = resourcesDir + partialPath
765
766 dir = get_path_info(dst, "dir")
767 name = get_path_info(dst, "name")
768 ext = get_path_info(dst, "extension")
John Stilesb7f5e1b2021-01-27 14:05:15 -0500769 response_file_contents += rebase_path([
770 src,
771 dir,
772 ])
John Stilesda57fc02021-01-22 11:54:30 -0500773 sources += [ src ]
John Stilesc3012182020-12-08 15:07:00 -0500774
John Stilesda57fc02021-01-22 11:54:30 -0500775 foreach(outExtension, invoker.outExtensions) {
John Stilesc3012182020-12-08 15:07:00 -0500776 # SPIR-V uses separate extensions for .vert and .geom shaders.
777 if (outExtension == ".asm.frag" && ext == "vert") {
778 outExtension = ".asm.vert"
779 } else if (outExtension == ".asm.frag" && ext == "geom") {
780 outExtension = ".asm.geom"
781 }
John Stilesbfc9be02021-01-22 11:55:48 -0500782 outputs +=
783 [ target_out_dir + "/" +
784 rebase_path(dir + "/" + name + outExtension, target_out_dir) ]
John Stiles7e248712020-09-24 16:42:09 -0400785 }
786 }
John Stiles7e248712020-09-24 16:42:09 -0400787 }
John Stilesd836f842020-09-14 10:21:44 -0400788 }
John Stiles7e248712020-09-24 16:42:09 -0400789 compile_sksl("fp_tests") {
790 sources = sksl_fp_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500791 outExtensions = [
792 ".cpp",
793 ".h",
John Stiles7e248712020-09-24 16:42:09 -0400794 ]
795 lang = "--fp"
796 settings = "--settings"
John Stiles0ed9f312020-09-16 17:46:37 -0400797 }
John Stiles7e248712020-09-24 16:42:09 -0400798 compile_sksl("glsl_tests") {
799 sources = sksl_glsl_tests_sources + sksl_glsl_settings_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500800 outExtensions = [ ".glsl" ]
John Stiles7e248712020-09-24 16:42:09 -0400801 lang = "--glsl"
802 settings = "--settings"
John Stiles0ed9f312020-09-16 17:46:37 -0400803 }
John Stiles7e248712020-09-24 16:42:09 -0400804 compile_sksl("glsl_nosettings_tests") {
John Stiles0ed9f312020-09-16 17:46:37 -0400805 sources = sksl_glsl_settings_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500806 outExtensions = [ "StandaloneSettings.glsl" ]
John Stiles7e248712020-09-24 16:42:09 -0400807 lang = "--glsl"
808 settings = "--nosettings"
John Stilesd836f842020-09-14 10:21:44 -0400809 }
John Stilesaeae3a52020-09-25 13:35:58 -0400810 compile_sksl("metal_tests") {
811 sources = sksl_metal_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500812 outExtensions = [ ".metal" ]
John Stilesaeae3a52020-09-25 13:35:58 -0400813 lang = "--metal"
814 settings = "--settings"
815 }
Brian Osman977feec2020-12-22 11:28:59 -0500816 compile_sksl("skvm_tests") {
817 sources = sksl_skvm_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500818 outExtensions = [ ".skvm" ]
Brian Osman977feec2020-12-22 11:28:59 -0500819 lang = "--skvm"
820 settings = "--settings"
821 }
Brian Osman62b039b2021-02-08 13:49:53 -0500822 compile_sksl("stage_tests") {
823 sources = sksl_stage_tests_sources
824 outExtensions = [ ".stage" ]
825 lang = "--stage"
826 settings = "--settings"
827 }
John Stilesdda1d312020-11-20 16:28:50 -0500828 compile_sksl("spirv_tests") {
829 sources = sksl_spirv_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500830 outExtensions = [ ".asm.frag" ]
John Stilesdda1d312020-11-20 16:28:50 -0500831 lang = "--spirv"
832 settings = "--settings"
833 }
John Stilesd836f842020-09-14 10:21:44 -0400834} else {
John Stiles7e248712020-09-24 16:42:09 -0400835 group("compile_sksl_fp_tests") {
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400836 }
John Stiles7e248712020-09-24 16:42:09 -0400837 group("compile_sksl_glsl_tests") {
838 }
839 group("compile_sksl_glsl_nosettings_tests") {
John Stiles0ed9f312020-09-16 17:46:37 -0400840 }
John Stilesaeae3a52020-09-25 13:35:58 -0400841 group("compile_sksl_metal_tests") {
842 }
Brian Osman977feec2020-12-22 11:28:59 -0500843 group("compile_sksl_skvm_tests") {
844 }
John Stilesdda1d312020-11-20 16:28:50 -0500845 group("compile_sksl_spirv_tests") {
846 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400847}
848
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500849optional("gpu") {
mtklein06c35c02016-09-20 12:28:12 -0700850 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400851 deps = [
852 ":compile_processors",
John Stiles7e248712020-09-24 16:42:09 -0400853 ":compile_sksl_fp_tests",
854 ":compile_sksl_glsl_nosettings_tests",
855 ":compile_sksl_glsl_tests",
John Stilesaeae3a52020-09-25 13:35:58 -0400856 ":compile_sksl_metal_tests",
Brian Osman977feec2020-12-22 11:28:59 -0500857 ":compile_sksl_skvm_tests",
John Stilesdda1d312020-11-20 16:28:50 -0500858 ":compile_sksl_spirv_tests",
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400859 ":dehydrate_sksl",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700860 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400861 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700862 if (skia_generate_workarounds) {
863 deps += [ ":workaround_list" ]
864 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800865 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600866 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400867 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700868
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400869 sources =
870 skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400871 if (!skia_enable_ccpr) {
872 sources -= skia_ccpr_sources
873 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
874 }
mtklein06c35c02016-09-20 12:28:12 -0700875
Mike Klein703cf5a2016-10-13 17:18:04 -0400876 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -0400877 frameworks = []
mtkleine9fb3d52016-09-20 15:11:46 -0700878
John Rosascoa9b348f2019-11-08 13:18:15 -0800879 if (skia_use_gl) {
880 public_defines += [ "SK_GL" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400881 if (is_android) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500882 sources += [
883 "src/gpu/gl/egl/GrGLMakeEGLInterface.cpp",
884 "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
885 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400886
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) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500892 sources += [
893 "src/gpu/gl/egl/GrGLMakeEGLInterface.cpp",
894 "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
895 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400896 libs += [ "EGL" ]
Kevin Lubick204c3be2020-08-19 14:30:58 -0400897 } else if (skia_use_webgl) {
898 sources += [ "src/gpu/gl/webgl/GrGLMakeNativeInterface_webgl.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400899 } else if (is_linux && skia_use_x11) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500900 sources += [
901 "src/gpu/gl/glx/GrGLMakeGLXInterface.cpp",
902 "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp",
903 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400904 libs += [ "GL" ]
905 } else if (is_mac) {
906 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
907 } else if (is_ios) {
908 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
James Clarkeb8c0dab2021-02-09 06:22:41 -0800909 } else if (is_win && !skia_enable_winuwp) {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400910 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
911 if (target_cpu != "arm64") {
912 libs += [ "OpenGL32.lib" ]
913 }
914 } else {
915 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
916 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800917 sources += skia_gl_gpu_sources
918 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400919
mtkleine9fb3d52016-09-20 15:11:46 -0700920 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400921 public_defines += [ "SK_VULKAN" ]
Greg Danielb16beb92020-04-27 14:26:21 +0000922 if (skia_use_vma) {
923 deps += [ "third_party/vulkanmemoryallocator" ]
924 }
mtkleine9fb3d52016-09-20 15:11:46 -0700925 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700926 if (skia_enable_vulkan_debug_layers) {
927 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
928 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800929 if (is_fuchsia) {
John Rosascoe57ca492019-11-13 14:30:45 -0800930 if (using_fuchsia_sdk) {
Chinmay Garde89820762019-05-06 16:44:06 -0700931 public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
932 } else {
Brian Osman489cf882019-07-09 10:48:28 -0400933 public_deps += [ "//src/graphics/lib/vulkan" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700934 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800935 }
mtkleine9fb3d52016-09-20 15:11:46 -0700936 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400937
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400938 if (is_android && (skia_use_gl || skia_use_vulkan)) {
939 # this lib is required to link against AHardwareBuffer
940 if (defined(ndk_api) && ndk_api >= 26) {
941 libs += [ "android" ]
942 }
943 }
944
Stephen White0d70b712019-07-10 15:51:30 -0400945 if (skia_use_dawn) {
946 public_defines += [ "SK_DAWN" ]
Stephen White985741a2019-07-18 11:43:45 -0400947 sources += skia_dawn_sources
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700948 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen Whitefbffb992019-10-17 10:32:40 -0400949 deps += [
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700950 "//third_party/externals/dawn/src/dawn:dawn_proc",
951 "//third_party/externals/dawn/src/dawn:dawncpp",
952 "//third_party/externals/dawn/src/dawn_native",
Stephen White0d70b712019-07-10 15:51:30 -0400953 ]
954 if (dawn_enable_d3d12) {
955 libs += [
956 "d3d12.lib",
957 "dxgi.lib",
958 "d3dcompiler.lib",
959 ]
960 } else if (dawn_enable_metal) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400961 frameworks += [ "Metal.framework" ]
Stephen White0d70b712019-07-10 15:51:30 -0400962 }
963 }
964
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500965 if (skia_use_direct3d) {
966 public_defines += [ "SK_DIRECT3D" ]
Jim Van Verth1b89eb72020-09-23 16:29:51 -0400967 deps += [
968 "//third_party/d3d12allocator",
969 "//third_party/spirv-cross:spirv_cross",
970 ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500971 sources += skia_direct3d_sources
Jim Van Verth03b8ab22020-02-24 11:36:15 -0500972 if (skia_enable_direct3d_debug_layer) {
973 public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ]
974 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500975 libs += [
976 "d3d12.lib",
977 "dxgi.lib",
978 "d3dcompiler.lib",
979 ]
980 }
981
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400982 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400983 if (skia_use_metal) {
984 public_defines += [ "SK_METAL" ]
985 sources += skia_metal_sources
Jim Van Verthef820be2020-08-12 10:45:00 -0400986 frameworks += [ "Metal.framework" ]
Jim Van Verthef820be2020-08-12 10:45:00 -0400987 frameworks += [ "Foundation.framework" ]
Jim Van Verth36b86af2020-08-24 17:16:46 +0000988 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400989 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500990
Kevin Lubickf4def342018-10-04 12:52:50 -0400991 if (is_debug) {
992 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
993 }
mtklein06c35c02016-09-20 12:28:12 -0700994}
995
Leon Scroggins III41169202019-01-29 09:29:57 -0500996optional("gif") {
Hal Canary2dad9902019-11-20 16:01:31 -0500997 enabled = !skia_use_wuffs && skia_use_libgifcodec
Hal Canary1ec9a282019-11-21 10:15:50 -0500998 _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
999 if ("True" ==
1000 exec_script("gn/checkpath.py",
1001 [ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
1002 "trim string")) {
1003 public_defines = [ "SK_USE_LIBGIFCODEC" ]
1004 public_include_dirs = [
1005 ".",
1006 skia_libgifcodec_path,
1007 ]
1008 include_dirs = public_include_dirs
1009 import(_libgifcodec_gni_path)
1010 sources = rebase_path(libgifcodec_sources + libgifcodec_public,
1011 ".",
1012 skia_libgifcodec_path)
1013 }
Leon Scroggins III41169202019-01-29 09:29:57 -05001014}
1015
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001016optional("heif") {
1017 enabled = skia_use_libheif
1018 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
1019
1020 deps = []
1021
Mike Kleina01c6b02020-04-01 13:47:34 -05001022 sources = [ "src/codec/SkHeifCodec.cpp" ]
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001023}
1024
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001025optional("jpeg_decode") {
1026 enabled = skia_use_libjpeg_turbo_decode
1027 public_defines = [ "SK_CODEC_DECODES_JPEG" ]
1028
Mike Kleina01c6b02020-04-01 13:47:34 -05001029 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001030 sources = [
1031 "src/codec/SkJpegCodec.cpp",
1032 "src/codec/SkJpegDecoderMgr.cpp",
1033 "src/codec/SkJpegUtility.cpp",
1034 ]
1035}
1036
1037optional("jpeg_encode") {
1038 enabled = skia_use_libjpeg_turbo_encode
1039 public_defines = [ "SK_ENCODE_JPEG" ]
mtklein63213812016-08-24 09:55:56 -07001040
Mike Kleina01c6b02020-04-01 13:47:34 -05001041 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
1042 public = [ "include/encode/SkJpegEncoder.h" ]
mtklein63213812016-08-24 09:55:56 -07001043 sources = [
mtklein63213812016-08-24 09:55:56 -07001044 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -04001045 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -07001046 ]
1047}
1048
Leon Scroggins III326b9892020-08-05 16:51:10 -04001049optional("ndk_images") {
1050 enabled = skia_use_ndk_images
1051 public_defines = [ "SK_ENABLE_NDK_IMAGES" ]
1052 sources = [
1053 "src/ports/SkImageEncoder_NDK.cpp",
1054 "src/ports/SkImageGeneratorNDK.cpp",
1055 "src/ports/SkNDKConversions.cpp",
1056 ]
Leon Scroggins IIIf21d6b92020-08-05 10:44:17 -04001057 libs = [ "jnigraphics" ]
1058}
1059
mtklein63213812016-08-24 09:55:56 -07001060optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -05001061 enabled = skia_use_zlib && skia_enable_pdf
1062 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -07001063
Mike Kleina01c6b02020-04-01 13:47:34 -05001064 deps = [ "//third_party/zlib" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001065 if (skia_use_libjpeg_turbo_decode) {
1066 deps += [ ":jpeg_decode" ]
1067 }
1068 if (skia_use_libjpeg_turbo_encode) {
1069 deps += [ ":jpeg_encode" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -04001070 }
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001071 public = skia_pdf_public
brettwb9447282016-09-01 14:24:39 -07001072 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -07001073 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
Hal Canary2a3093c2019-02-20 11:25:45 -05001074 if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
1075 deps += [ "//third_party/harfbuzz" ]
1076 defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
1077 } else if (skia_use_icu && skia_use_sfntly) {
mtklein63213812016-08-24 09:55:56 -07001078 deps += [ "//third_party/sfntly" ]
Hal Canary32498f02019-02-04 15:36:31 -05001079 defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -07001080 }
1081}
1082
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001083optional("xps") {
1084 enabled = skia_use_xps && is_win
1085 public_defines = [ "SK_SUPPORT_XPS" ]
1086 public = skia_xps_public
1087 sources = skia_xps_sources
1088}
1089
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001090optional("png_decode") {
1091 enabled = skia_use_libpng_decode
1092 public_defines = [ "SK_CODEC_DECODES_PNG" ]
mtklein63213812016-08-24 09:55:56 -07001093
Mike Kleina01c6b02020-04-01 13:47:34 -05001094 deps = [ "//third_party/libpng" ]
mtklein63213812016-08-24 09:55:56 -07001095 sources = [
1096 "src/codec/SkIcoCodec.cpp",
1097 "src/codec/SkPngCodec.cpp",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001098 ]
1099}
1100
1101optional("png_encode") {
1102 enabled = skia_use_libpng_encode
1103 public_defines = [ "SK_ENCODE_PNG" ]
1104
Mike Kleina01c6b02020-04-01 13:47:34 -05001105 deps = [ "//third_party/libpng" ]
1106 sources = [ "src/images/SkPngEncoder.cpp" ]
mtklein63213812016-08-24 09:55:56 -07001107}
1108
scroggof84ad642016-10-31 09:02:57 -07001109optional("raw") {
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001110 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -07001111 public_defines = [ "SK_CODEC_DECODES_RAW" ]
1112
1113 deps = [
1114 "//third_party/dng_sdk",
1115 "//third_party/libjpeg-turbo:libjpeg",
1116 "//third_party/piex",
1117 ]
1118
1119 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
1120 # Skia.
1121 configs_to_remove = [ "//gn:no_exceptions" ]
1122
Mike Kleina01c6b02020-04-01 13:47:34 -05001123 sources = [ "src/codec/SkRawCodec.cpp" ]
scroggof84ad642016-10-31 09:02:57 -07001124}
1125
Mike Klein852a8cb2018-05-15 10:46:58 -04001126import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -04001127source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -04001128 cflags = []
1129 if (!is_win || is_clang) {
1130 cflags += [
1131 "-w",
1132 "-std=c11",
1133 ]
1134 }
1135
Mike Kleina01c6b02020-04-01 13:47:34 -05001136 public = [ "include/third_party/skcms/skcms.h" ]
Brian Osmanea236bf2019-04-29 10:28:22 -04001137 include_dirs = [ "include/third_party/skcms" ]
Mike Klein852a8cb2018-05-15 10:46:58 -04001138 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
1139}
1140
mtklein3cc22182016-08-29 13:26:14 -07001141optional("typeface_freetype") {
1142 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -07001143
Mike Kleina01c6b02020-04-01 13:47:34 -05001144 deps = [ "//third_party/freetype2" ]
mtklein3cc22182016-08-29 13:26:14 -07001145 sources = [
1146 "src/ports/SkFontHost_FreeType.cpp",
1147 "src/ports/SkFontHost_FreeType_common.cpp",
Ben Wagner9d5c55c2020-06-27 12:52:14 -04001148 "src/ports/SkFontHost_FreeType_common.h",
mtklein3cc22182016-08-29 13:26:14 -07001149 ]
1150}
1151
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001152optional("webp_decode") {
1153 enabled = skia_use_libwebp_decode
1154 public_defines = [ "SK_CODEC_DECODES_WEBP" ]
mtklein457b42a2016-08-23 13:56:37 -07001155
Mike Kleina01c6b02020-04-01 13:47:34 -05001156 deps = [ "//third_party/libwebp" ]
1157 sources = [ "src/codec/SkWebpCodec.cpp" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001158}
1159
1160optional("webp_encode") {
1161 enabled = skia_use_libwebp_encode
1162 public_defines = [ "SK_ENCODE_WEBP" ]
1163
Mike Kleina01c6b02020-04-01 13:47:34 -05001164 deps = [ "//third_party/libwebp" ]
1165 sources = [ "src/images/SkWebpEncoder.cpp" ]
mtkleineb3c4252016-08-23 07:38:09 -07001166}
1167
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001168optional("wuffs") {
1169 enabled = skia_use_wuffs
Nigel Tao5cfa7192020-08-17 21:14:13 +10001170 public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001171
Mike Kleina01c6b02020-04-01 13:47:34 -05001172 deps = [ "//third_party/wuffs" ]
1173 sources = [ "src/codec/SkWuffsCodec.cpp" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001174}
1175
mtklein63213812016-08-24 09:55:56 -07001176optional("xml") {
1177 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +00001178 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -07001179
Mike Kleina01c6b02020-04-01 13:47:34 -05001180 deps = [ "//third_party/expat" ]
mtklein63213812016-08-24 09:55:56 -07001181 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -05001182 "src/svg/SkSVGCanvas.cpp",
1183 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -07001184 "src/xml/SkDOM.cpp",
1185 "src/xml/SkXMLParser.cpp",
1186 "src/xml/SkXMLWriter.cpp",
1187 ]
1188}
1189
Mike Klein613ad382019-06-06 11:42:02 -05001190optional("skvm_jit") {
Mike Klein13ec5442020-08-14 07:36:54 -05001191 enabled = skia_enable_skvm_jit_when_possible
1192 public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ]
Mike Klein2b54e832020-07-10 12:56:07 -05001193 if (skia_vtune_path != "") {
1194 public_defines += [ "SKVM_JIT_VTUNE" ]
1195 public_include_dirs = [ "$skia_vtune_path/include" ]
1196 libs = [ "$skia_vtune_path/lib64/jitprofiling.lib" ]
1197 }
Mike Klein613ad382019-06-06 11:42:02 -05001198}
1199
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001200if (skia_enable_gpu && skia_generate_workarounds) {
1201 action("workaround_list") {
1202 script = "tools/build_workaround_header.py"
1203
Mike Kleina01c6b02020-04-01 13:47:34 -05001204 inputs = [ "src/gpu/gpu_workaround_list.txt" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001205
1206 # see comments in skia_compile_processors about out dir path shenanigans.
1207 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -07001208 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001209
Mike Kleina01c6b02020-04-01 13:47:34 -05001210 outputs = [ "$root_out_dir/$output_file" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001211 args = [
1212 "--output-file",
1213 "$output_file",
1214 ]
1215
1216 foreach(file, inputs) {
1217 args += [ rebase_path(file, root_build_dir) ]
1218 }
1219 }
1220}
1221
mtkleinc04ff472016-06-23 10:29:30 -07001222component("skia") {
1223 public_configs = [ ":skia_public" ]
1224 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -07001225
Mike Klein607b0a72018-11-07 16:17:34 -05001226 public_deps = [
Ben Wagner32d5cfa2020-06-11 14:41:47 -04001227 ":fontmgr_FontConfigInterface",
1228 ":fontmgr_android",
1229 ":fontmgr_custom_directory",
1230 ":fontmgr_custom_embedded",
1231 ":fontmgr_custom_empty",
1232 ":fontmgr_fontconfig",
1233 ":fontmgr_fuchsia",
1234 ":fontmgr_mac_ct",
1235 ":fontmgr_win",
1236 ":fontmgr_win_gdi",
Ben Wagnere27ee6c2019-02-15 14:59:30 -05001237 ":gpu",
Mike Klein607b0a72018-11-07 16:17:34 -05001238 ":pdf",
1239 ":skcms",
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001240 ":xps",
Mike Klein607b0a72018-11-07 16:17:34 -05001241 ]
1242
mtkleinc04ff472016-06-23 10:29:30 -07001243 deps = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001244 ":android_utils",
anmittalb8b3f712016-08-25 04:55:19 -07001245 ":arm64",
1246 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -07001247 ":avx",
Mike Klein54378232018-11-08 12:08:05 +00001248 ":compile_processors",
anmittalb8b3f712016-08-25 04:55:19 -07001249 ":crc32",
Ethan Nicholasc18bb512020-07-28 14:46:53 -04001250 ":dehydrate_sksl",
Ben Wagner75626e42020-06-03 13:20:37 -04001251 ":fontmgr_factory",
Leon Scroggins III41169202019-01-29 09:29:57 -05001252 ":gif",
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001253 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -05001254 ":hsw",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001255 ":jpeg_decode",
1256 ":jpeg_encode",
Leon Scroggins III326b9892020-08-05 16:51:10 -04001257 ":ndk_images",
mtklein9b8583d2016-08-24 17:32:30 -07001258 ":none",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001259 ":png_decode",
1260 ":png_encode",
scroggof84ad642016-10-31 09:02:57 -07001261 ":raw",
Mike Klein613ad382019-06-06 11:42:02 -05001262 ":skvm_jit",
Mike Kleina9026da2020-06-05 08:57:05 -05001263 ":skx",
mtklein9b8583d2016-08-24 17:32:30 -07001264 ":sse2",
1265 ":sse41",
1266 ":sse42",
1267 ":ssse3",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001268 ":webp_decode",
1269 ":webp_encode",
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001270 ":wuffs",
mtklein63213812016-08-24 09:55:56 -07001271 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -07001272 ]
1273
Hal Canaryc25f4e92019-02-26 11:54:25 -05001274 public = skia_core_public
1275 public += skia_utils_public
1276 public += skia_effects_public
1277 public += skia_effects_imagefilter_public
Hal Canaryc25f4e92019-02-26 11:54:25 -05001278
mtkleinc04ff472016-06-23 10:29:30 -07001279 sources = []
brettwb9447282016-09-01 14:24:39 -07001280 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -07001281 sources += skia_utils_sources
Mike Klein54378232018-11-08 12:08:05 +00001282 sources += skia_effects_sources
1283 sources += skia_effects_imagefilter_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001284 sources += skia_sksl_sources
mtkleinc04ff472016-06-23 10:29:30 -07001285 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -04001286 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -05001287 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001288 "src/codec/SkAndroidCodec.cpp",
Nigel Tao612a65d2018-11-09 10:10:31 +11001289 "src/codec/SkAndroidCodecAdapter.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -04001290 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001291 "src/codec/SkBmpCodec.cpp",
1292 "src/codec/SkBmpMaskCodec.cpp",
1293 "src/codec/SkBmpRLECodec.cpp",
1294 "src/codec/SkBmpStandardCodec.cpp",
1295 "src/codec/SkCodec.cpp",
1296 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -04001297 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -04001298 "src/codec/SkEncodedInfo.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001299 "src/codec/SkMaskSwizzler.cpp",
1300 "src/codec/SkMasks.cpp",
Leon Scroggins IIIba458302019-09-24 12:40:11 -04001301 "src/codec/SkParseEncodedOrigin.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001302 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001303 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -07001304 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001305 "src/codec/SkSwizzler.cpp",
1306 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001307 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001308 "src/ports/SkDiscardableMemory_none.cpp",
Mike Klein54378232018-11-08 12:08:05 +00001309 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001310 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001311 "src/ports/SkMemory_malloc.cpp",
1312 "src/ports/SkOSFile_stdio.cpp",
1313 "src/sfnt/SkOTTable_name.cpp",
1314 "src/sfnt/SkOTUtils.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001315 ]
brettwb9447282016-09-01 14:24:39 -07001316
Leon Scroggins1340dbd2020-11-09 14:18:12 -05001317 defines = [ "SK_HAS_ANDROID_CODEC" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001318 libs = []
1319
mtkleinc04ff472016-06-23 10:29:30 -07001320 if (is_win) {
1321 sources += [
1322 "src/ports/SkDebug_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001323 "src/ports/SkImageEncoder_WIC.cpp",
1324 "src/ports/SkImageGeneratorWIC.cpp",
1325 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -07001326 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001327 ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001328 libs += [
Mike Klein4b167fc2016-10-11 18:13:53 -04001329 "Ole32.lib",
1330 "OleAut32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -04001331 ]
James Clarkeb8c0dab2021-02-09 06:22:41 -08001332
1333 if (!skia_enable_winuwp) {
1334 libs += [
1335 "FontSub.lib",
1336 "User32.lib",
1337 "Usp10.lib",
1338 ]
1339 }
mtkleinc04ff472016-06-23 10:29:30 -07001340 } else {
1341 sources += [
mtkleinc04ff472016-06-23 10:29:30 -07001342 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -07001343 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001344 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -04001345 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -07001346 }
1347
mtklein7d6fb2c2016-08-25 14:50:44 -07001348 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -05001349 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -05001350 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -05001351 deps += [ "//third_party/cpu-features" ]
1352 }
mtklein06c35c02016-09-20 12:28:12 -07001353 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001354 libs += [
1355 "EGL",
1356 "GLESv2",
1357 "log",
1358 ]
1359 }
1360
Kevin Lubick217056c2018-09-20 17:39:31 -04001361 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -07001362 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001363 if (skia_use_egl) {
1364 libs += [ "GLESv2" ]
1365 }
mtkleinc04ff472016-06-23 10:29:30 -07001366 }
1367
1368 if (is_mac) {
1369 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001370 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001371 "src/ports/SkImageEncoder_CG.cpp",
1372 "src/ports/SkImageGeneratorCG.cpp",
1373 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001374 frameworks = [
mtklein09e61f72016-08-23 13:35:28 -07001375 "ApplicationServices.framework",
1376 "OpenGL.framework",
1377 ]
mtkleinc04ff472016-06-23 10:29:30 -07001378 }
abarth6fc8ff02016-07-15 15:15:15 -07001379
Mike Klein7d302882016-11-03 14:06:31 -04001380 if (is_ios) {
1381 sources += [
1382 "src/ports/SkDebug_stdio.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001383 "src/ports/SkImageEncoder_CG.cpp",
1384 "src/ports/SkImageGeneratorCG.cpp",
1385 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001386 frameworks = [
Mike Klein7d302882016-11-03 14:06:31 -04001387 "CoreFoundation.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001388 "ImageIO.framework",
1389 "MobileCoreServices.framework",
1390 ]
1391 }
1392
abarth6fc8ff02016-07-15 15:15:15 -07001393 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001394 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001395 }
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001396
1397 if (skia_enable_spirv_validation) {
Corentin Wallez89d6e792021-03-08 15:25:34 +01001398 deps += [ "//third_party/externals/spirv-tools:spvtools_val" ]
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001399 defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
1400 }
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -04001401
1402 if (skia_include_multiframe_procs) {
1403 sources += [ "tools/SkSharingProc.cpp" ]
1404 }
mtkleinc04ff472016-06-23 10:29:30 -07001405}
1406
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001407# DebugCanvas used in experimental/wasm-skp-debugger
1408if (target_cpu == "wasm") {
1409 static_library("debugcanvas") {
1410 public_configs = [ ":skia_public" ]
1411
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001412 sources = [
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001413 "tools/SkSharingProc.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001414 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001415 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001416 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001417 "tools/debugger/DrawCommand.cpp",
1418 "tools/debugger/JsonWriteBuffer.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001419 ]
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001420 }
1421}
1422
Kevin Lubickcbcff382018-10-02 09:02:18 -04001423static_library("pathkit") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001424 check_includes = false
Kevin Lubickcbcff382018-10-02 09:02:18 -04001425 public_configs = [ ":skia_public" ]
1426 configs += skia_library_configs
1427
1428 deps = [
1429 ":arm64",
1430 ":armv7",
1431 ":avx",
1432 ":crc32",
1433 ":hsw",
1434 ":none",
1435 ":sse2",
1436 ":sse41",
1437 ":sse42",
1438 ":ssse3",
1439 ]
1440
Kevin Lubickcbcff382018-10-02 09:02:18 -04001441 sources = []
1442 sources += skia_pathops_sources
Hal Canaryc25f4e92019-02-26 11:54:25 -05001443 sources += skia_pathops_public
Kevin Lubickcbcff382018-10-02 09:02:18 -04001444 sources += [
1445 "src/core/SkAnalyticEdge.cpp",
1446 "src/core/SkArenaAlloc.cpp",
Mike Reedcc88f3a2019-02-06 11:40:27 -05001447 "src/core/SkContourMeasure.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001448 "src/core/SkCubicMap.cpp",
1449 "src/core/SkEdge.cpp",
1450 "src/core/SkEdgeBuilder.cpp",
1451 "src/core/SkEdgeClipper.cpp",
1452 "src/core/SkGeometry.cpp",
Brian Salomon71fe9452020-03-02 16:59:40 -05001453 "src/core/SkIDChangeListener.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001454 "src/core/SkLineClipper.cpp",
Hal Canary7823aeb2019-10-30 17:26:45 -04001455 "src/core/SkMalloc.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001456 "src/core/SkMallocPixelRef.cpp",
1457 "src/core/SkMath.cpp",
1458 "src/core/SkMatrix.cpp",
1459 "src/core/SkOpts.cpp",
1460 "src/core/SkPaint.cpp",
1461 "src/core/SkPath.cpp",
Mike Reed06d7c9d2020-08-26 12:56:51 -04001462 "src/core/SkPathBuilder.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001463 "src/core/SkPathEffect.cpp",
1464 "src/core/SkPathMeasure.cpp",
1465 "src/core/SkPathRef.cpp",
1466 "src/core/SkPoint.cpp",
1467 "src/core/SkRRect.cpp",
Mike Klein45f36b52020-06-08 14:10:29 -05001468 "src/core/SkReadBuffer.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001469 "src/core/SkRect.cpp",
1470 "src/core/SkSemaphore.cpp",
1471 "src/core/SkStream.cpp",
1472 "src/core/SkString.cpp",
1473 "src/core/SkStringUtils.cpp",
1474 "src/core/SkStroke.cpp",
1475 "src/core/SkStrokeRec.cpp",
1476 "src/core/SkStrokerPriv.cpp",
1477 "src/core/SkThreadID.cpp",
1478 "src/core/SkUtils.cpp",
1479 "src/effects/SkDashPathEffect.cpp",
1480 "src/effects/SkTrimPathEffect.cpp",
1481 "src/ports/SkDebug_stdio.cpp",
1482 "src/ports/SkMemory_malloc.cpp",
1483 "src/utils/SkDashPath.cpp",
1484 "src/utils/SkParse.cpp",
1485 "src/utils/SkParsePath.cpp",
1486 "src/utils/SkUTF.cpp",
1487 ]
1488}
1489
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001490group("modules") {
1491 deps = [
Kevin Lubick96634842019-03-05 14:09:24 -05001492 "modules/particles",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001493 "modules/skottie",
Mike Reed63559a52020-06-02 11:34:24 -04001494 "modules/skparagraph",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001495 "modules/skshaper",
Tyler Denniston333b9382021-03-18 13:48:52 -04001496 "modules/svg",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001497 ]
1498}
1499
Brian Osmancd28fa62020-07-07 16:01:26 -04001500config("our_vulkan_headers") {
1501 include_dirs = [ "include/third_party/vulkan" ]
1502}
1503
mtkleinc095df52016-08-24 12:23:52 -07001504# Targets guarded by skia_enable_tools may use //third_party freely.
1505if (skia_enable_tools) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001506 skia_public_includes = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001507 "client_utils/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001508 "include/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001509 "include/c",
1510 "include/codec",
1511 "include/config",
1512 "include/core",
1513 "include/docs",
1514 "include/effects",
1515 "include/encode",
1516 "include/gpu",
1517 "include/pathops",
1518 "include/ports",
1519 "include/svg",
1520 "include/utils",
1521 "include/utils/mac",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001522 "modules/particles/include",
1523 "modules/skottie/include",
Julia Lavrova70258c72020-07-15 11:28:57 -04001524 "modules/skparagraph/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001525 "modules/skshaper/include",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001526 "modules/svg/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001527 ]
1528
Mike Klein308b5ac2016-12-06 16:03:52 -05001529 # Used by gn_to_bp.py to list our public include dirs.
1530 source_set("public") {
1531 configs += [ ":skia_public" ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001532 include_dirs = skia_public_includes
Mike Klein308b5ac2016-12-06 16:03:52 -05001533 }
1534
Mike Kleinc36dedf2016-11-18 09:35:28 -05001535 config("skia.h_config") {
1536 include_dirs = [ "$target_gen_dir" ]
1537 }
1538 action("skia.h") {
1539 public_configs = [ ":skia.h_config" ]
1540 skia_h = "$target_gen_dir/skia.h"
1541 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001542
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001543 args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1544 [ rebase_path(skia_h, root_build_dir) ] +
1545 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001546 depfile = "$skia_h.deps"
Mike Kleina01c6b02020-04-01 13:47:34 -05001547 outputs = [ skia_h ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001548 }
1549
Brian Osmanc9a42472018-05-31 13:17:12 -04001550 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001551 executable("fiddle") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001552 check_includes = false
Mike Kleinc36dedf2016-11-18 09:35:28 -05001553 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001554 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001555 "tools/fiddle/draw.cpp",
1556 "tools/fiddle/fiddle_main.cpp",
1557 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001558
1559 if (skia_use_egl) {
1560 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001561 } else {
1562 sources += [ "tools/fiddle/null_context.cpp" ]
1563 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001564 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001565 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001566 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001567 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001568 ":skia",
1569 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001570 "modules/particles",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001571 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001572 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001573 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001574 "modules/svg",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001575 ]
1576 }
1577 }
1578
Mike Kleine5463e62020-06-11 13:53:53 -05001579 config("cpp14") {
1580 if (is_win) {
1581 cflags_cc = [ "/std:c++14" ]
1582 } else {
1583 cflags_cc = [ "-std=c++14" ]
1584 }
1585 }
1586
Brian Osmanc9a42472018-05-31 13:17:12 -04001587 source_set("public_headers_warnings_check") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001588 sources = [ "tools/public_headers_warnings_check.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001589 configs -= [ "//gn:warnings_except_public_headers" ]
Mike Kleine5463e62020-06-11 13:53:53 -05001590 configs += [
1591 ":our_vulkan_headers",
1592 ":cpp14",
1593 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001594 deps = [
1595 ":skia",
1596 ":skia.h",
1597 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001598 "modules/skshaper",
Brian Osmanc9a42472018-05-31 13:17:12 -04001599 ]
Stephen White0d70b712019-07-10 15:51:30 -04001600
1601 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001602 deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White0d70b712019-07-10 15:51:30 -04001603 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001604 }
1605
mtkleinc095df52016-08-24 12:23:52 -07001606 template("test_lib") {
1607 config(target_name + "_config") {
mtkleina627b5c2016-09-20 13:36:47 -07001608 if (defined(invoker.public_defines)) {
1609 defines = invoker.public_defines
1610 }
mtklein25c81d42016-07-27 13:55:26 -07001611 }
mtkleinc095df52016-08-24 12:23:52 -07001612 source_set(target_name) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001613 forward_variables_from(invoker, "*", [])
Hal Canaryc25f4e92019-02-26 11:54:25 -05001614 check_includes = false
mtkleinc095df52016-08-24 12:23:52 -07001615 public_configs = [
1616 ":" + target_name + "_config",
1617 ":skia_private",
1618 ]
1619
1620 if (!defined(deps)) {
1621 deps = []
1622 }
1623 deps += [ ":skia" ]
1624 testonly = true
1625 }
mtklein25c81d42016-07-27 13:55:26 -07001626 }
mtklein25c81d42016-07-27 13:55:26 -07001627
Mike Kleine6682eb2017-01-05 10:54:57 -05001628 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001629 if (is_ios) {
Hal Canary3388c1a2019-09-16 12:53:17 -04001630 ios_app_bundle(target_name) {
Jim Van Verth443a9132017-11-28 09:45:26 -05001631 forward_variables_from(invoker,
1632 "*",
1633 [
1634 "output_name",
1635 "visibility",
1636 "is_shared_library",
1637 ])
Mike Kleine6682eb2017-01-05 10:54:57 -05001638 testonly = true
Hal Canary3388c1a2019-09-16 12:53:17 -04001639 extra_configs = [ ":skia_private" ]
1640 launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard"
1641 data_sources = [ "resources" ]
1642 if ("True" == exec_script("//gn/checkdir.py",
1643 [ rebase_path("skps", root_build_dir) ],
1644 "trim string")) {
1645 data_sources += [ "skps" ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001646 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001647 }
1648 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001649 # !is_ios
1650
Jim Van Verth92411c72020-04-03 15:18:31 -04001651 output_dir = root_build_dir
Jim Van Verth443a9132017-11-28 09:45:26 -05001652 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1653 shared_library("lib" + target_name) {
1654 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1655 configs += [ ":skia_private" ]
1656 testonly = true
1657 }
1658 } else {
1659 _executable = target_name
1660 executable(_executable) {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001661 check_includes = false
Jim Van Verth443a9132017-11-28 09:45:26 -05001662 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1663 configs += [ ":skia_private" ]
1664 testonly = true
1665 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001666 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001667 if (is_android && skia_android_serial != "" && defined(_executable)) {
1668 action("push_" + target_name) {
1669 script = "gn/push_to_android.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05001670 deps = [ ":" + _executable ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001671 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
Mike Kleina01c6b02020-04-01 13:47:34 -05001672 outputs = [ _stamp ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001673 args = [
1674 rebase_path("$root_build_dir/$_executable"),
1675 skia_android_serial,
1676 rebase_path(_stamp),
1677 ]
1678 testonly = true
1679 }
Mike Klein7d921032017-01-05 12:20:41 -05001680 }
1681 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001682 }
1683
mtkleinc095df52016-08-24 12:23:52 -07001684 test_lib("gpu_tool_utils") {
Brian Osmanc9a42472018-05-31 13:17:12 -04001685 public_defines = []
mtkleind68f9b02016-09-23 13:18:41 -07001686
Mike Klein9e25bb92019-04-29 09:46:36 -05001687 # Bots and even devs may not have Vulkan headers, so put
1688 # include/third_party/vulkan on our path so they're always available.
1689 all_dependent_configs = [ ":our_vulkan_headers" ]
1690
Mike Klein333fb452019-04-24 08:48:11 -05001691 defines = []
1692 if (skia_enable_discrete_gpu) {
1693 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
1694 }
1695
Brian Osmanc9a42472018-05-31 13:17:12 -04001696 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001697 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001698 sources = [
Brian Salomon72c7b982020-10-06 10:07:38 -04001699 "tools/gpu/BackendSurfaceFactory.cpp",
1700 "tools/gpu/BackendSurfaceFactory.h",
Brian Salomon63a0a752020-06-26 13:32:09 -04001701 "tools/gpu/BackendTextureImageFactory.cpp",
1702 "tools/gpu/BackendTextureImageFactory.h",
Robert Phillips00f78de2020-07-01 16:09:43 -04001703 "tools/gpu/FlushFinishTracker.cpp",
1704 "tools/gpu/FlushFinishTracker.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001705 "tools/gpu/GrContextFactory.cpp",
1706 "tools/gpu/GrTest.cpp",
Brian Salomonf9b00422020-10-08 16:00:14 -04001707 "tools/gpu/ManagedBackendTexture.cpp",
1708 "tools/gpu/ManagedBackendTexture.h",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001709 "tools/gpu/MemoryCache.cpp",
1710 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001711 "tools/gpu/ProxyUtils.cpp",
1712 "tools/gpu/TestContext.cpp",
Brian Salomone21af502019-11-22 16:56:36 -05001713 "tools/gpu/TestOps.cpp",
1714 "tools/gpu/TestOps.h",
Michael Ludwigd9958f82019-03-21 13:08:36 -04001715 "tools/gpu/YUVUtils.cpp",
1716 "tools/gpu/YUVUtils.h",
Mike Kleina01c6b02020-04-01 13:47:34 -05001717 "tools/gpu/gl/GLTestContext.cpp", # See comment below about
1718 # GrContextFactory workaround.
Brian Osmanc9a42472018-05-31 13:17:12 -04001719 "tools/gpu/mock/MockTestContext.cpp",
1720 ]
Brian Salomon1171d312020-03-19 08:47:44 -04001721
1722 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001723 frameworks = []
Brian Salomon1171d312020-03-19 08:47:44 -04001724
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001725 if (skia_use_gl) {
Herb Derby64aa5132020-06-03 12:14:55 -04001726 sources +=
1727 [ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001728 if (is_ios) {
1729 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001730 frameworks += [ "OpenGLES.framework" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001731 } else if (is_mac) {
1732 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -05001733 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001734 if (skia_use_angle) {
1735 deps += [ "//third_party/angle2" ]
1736 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1737 }
Brian Salomon1171d312020-03-19 08:47:44 -04001738 }
1739
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001740 # We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in
1741 # in GrContextFactory. This only matters for OSes that can run Vulkan.
Chris Dalton2b598902020-03-25 10:50:35 -06001742 if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001743 if (is_android || skia_use_egl) {
1744 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1745 libs += [ "EGL" ]
1746 } else if (is_linux) {
1747 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
1748 libs += [
1749 "GLU",
1750 "GL",
1751 "X11",
1752 ]
1753 } else if (is_win) {
1754 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1755 libs += [ "Gdi32.lib" ]
1756 if (target_cpu != "arm64") {
1757 libs += [ "OpenGL32.lib" ]
1758 }
1759 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001760 }
Greg Daniel54200e42018-12-11 17:03:39 -05001761
Brian Osmanc9a42472018-05-31 13:17:12 -04001762 if (skia_use_vulkan) {
Robert Phillipsae413d82020-06-10 11:04:51 -04001763 sources += [ "tools/gpu/vk/VkTestContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001764 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Robert Phillips0d6ce7c2020-06-11 08:51:50 -04001765 sources += [ "tools/gpu/vk/VkTestHelper.h" ]
1766 sources += [ "tools/gpu/vk/VkTestHelper.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001767 sources += [ "tools/gpu/vk/VkTestUtils.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001768 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001769 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.h" ]
1770 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001771 }
1772 if (skia_use_metal) {
1773 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001774 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001775 if (skia_use_direct3d) {
1776 sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ]
Jim Van Verth03b8ab22020-02-24 11:36:15 -05001777 sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001778 }
Stephen White985741a2019-07-18 11:43:45 -04001779 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001780 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White985741a2019-07-18 11:43:45 -04001781 sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
Stephen White3ae5b292020-06-01 15:45:56 -04001782 if (is_clang) {
1783 cflags_cc = [ "-Wno-microsoft-cast" ]
1784 }
Stephen White985741a2019-07-18 11:43:45 -04001785 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001786
1787 if (is_fuchsia && using_fuchsia_sdk) {
1788 libs +=
1789 [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
1790 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001791 } # test_lib("gpu_tool_utils")
mtklein25c81d42016-07-27 13:55:26 -07001792
mtkleinc095df52016-08-24 12:23:52 -07001793 test_lib("flags") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001794 sources = [ "tools/flags/CommandLineFlags.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07001795 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001796
1797 test_lib("common_flags_config") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001798 sources = [ "tools/flags/CommonFlagsConfig.cpp" ]
1799 deps = [ ":flags" ]
1800 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001801 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001802 test_lib("common_flags_gpu") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001803 sources = [ "tools/flags/CommonFlagsGpu.cpp" ]
1804 deps = [ ":flags" ]
1805 public_deps = [ ":gpu_tool_utils" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001806 }
1807 test_lib("common_flags_images") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001808 sources = [ "tools/flags/CommonFlagsImages.cpp" ]
1809 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001810 }
1811 test_lib("common_flags_aa") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001812 sources = [ "tools/flags/CommonFlagsAA.cpp" ]
1813 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001814 }
mtklein25c81d42016-07-27 13:55:26 -07001815
Mike Klein499f0ac2019-03-25 13:00:12 -05001816 test_lib("trace") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001817 deps = [ ":flags" ]
Mike Klein499f0ac2019-03-25 13:00:12 -05001818 sources = [
1819 "tools/trace/ChromeTracingTracer.cpp",
1820 "tools/trace/ChromeTracingTracer.h",
1821 "tools/trace/EventTracingPriv.cpp",
1822 "tools/trace/EventTracingPriv.h",
1823 "tools/trace/SkDebugfTracer.cpp",
1824 "tools/trace/SkDebugfTracer.h",
1825 ]
1826 }
1827
mtkleinc095df52016-08-24 12:23:52 -07001828 test_lib("tool_utils") {
mtkleinc095df52016-08-24 12:23:52 -07001829 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001830 "tools/AndroidSkDebugToStdOut.cpp",
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001831 "tools/AutoreleasePool.h",
Robert Phillips96601082018-05-29 16:13:26 -04001832 "tools/DDLPromiseImageHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001833 "tools/DDLPromiseImageHelper.h",
Robert Phillips96601082018-05-29 16:13:26 -04001834 "tools/DDLTileHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001835 "tools/DDLTileHelper.h",
mtklein0590fa52016-09-01 07:06:54 -07001836 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001837 "tools/ProcStats.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001838 "tools/ProcStats.h",
mtkleinc095df52016-08-24 12:23:52 -07001839 "tools/Resources.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001840 "tools/Resources.h",
Hal Canarye574f1e2019-07-15 14:01:37 -04001841 "tools/SkMetaData.cpp",
1842 "tools/SkMetaData.h",
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001843 "tools/SkSharingProc.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001844 "tools/SkSharingProc.h",
1845 "tools/Stats.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001846 "tools/ToolUtils.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001847 "tools/ToolUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001848 "tools/UrlDataManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001849 "tools/UrlDataManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001850 "tools/debugger/DebugCanvas.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001851 "tools/debugger/DebugCanvas.h",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001852 "tools/debugger/DebugLayerManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001853 "tools/debugger/DebugLayerManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001854 "tools/debugger/DrawCommand.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001855 "tools/debugger/DrawCommand.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001856 "tools/debugger/JsonWriteBuffer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001857 "tools/debugger/JsonWriteBuffer.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001858 "tools/fonts/RandomScalerContext.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001859 "tools/fonts/RandomScalerContext.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001860 "tools/fonts/TestEmptyTypeface.h",
1861 "tools/fonts/TestFontMgr.cpp",
1862 "tools/fonts/TestFontMgr.h",
1863 "tools/fonts/TestSVGTypeface.cpp",
1864 "tools/fonts/TestSVGTypeface.h",
1865 "tools/fonts/TestTypeface.cpp",
1866 "tools/fonts/TestTypeface.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001867 "tools/fonts/ToolUtilsFont.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001868 "tools/random_parse_path.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001869 "tools/random_parse_path.h",
Hal Canary41248072019-07-11 16:32:53 -04001870 "tools/timer/TimeUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001871 "tools/timer/Timer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001872 "tools/timer/Timer.h",
mtkleinc095df52016-08-24 12:23:52 -07001873 ]
Chris Dalton2b598902020-03-25 10:50:35 -06001874 if (target_cpu != "wasm") {
1875 sources += [ "tools/CrashHandler.cpp" ]
1876 }
Mike Kleinadacaef2017-02-06 09:26:14 -05001877 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001878 frameworks = []
Mike Kleinadacaef2017-02-06 09:26:14 -05001879 if (is_ios) {
1880 sources += [ "tools/ios_utils.m" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001881 sources += [ "tools/ios_utils.h" ]
1882 if (skia_use_metal) {
1883 sources += [ "tools/AutoreleasePool.mm" ]
1884 }
Jim Van Verthef820be2020-08-12 10:45:00 -04001885 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001886 } else if (is_mac) {
1887 if (skia_use_metal) {
1888 sources += [ "tools/AutoreleasePool.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001889 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001890 }
James Clarkeb8c0dab2021-02-09 06:22:41 -08001891 } else if (is_win && !skia_enable_winuwp) {
Mike Kleinbf15b662019-04-15 11:32:16 -05001892 libs += [ "DbgHelp.lib" ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001893 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001894
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001895 defines = []
1896 if (skia_tools_require_resources) {
1897 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1898 }
mtkleinc095df52016-08-24 12:23:52 -07001899 deps = [
1900 ":flags",
Florin Malitab3418102020-10-15 18:10:29 -04001901 "modules/svg",
Mike Kleine4ad58a2019-03-26 09:05:52 -05001902 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05001903 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001904 }
mtklein25c81d42016-07-27 13:55:26 -07001905
Mike Kleine11e5c12019-04-24 12:46:06 -05001906 test_lib("etc1") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001907 sources = [ "third_party/etc1/etc1.cpp" ]
Mike Kleine11e5c12019-04-24 12:46:06 -05001908 }
1909
Mike Klein6e744122016-10-27 12:21:40 -04001910 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001911 test_lib("gm") {
mtkleinc095df52016-08-24 12:23:52 -07001912 sources = gm_sources
John Rosasco24cbdab2019-09-25 14:14:35 -07001913 if (skia_use_gl) {
1914 sources += gl_gm_sources
1915 }
mtkleinc095df52016-08-24 12:23:52 -07001916 deps = [
Mike Kleine11e5c12019-04-24 12:46:06 -05001917 ":etc1",
scroggo19b91532016-10-24 09:03:26 -07001918 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001919 ":skia",
1920 ":tool_utils",
Brian Osman84d884a2021-01-29 16:35:45 -05001921 "modules/particles",
Mike Reed2f0edd52018-05-31 14:22:30 -04001922 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001923 "modules/skottie:gm",
Mike Reed63559a52020-06-02 11:34:24 -04001924 "modules/skparagraph",
1925 "modules/skparagraph:gm",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001926 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001927 ]
Mike Kleinc4abade2019-08-09 10:11:35 -04001928 if (is_skia_dev_build) {
1929 sources += [ "gm/fiddle.cpp" ]
1930 deps += [ ":skia.h" ]
1931 }
Mike Kleina01c6b02020-04-01 13:47:34 -05001932 public_deps = [ ":gpu_tool_utils" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001933
1934 if (skia_use_ffmpeg) {
Florin Malita123e3b82020-04-24 11:10:27 -04001935 deps += [ "experimental/ffmpeg:video_decoder" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001936 sources += [ "gm/video_decoder.cpp" ]
1937 }
mtkleinc095df52016-08-24 12:23:52 -07001938 }
mtklein25c81d42016-07-27 13:55:26 -07001939
Ben Wagnerbded42a2021-02-17 22:14:34 -05001940 test_lib("test") {
1941 sources = [
1942 "tests/Test.cpp",
1943 "tests/Test.h",
1944 "tests/TestUtils.cpp",
1945 "tests/TestUtils.h",
1946 ]
1947 deps = [
1948 ":flags",
1949 ":skia",
1950 ":tool_utils",
1951 ]
1952 public_deps = [
1953 ":gpu_tool_utils", # Test.h #includes headers from this target.
1954 ]
1955 }
1956
Mike Klein6e744122016-10-27 12:21:40 -04001957 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001958 test_lib("tests") {
Mike Klein6e744122016-10-27 12:21:40 -04001959 sources = tests_sources + pathops_tests_sources
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001960 frameworks = []
Robert Phillips0c6daf02019-05-16 12:43:11 -04001961 if (skia_use_metal) {
1962 sources += metal_tests_sources
Jim Van Verth36b86af2020-08-24 17:16:46 +00001963 cflags_objcc = [ "-fobjc-arc" ]
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001964 frameworks += [ "MetalKit.framework" ]
Robert Phillips0c6daf02019-05-16 12:43:11 -04001965 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001966 if (skia_use_gl) {
1967 sources += gl_tests_sources
1968 }
mtkleinc095df52016-08-24 12:23:52 -07001969 deps = [
1970 ":flags",
Ben Wagnere75021e2021-02-17 22:18:34 -05001971 ":fontmgr_android_tests",
1972 ":fontmgr_fontconfig_tests",
Ben Wagnera3e5e552021-02-22 15:37:33 +00001973 ":fontmgr_mac_ct_tests",
mtkleinc095df52016-08-24 12:23:52 -07001974 ":skia",
Ben Wagnerbded42a2021-02-17 22:14:34 -05001975 ":test",
mtkleinc095df52016-08-24 12:23:52 -07001976 ":tool_utils",
Florin Malita26ae40f2020-06-08 12:03:48 -04001977 "experimental/skrive:tests",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001978 "modules/skottie:tests",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001979 "modules/skparagraph:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001980 "modules/sksg:tests",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001981 "modules/skshaper",
Florin Malitadec78022020-12-17 16:36:54 -05001982 "modules/svg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001983 "//third_party/libpng",
Leon Scroggins III194580d2019-02-22 12:32:16 -05001984 "//third_party/libwebp",
mtkleinc095df52016-08-24 12:23:52 -07001985 "//third_party/zlib",
1986 ]
1987 }
mtklein2f3416d2016-08-02 16:02:05 -07001988
Mike Klein6e744122016-10-27 12:21:40 -04001989 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001990 test_lib("bench") {
mtkleinc095df52016-08-24 12:23:52 -07001991 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001992 deps = [
1993 ":flags",
1994 ":gm",
1995 ":gpu_tool_utils",
1996 ":skia",
1997 ":tool_utils",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001998 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04001999 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07002000 ]
2001 }
mtklein2b6870c2016-07-28 14:17:33 -07002002
Mike Reedd62d4062019-06-12 10:20:44 -04002003 test_lib("experimental_xform") {
2004 sources = [
2005 "experimental/xform/SkShape.cpp",
2006 "experimental/xform/SkXform.cpp",
2007 "experimental/xform/XContext.cpp",
2008 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05002009 deps = [ ":skia" ]
Mike Reedd62d4062019-06-12 10:20:44 -04002010 }
2011
Florin Malitabfe876a2018-09-02 12:33:59 -04002012 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04002013 test_app("skottie_tool") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002014 deps = [ "modules/skottie:tool" ]
Florin Malita79725d32018-06-05 16:16:57 -04002015 }
Florin Malitab3418102020-10-15 18:10:29 -04002016 test_app("svg_tool") {
2017 deps = [ "modules/svg:tool" ]
2018 }
Florin Malita79725d32018-06-05 16:16:57 -04002019 }
2020
Hal Canary5b39dc82019-04-17 13:29:46 -04002021 test_app("make_skqp_model") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002022 sources = [ "tools/skqp/make_skqp_model.cpp" ]
2023 deps = [ ":skia" ]
Hal Canary5b39dc82019-04-17 13:29:46 -04002024 }
2025
Chris Dalton2b598902020-03-25 10:50:35 -06002026 import("gn/samples.gni")
2027 test_lib("samples") {
2028 sources = samples_sources
Mike Kleina01c6b02020-04-01 13:47:34 -05002029 public_deps = [ ":tool_utils" ]
Chris Dalton2b598902020-03-25 10:50:35 -06002030 deps = [
Chris Dalton2b598902020-03-25 10:50:35 -06002031 ":flags",
2032 ":gpu_tool_utils",
2033 ":xml",
Jorge Betancourtb8621312020-09-10 15:16:35 -04002034 "modules/audioplayer",
Chris Dalton2b598902020-03-25 10:50:35 -06002035 "modules/skparagraph:samples",
2036 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002037 "modules/svg",
Tyler Denniston189ecd42020-10-22 15:40:49 -04002038 "//third_party/imgui",
Chris Dalton2b598902020-03-25 10:50:35 -06002039 ]
Chris Dalton2b598902020-03-25 10:50:35 -06002040 }
Kevin Lubick00398742020-10-08 10:05:07 -04002041 test_lib("hash_and_encode") {
2042 sources = [
2043 "tools/HashAndEncode.cpp",
2044 "tools/HashAndEncode.h",
2045 ]
2046 deps = [
2047 ":flags",
2048 ":skia",
2049 "//third_party/libpng",
2050 ]
2051 }
Chris Dalton2b598902020-03-25 10:50:35 -06002052 if (target_cpu != "wasm") {
Nigel Tao3ab9b1f2020-05-28 13:29:13 +10002053 test_app("convert-to-nia") {
2054 sources = [ "tools/convert-to-nia.cpp" ]
2055 deps = [ ":skia" ]
2056 }
Mike Klein7af351a2018-07-27 09:54:43 -04002057 test_app("imgcvt") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002058 sources = [ "tools/imgcvt.cpp" ]
Mike Klein7af351a2018-07-27 09:54:43 -04002059 deps = [
2060 ":skcms",
2061 ":skia",
2062 ]
2063 }
Mike Klein735c7ba2019-03-25 12:57:58 -05002064 test_app("fm") {
2065 sources = [
Mike Kleinfee00792019-11-21 16:18:47 -06002066 "dm/DMGpuTestProcs.cpp", # blech
Mike Klein735c7ba2019-03-25 12:57:58 -05002067 "tools/fm/fm.cpp",
2068 ]
2069 deps = [
2070 ":common_flags_aa",
2071 ":common_flags_gpu",
2072 ":flags",
2073 ":gm",
2074 ":gpu_tool_utils",
2075 ":hash_and_encode",
2076 ":skia",
Mike Kleinfee00792019-11-21 16:18:47 -06002077 ":tests",
Mike Klein735c7ba2019-03-25 12:57:58 -05002078 ":tool_utils",
2079 ":trace",
Mike Klein22924262019-04-02 14:14:56 -04002080 "modules/skottie",
2081 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002082 "modules/svg",
Mike Klein735c7ba2019-03-25 12:57:58 -05002083 ]
2084 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04002085 test_app("dm") {
2086 sources = [
2087 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04002088 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002089 "dm/DMJsonWriter.cpp",
2090 "dm/DMSrcSink.cpp",
2091 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04002092 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002093 ":common_flags_aa",
2094 ":common_flags_config",
2095 ":common_flags_gpu",
2096 ":common_flags_images",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002097 ":flags",
2098 ":gm",
2099 ":gpu_tool_utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05002100 ":hash_and_encode",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002101 ":skia",
2102 ":tests",
2103 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002104 ":trace",
Florin Malita02616ea2020-06-25 13:33:17 -04002105 "experimental/skrive",
Florin Malita3d856bd2018-05-26 09:49:28 -04002106 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05002107 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002108 "modules/svg",
Mike Klein38af9432016-11-11 11:39:44 -05002109 ]
2110 }
Robert Phillipscd1e3972021-02-22 17:24:22 -05002111 test_app("ddlbench") {
2112 sources = [ "experimental/ddlbench/ddlbench.cpp" ]
2113 deps = [
2114 ":flags",
2115 ":skia",
2116 ":tool_utils",
2117 ]
2118 }
Michael Ludwig30217952020-12-04 12:58:35 -05002119
2120 # optional separate library to dlopen when running CanvasStateTests.
2121 shared_library("canvas_state_lib") {
2122 sources = [
2123 "tests/CanvasStateHelpers.cpp",
2124 "tests/CanvasStateHelpers.h",
2125 ]
2126 deps = [ ":skia" ]
2127 }
Brian Osman16adfa32016-10-18 14:42:44 -04002128 }
2129
Mike Kleina8a51ce2018-01-09 12:34:11 -05002130 if (!is_win) {
2131 test_app("remote_demo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002132 sources = [ "tools/remote_demo.cpp" ]
2133 deps = [ ":skia" ]
Mike Kleina8a51ce2018-01-09 12:34:11 -05002134 }
2135 }
2136
Hal Canarye107faa2019-10-23 12:52:33 -04002137 if (!is_win) {
2138 test_app("blob_cache_sim") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002139 sources = [ "tools/blob_cache_sim.cpp" ]
2140 deps = [ ":skia" ]
Hal Canarye107faa2019-10-23 12:52:33 -04002141 }
2142 }
2143
Mike Kleine6682eb2017-01-05 10:54:57 -05002144 test_app("nanobench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002145 sources = [ "bench/nanobench.cpp" ]
mtklein2b6870c2016-07-28 14:17:33 -07002146 deps = [
2147 ":bench",
Mike Kleinc6142d82019-03-25 10:54:59 -05002148 ":common_flags_aa",
2149 ":common_flags_config",
2150 ":common_flags_gpu",
2151 ":common_flags_images",
mtklein2b6870c2016-07-28 14:17:33 -07002152 ":flags",
2153 ":gm",
2154 ":gpu_tool_utils",
2155 ":skia",
2156 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002157 ":trace",
Mike Reed63559a52020-06-02 11:34:24 -04002158 "modules/skparagraph",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002159 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002160 "modules/svg",
mtklein2b6870c2016-07-28 14:17:33 -07002161 ]
mtklein2b6870c2016-07-28 14:17:33 -07002162 }
halcanary19a97202016-08-03 15:08:04 -07002163
Ravi Mistry10d36c52017-01-31 09:49:18 -05002164 test_app("skpinfo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002165 sources = [ "tools/skpinfo.cpp" ]
Ravi Mistry10d36c52017-01-31 09:49:18 -05002166 deps = [
2167 ":flags",
2168 ":skia",
2169 ]
2170 }
2171
Mike Reedc0ee21f2019-05-28 16:11:03 -04002172 if (skia_use_ffmpeg) {
2173 test_app("skottie2movie") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002174 sources = [ "tools/skottie2movie.cpp" ]
Mike Reedc0ee21f2019-05-28 16:11:03 -04002175 deps = [
2176 ":flags",
Mike Reed5f12eaa2019-09-24 12:01:58 -04002177 ":gpu_tool_utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002178 ":skia",
Florin Malitaec403602020-04-24 12:14:03 -04002179 "experimental/ffmpeg:video_encoder",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002180 "modules/skottie",
Mike Reed5093e232019-05-30 10:10:50 -04002181 "modules/skottie:utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002182 ]
2183 }
2184 }
2185
Brian Osmanc9a42472018-05-31 13:17:12 -04002186 test_app("skpbench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002187 sources = [ "tools/skpbench/skpbench.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002188 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002189 ":common_flags_config",
2190 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002191 ":flags",
2192 ":gpu_tool_utils",
2193 ":skia",
2194 ":tool_utils",
2195 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07002196 }
2197
Mike Kleine6682eb2017-01-05 10:54:57 -05002198 test_app("sktexttopdf") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002199 sources = [ "tools/using_skia_and_harfbuzz.cpp" ]
halcanary3eee9d92016-09-10 07:01:53 -07002200 deps = [
2201 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04002202 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07002203 ]
halcanary3eee9d92016-09-10 07:01:53 -07002204 }
mtklein046cb562016-09-16 10:23:12 -07002205
Ben Wagner219f3622017-07-17 15:32:25 -04002206 test_app("create_test_font") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002207 sources = [ "tools/fonts/create_test_font.cpp" ]
2208 deps = [ ":skia" ]
Ben Wagner219f3622017-07-17 15:32:25 -04002209 assert_no_deps = [
2210 # tool_utils requires the output of this app.
2211 ":tool_utils",
2212 ]
2213 }
2214
Florin Malita5d3ff432018-07-31 16:38:43 -04002215 if (skia_use_expat) {
2216 test_app("create_test_font_color") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002217 sources = [ "tools/fonts/create_test_font_color.cpp" ]
Florin Malita5d3ff432018-07-31 16:38:43 -04002218 deps = [
2219 ":flags",
2220 ":skia",
2221 ":tool_utils",
2222 ]
2223 }
Ben Wagner97182cc2018-02-15 10:20:04 -05002224 }
2225
Mike Kleine6682eb2017-01-05 10:54:57 -05002226 test_app("get_images_from_skps") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002227 sources = [ "tools/get_images_from_skps.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07002228 deps = [
2229 ":flags",
2230 ":skia",
mtklein046cb562016-09-16 10:23:12 -07002231 ]
mtklein046cb562016-09-16 10:23:12 -07002232 }
mtkleinecbc5262016-09-22 11:51:24 -07002233
Brian Osman6788a542018-12-10 11:56:01 -05002234 if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
Mike Kleine6682eb2017-01-05 10:54:57 -05002235 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04002236 sources = [
2237 "tools/skiaserve/Request.cpp",
2238 "tools/skiaserve/Response.cpp",
2239 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002240 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
2241 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
2242 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
2243 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
2244 "tools/skiaserve/urlhandlers/DataHandler.cpp",
2245 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
2246 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
2247 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
2248 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05002249 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
2250 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002251 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
2252 "tools/skiaserve/urlhandlers/PostHandler.cpp",
2253 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
2254 "tools/skiaserve/urlhandlers/RootHandler.cpp",
2255 ]
2256 deps = [
2257 ":flags",
2258 ":gpu_tool_utils",
2259 ":skia",
2260 ":tool_utils",
Mike Klein7d302882016-11-03 14:06:31 -04002261 "//third_party/libmicrohttpd",
Mike Klein7d302882016-11-03 14:06:31 -04002262 ]
Mike Klein7d302882016-11-03 14:06:31 -04002263 }
mtkleinecbc5262016-09-22 11:51:24 -07002264 }
kjlubick14f984b2016-10-03 11:49:45 -07002265
Mike Kleine6682eb2017-01-05 10:54:57 -05002266 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07002267 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002268 "fuzz/Fuzz.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002269 "fuzz/Fuzz.h",
Hal Canary24ac42b2017-02-14 13:35:14 -05002270 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002271 "fuzz/FuzzCommon.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002272 "fuzz/FuzzCommon.h",
Zepeng Hu94007012020-07-22 14:37:46 +00002273 "fuzz/FuzzCreateDDL.cpp",
Adlai Hollerea8d1972021-02-23 13:05:32 -05002274 "fuzz/FuzzDDLThreading.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05002275 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04002276 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002277 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002278 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002279 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002280 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002281 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04002282 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04002283 "fuzz/FuzzRegionOp.cpp",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002284 "fuzz/FuzzSkParagraph.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002285 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05002286 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
2287 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002288 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002289 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04002290 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002291 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05002292 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
2293 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Zepeng Hufcb7ba02020-07-31 17:21:29 +00002294 "fuzz/oss_fuzz/FuzzSKP.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002295 "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
2296 "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
Kevin Lubick0f0a7102019-03-18 16:20:55 -04002297 "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002298 "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
Zepeng Huedaf3022020-06-12 12:20:59 +00002299 "fuzz/oss_fuzz/FuzzSVG.cpp",
Kevin Lubick2be14d32019-10-21 13:44:48 -04002300 "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp",
Weston Tracey1a771fe2021-02-04 11:09:59 -05002301 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
Zepeng Hua5783f32020-07-10 13:36:20 +00002302 "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002303 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05002304 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002305 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002306 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002307 "tools/debugger/DrawCommand.cpp",
2308 "tools/debugger/JsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002309 ]
2310 deps = [
2311 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04002312 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07002313 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04002314 "modules/skottie:fuzz",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002315 "modules/skparagraph",
kjlubick14f984b2016-10-03 11:49:45 -07002316 ]
kjlubick14f984b2016-10-03 11:49:45 -07002317 }
Mike Klein38312422016-10-05 15:41:01 -04002318
Mike Kleine6682eb2017-01-05 10:54:57 -05002319 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04002320 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04002321 rebase_path("tests/skia_test.cpp"),
2322 rebase_path("tests/Test.cpp"),
2323 ]
caryclark9feb6322016-10-25 08:58:26 -07002324 deps = [
2325 ":flags",
2326 ":gpu_tool_utils",
2327 ":skia",
2328 ":tool_utils",
2329 ]
caryclark9feb6322016-10-25 08:58:26 -07002330 }
2331
Mike Kleine6682eb2017-01-05 10:54:57 -05002332 test_app("dump_record") {
Mike Klein4a56f4c2020-08-18 16:02:52 -05002333 sources = [ "tools/dump_record.cpp" ]
Mike Klein38312422016-10-05 15:41:01 -04002334 deps = [
2335 ":flags",
2336 ":skia",
2337 ]
Mike Klein38312422016-10-05 15:41:01 -04002338 }
bungemanfe917272016-10-13 17:36:40 -04002339
Mike Kleine6682eb2017-01-05 10:54:57 -05002340 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04002341 sources = [
2342 "tools/skdiff/skdiff.cpp",
2343 "tools/skdiff/skdiff_html.cpp",
2344 "tools/skdiff/skdiff_main.cpp",
2345 "tools/skdiff/skdiff_utils.cpp",
2346 ]
2347 deps = [
2348 ":skia",
2349 ":tool_utils",
2350 ]
bungemanfe917272016-10-13 17:36:40 -04002351 }
halcanarya73d76a2016-10-17 13:19:02 -07002352
Mike Kleine6682eb2017-01-05 10:54:57 -05002353 test_app("skp_parser") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002354 sources = [ "tools/skp_parser.cpp" ]
halcanarya73d76a2016-10-17 13:19:02 -07002355 deps = [
2356 ":skia",
2357 ":tool_utils",
halcanarya73d76a2016-10-17 13:19:02 -07002358 ]
halcanarya73d76a2016-10-17 13:19:02 -07002359 }
Brian Osman16adfa32016-10-18 14:42:44 -04002360
Brian Osmanc9a42472018-05-31 13:17:12 -04002361 if (!is_win) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002362 source_set("skqp_lib") {
2363 check_includes = false
2364 testonly = true
2365 if (!is_official_build) {
2366 configs -= [ "//gn:warnings" ]
2367 }
2368 public_configs = [ ":skia_private" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05002369 defines =
2370 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary75427132017-10-11 16:00:31 -04002371 sources = [
2372 "dm/DMGpuTestProcs.cpp",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002373 "tools/skqp/src/skqp.cpp",
2374 "tools/skqp/src/skqp_model.cpp",
Hal Canary75427132017-10-11 16:00:31 -04002375 ]
2376 deps = [
2377 ":gm",
Hal Canary75427132017-10-11 16:00:31 -04002378 ":skia",
2379 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05002380 ":tool_utils",
2381 ]
2382 }
2383 test_app("skqp") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002384 sources = [ "tools/skqp/src/skqp_main.cpp" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002385 include_dirs = [ "//" ]
2386 lib_dirs = []
Mike Kleina01c6b02020-04-01 13:47:34 -05002387 deps = [ ":skqp_lib" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002388 }
2389 test_app("jitter_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002390 sources = [ "tools/skqp/jitter_gms.cpp" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002391 deps = [
2392 ":gm",
2393 ":skia",
2394 ":skqp_lib",
Hal Canary75427132017-10-11 16:00:31 -04002395 ]
2396 }
2397 }
John Rosasco24cbdab2019-09-25 14:14:35 -07002398 if (is_fuchsia) {
2399 # Build a package repository for skqp on Fuchsia.
2400 group("skqp_repo") {
2401 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002402 deps = [ "//build/fuchsia/skqp:skqp_repo" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002403 }
2404 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002405 if (is_android) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002406 shared_library("libskqp_app") {
2407 configs += [ ":skia_private" ]
2408 if (!is_official_build) {
2409 configs -= [ "//gn:warnings" ]
2410 }
2411 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002412 sources = [ "tools/skqp/src/jni_skqp.cpp" ]
Hal Canary28f89382017-12-12 09:42:14 -05002413 deps = [
2414 ":skia",
2415 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05002416 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05002417 ]
2418 libs = [ "android" ]
2419 }
2420 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002421 if (is_android && skia_use_gl) {
Stan Iliev93151722018-08-02 11:10:52 -04002422 test_app("skottie_android") {
2423 is_shared_library = true
2424
Jorge Betancourt1fcdcaa2020-06-22 14:14:32 +00002425 sources = [ "platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp" ]
Stan Iliev93151722018-08-02 11:10:52 -04002426 libs = []
2427
Stan Iliev93151722018-08-02 11:10:52 -04002428 deps = [
2429 ":skia",
2430 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04002431 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04002432 ]
2433 }
2434 }
Hal Canary75427132017-10-11 16:00:31 -04002435
Hal Canarya9de7602018-01-19 13:08:23 -05002436 test_app("list_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002437 sources = [ "tools/list_gms.cpp" ]
Hal Canarya9de7602018-01-19 13:08:23 -05002438 deps = [
2439 ":gm",
2440 ":skia",
2441 ]
2442 }
2443 test_app("list_gpu_unit_tests") {
2444 sources = [
2445 "dm/DMGpuTestProcs.cpp",
2446 "tools/list_gpu_unit_tests.cpp",
2447 ]
2448 deps = [
2449 ":skia",
2450 ":tests",
2451 ]
2452 }
2453
Brian Osmanc9a42472018-05-31 13:17:12 -04002454 test_lib("sk_app") {
Hal Canary378be8d2019-04-26 08:20:14 -04002455 public_deps = [
Hal Canary378be8d2019-04-26 08:20:14 -04002456 ":gpu_tool_utils",
Hal Canary05694472019-05-03 17:14:21 -04002457 ":skia",
Hal Canary378be8d2019-04-26 08:20:14 -04002458 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002459 sources = [
John Stilesab9578e2020-06-30 17:36:55 -04002460 "tools/sk_app/Application.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002461 "tools/sk_app/CommandSet.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002462 "tools/sk_app/CommandSet.h",
2463 "tools/sk_app/DisplayParams.h",
2464 "tools/sk_app/RasterWindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002465 "tools/sk_app/Window.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002466 "tools/sk_app/Window.h",
Robert Phillipsed653392020-07-10 13:55:21 -04002467 "tools/sk_app/WindowContext.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002468 "tools/sk_app/WindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002469 ]
2470 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04002471 frameworks = []
Brian Osmanc9a42472018-05-31 13:17:12 -04002472
2473 if (is_android) {
2474 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002475 "tools/sk_app/android/RasterWindowContext_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002476 "tools/sk_app/android/WindowContextFactory_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002477 "tools/sk_app/android/Window_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002478 "tools/sk_app/android/Window_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002479 "tools/sk_app/android/main_android.cpp",
2480 "tools/sk_app/android/surface_glue_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002481 "tools/sk_app/android/surface_glue_android.h",
Brian Osman16adfa32016-10-18 14:42:44 -04002482 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002483 libs += [ "android" ]
2484 } else if (is_linux) {
2485 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002486 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002487 "tools/sk_app/unix/WindowContextFactory_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002488 "tools/sk_app/unix/Window_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002489 "tools/sk_app/unix/Window_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002490 "tools/sk_app/unix/keysym2ucs.c",
John Stilesab9578e2020-06-30 17:36:55 -04002491 "tools/sk_app/unix/keysym2ucs.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002492 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002493 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002494 libs += [
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002495 "GL", # Used by raster window context, so cannot be behind skia_use_gl.
Brian Osmanc9a42472018-05-31 13:17:12 -04002496 "X11",
2497 ]
2498 } else if (is_win) {
2499 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002500 "tools/sk_app/win/RasterWindowContext_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002501 "tools/sk_app/win/WindowContextFactory_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002502 "tools/sk_app/win/Window_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002503 "tools/sk_app/win/Window_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002504 "tools/sk_app/win/main_win.cpp",
2505 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002506 } else if (is_mac) {
2507 sources += [
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002508 "tools/sk_app/mac/RasterWindowContext_mac.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002509 "tools/sk_app/mac/WindowContextFactory_mac.h",
2510 "tools/sk_app/mac/Window_mac.h",
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002511 "tools/sk_app/mac/Window_mac.mm",
2512 "tools/sk_app/mac/main_mac.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002513 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002514 frameworks += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002515 "QuartzCore.framework",
2516 "Cocoa.framework",
2517 "Foundation.framework",
2518 ]
2519 } else if (is_ios) {
2520 sources += [
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002521 "tools/sk_app/ios/RasterWindowContext_ios.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002522 "tools/sk_app/ios/WindowContextFactory_ios.h",
2523 "tools/sk_app/ios/Window_ios.h",
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002524 "tools/sk_app/ios/Window_ios.mm",
2525 "tools/sk_app/ios/main_ios.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002526 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002527 frameworks += [ "QuartzCore.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002528 }
2529
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002530 if (skia_use_gl) {
2531 sources += [ "tools/sk_app/GLWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002532 sources += [ "tools/sk_app/GLWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002533 if (is_android) {
2534 sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ]
2535 } else if (is_linux) {
2536 sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ]
2537 } else if (is_win) {
2538 sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ]
2539 if (skia_use_angle) {
2540 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
2541 }
2542 } else if (is_mac) {
2543 sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
2544 } else if (is_ios) {
2545 sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
2546 }
2547 }
2548
Brian Osmanc9a42472018-05-31 13:17:12 -04002549 if (skia_use_vulkan) {
2550 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002551 sources += [ "tools/sk_app/VulkanWindowContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002552 if (is_android) {
2553 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2554 } else if (is_linux) {
2555 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2556 libs += [ "X11-xcb" ]
2557 } else if (is_win) {
2558 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2559 }
2560 }
2561
Jim Van Verthbe39f712019-02-08 15:36:14 -05002562 if (skia_use_metal) {
2563 sources += [ "tools/sk_app/MetalWindowContext.mm" ]
John Stilesab9578e2020-06-30 17:36:55 -04002564 sources += [ "tools/sk_app/MetalWindowContext.h" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002565 if (is_mac) {
2566 sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002567 } else if (is_ios) {
Jim Van Verthe58d5322019-09-03 09:42:57 -04002568 sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002569 }
Jim Van Verthbe39f712019-02-08 15:36:14 -05002570 }
2571
Jim Van Verth682a2f42020-05-13 16:54:09 -04002572 if (skia_use_direct3d) {
2573 sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ]
2574 }
2575
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002576 if (skia_use_dawn) {
2577 sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002578 sources += [ "tools/sk_app/DawnWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002579 if (is_linux) {
2580 if (dawn_enable_vulkan) {
2581 sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
2582 defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
2583 libs += [ "X11-xcb" ]
2584 }
2585 } else if (is_win) {
2586 if (dawn_enable_d3d12) {
2587 sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
2588 }
2589 } else if (is_mac) {
2590 if (dawn_enable_metal) {
2591 sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
2592 }
2593 }
2594 }
2595
Mike Kleina01c6b02020-04-01 13:47:34 -05002596 deps = [ ":tool_utils" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002597 if (is_android) {
2598 deps += [ "//third_party/native_app_glue" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002599 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002600 if (skia_use_gl && skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002601 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002602 }
Brian Osman16adfa32016-10-18 14:42:44 -04002603 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002604
Hal Canary87515122019-03-15 14:22:51 -04002605 if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
2606 test_app("fiddle_examples") {
2607 sources = [
Brian Osmanc725e8f2019-04-10 14:08:44 -04002608 "tools/fiddle/all_examples.cpp",
Hal Canary87515122019-03-15 14:22:51 -04002609 "tools/fiddle/examples.cpp",
Brian Osman72ef2d52019-03-17 11:09:17 -04002610 "tools/fiddle/examples.h",
Hal Canary87515122019-03-15 14:22:51 -04002611 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002612 if (is_win) {
Hal Canary6c8422c2020-01-10 15:22:09 -05002613 cflags = [
2614 "/wd4756", # Overflow in constant arithmetic
2615 "/wd4305", # truncation from 'double' to 'float'
2616 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002617 }
Hal Canary87515122019-03-15 14:22:51 -04002618 deps = [
2619 ":skia",
2620 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002621 "modules/particles",
Hal Canary87515122019-03-15 14:22:51 -04002622 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002623 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04002624 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002625 "modules/svg",
Hal Canary87515122019-03-15 14:22:51 -04002626 ]
2627 }
2628 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002629
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002630 # sk_app can work without GL but viewer always runs raster through a GL window context.
2631 if (skia_use_gl) {
2632 test_app("viewer") {
2633 is_shared_library = is_android
2634 sources = [
2635 "tools/viewer/AnimTimer.h",
2636 "tools/viewer/BisectSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002637 "tools/viewer/BisectSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002638 "tools/viewer/GMSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002639 "tools/viewer/GMSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002640 "tools/viewer/ImGuiLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002641 "tools/viewer/ImGuiLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002642 "tools/viewer/ImageSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002643 "tools/viewer/ImageSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002644 "tools/viewer/ParticlesSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002645 "tools/viewer/ParticlesSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002646 "tools/viewer/SKPSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002647 "tools/viewer/SKPSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002648 "tools/viewer/SampleSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002649 "tools/viewer/SampleSlide.h",
Florin Malita45cd2002020-06-09 14:00:54 -04002650 "tools/viewer/SkRiveSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002651 "tools/viewer/SkRiveSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002652 "tools/viewer/SkSLSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002653 "tools/viewer/SkSLSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002654 "tools/viewer/SkottieSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002655 "tools/viewer/SkottieSlide.h",
2656 "tools/viewer/Slide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002657 "tools/viewer/SlideDir.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002658 "tools/viewer/SlideDir.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002659 "tools/viewer/StatsLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002660 "tools/viewer/StatsLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002661 "tools/viewer/SvgSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002662 "tools/viewer/SvgSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002663 "tools/viewer/TouchGesture.cpp",
2664 "tools/viewer/TouchGesture.h",
2665 "tools/viewer/Viewer.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002666 "tools/viewer/Viewer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002667 ]
2668 libs = []
2669
2670 deps = [
2671 ":common_flags_gpu",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002672 ":flags",
2673 ":gm",
2674 ":gpu_tool_utils",
2675 ":samples",
2676 ":sk_app",
2677 ":skia",
2678 ":tool_utils",
2679 ":trace",
Florin Malita45cd2002020-06-09 14:00:54 -04002680 "experimental/skrive",
Florin Malitac9c4e2e2020-08-13 12:03:37 -04002681 "modules/audioplayer",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002682 "modules/particles",
2683 "modules/skottie",
2684 "modules/skottie:utils",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002685 "modules/sksg:samples",
Florin Malitab3418102020-10-15 18:10:29 -04002686 "modules/svg",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002687 "//third_party/imgui",
2688 ]
2689 if (skia_use_experimental_xform) {
2690 deps += [ ":experimental_xform" ]
2691 sources += [ "gm/xform.cpp" ]
2692 }
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002693 if (skia_use_vulkan) {
Brian Salomon3207fbe2020-06-30 11:09:25 -04002694 deps += [
Corentin Wallez89d6e792021-03-08 15:25:34 +01002695 "//third_party/externals/spirv-tools:spvtools",
Brian Salomon3207fbe2020-06-30 11:09:25 -04002696
Corentin Wallez89d6e792021-03-08 15:25:34 +01002697 #spvtools depends on this but doesn't deps it in.
2698 "//third_party/externals/spirv-tools:spvtools_val",
Brian Salomon3207fbe2020-06-30 11:09:25 -04002699 ]
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002700 }
Mike Reedd62d4062019-06-12 10:20:44 -04002701 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002702 }
2703
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002704 if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002705 test_app("HelloWorld") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002706 sources = [ "example/HelloWorld.cpp" ]
Brian Osmaneff04b52017-11-21 13:18:02 -05002707 libs = []
2708
Brian Osmaneff04b52017-11-21 13:18:02 -05002709 deps = [
2710 ":flags",
2711 ":gpu_tool_utils",
2712 ":sk_app",
2713 ":skia",
2714 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002715 ]
2716 }
2717 }
2718
Mike Klein9f6468f2020-05-19 13:14:40 -05002719 if (skia_use_gl && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002720 test_app("SkiaSDLExample") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002721 sources = [ "example/SkiaSDLExample.cpp" ]
Jim Van Verth4c70c752017-07-11 12:03:01 -04002722 libs = []
Jim Van Verth4c70c752017-07-11 12:03:01 -04002723 deps = [
2724 ":gpu_tool_utils",
2725 ":skia",
2726 "//third_party/libsdl",
2727 ]
2728 }
2729 }
2730
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002731 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2732 action_foreach("generate_mocs") {
2733 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002734 sources = [ "tools/mdbviz/MainWindow.h" ]
2735 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002736 args = [
2737 "$skia_qt_path" + "/bin/moc",
2738 "{{source}}",
2739 "-o",
2740 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2741 ]
2742 }
2743 action_foreach("generate_resources") {
2744 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002745 sources = [ "tools/mdbviz/resources.qrc" ]
2746 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002747 args = [
2748 "$skia_qt_path" + "/bin/rcc",
2749 "{{source}}",
2750 "-o",
2751 "gen/mdbviz/{{source_name_part}}_res.cpp",
2752 ]
2753 }
2754 test_app("mdbviz") {
2755 if (is_win) {
2756 # on Windows we need to disable some exception handling warnings due to the Qt headers
2757 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2758 }
2759 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002760 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002761 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002762 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002763 "tools/debugger/DrawCommand.cpp",
2764 "tools/debugger/JsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002765 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002766 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002767 "tools/mdbviz/main.cpp",
2768
2769 # generated files
2770 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2771 "$target_gen_dir/mdbviz/resources_res.cpp",
2772 ]
2773 lib_dirs = [ "$skia_qt_path/lib" ]
2774 libs = [
2775 "Qt5Core.lib",
2776 "Qt5Gui.lib",
2777 "Qt5Widgets.lib",
2778 ]
2779 include_dirs = [
2780 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002781 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002782 "$skia_qt_path/include/QtWidgets",
2783 ]
2784 deps = [
2785 ":generate_mocs",
2786 ":generate_resources",
2787 ":skia",
2788 ]
2789 }
2790 }
2791
Mike Kleine459afd2017-03-03 09:21:30 -05002792 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002793 copy("gdbserver") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002794 sources = [ "$ndk/$ndk_gdbserver" ]
2795 outputs = [ "$root_out_dir/gdbserver" ]
Derek Sollenberger70120c72017-01-05 11:39:04 -05002796 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002797 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002798
2799 if (skia_use_opencl) {
2800 test_app("hello-opencl") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002801 sources = [ "tools/hello-opencl.cpp" ]
2802 deps = [ "//third_party/opencl" ]
Mike Kleinf9ae6702018-06-20 14:05:05 -04002803 }
2804 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002805
Brian Osmanf564f152019-07-23 15:14:30 -04002806 executable("cpu_modules") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002807 sources = [ "tools/cpu_modules.cpp" ]
Brian Osmanf564f152019-07-23 15:14:30 -04002808 deps = [
2809 ":skia",
2810 "modules/particles",
2811 ]
2812 }
2813
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002814 if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) {
Hal Canary1f94d392019-07-30 09:27:56 -04002815 test_app("editor") {
2816 is_shared_library = is_android
Mike Kleina01c6b02020-04-01 13:47:34 -05002817 deps = [ "modules/skplaintexteditor:editor_app" ]
Hal Canary1f94d392019-07-30 09:27:56 -04002818 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002819 }
Hal Canarye5b65d22019-09-19 11:33:31 -04002820
2821 executable("image_diff_metric") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002822 sources = [ "tools/image_diff_metric.cpp" ]
2823 deps = [ ":skia" ]
Hal Canarye5b65d22019-09-19 11:33:31 -04002824 }
Chris Dalton2b598902020-03-25 10:50:35 -06002825
2826 group("modules_testonly") {
2827 testonly = true
2828 deps = []
2829 if (target_cpu == "wasm") {
2830 deps += [ "modules/canvaskit:viewer_wasm" ]
2831 }
2832 }
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002833
2834 if (skia_build_fuzzers) {
2835 template("libfuzzer_app") {
2836 output_dir = root_build_dir
2837 executable(target_name) {
2838 check_includes = false
2839 forward_variables_from(invoker, "*", [ "is_shared_library" ])
2840 configs += [ ":skia_private" ]
2841 sources += [
2842 "fuzz/Fuzz.cpp",
2843 "fuzz/FuzzCommon.cpp",
2844 ]
2845 deps += [
2846 ":flags",
2847 ":gpu_tool_utils",
2848 ":skia",
2849 ]
2850 defines = [ "SK_BUILD_FOR_LIBFUZZER" ]
2851 if (skia_use_libfuzzer_defaults) {
2852 cflags = [ "-fsanitize=fuzzer" ]
2853 ldflags = [ "-fsanitize=fuzzer" ]
2854 }
2855 testonly = true
2856 }
2857 }
2858
2859 libfuzzer_app("region_deserialize") {
2860 sources = [ "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp" ]
2861 deps = []
2862 }
2863
2864 libfuzzer_app("image_filter_deserialize") {
2865 include_dirs = [
2866 "tools",
2867 "tools/fonts",
2868 ]
2869 sources = [
2870 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
2871 "tools/Resources.cpp",
2872 "tools/fonts/TestFontMgr.cpp",
2873 "tools/fonts/TestSVGTypeface.cpp",
2874 "tools/fonts/TestTypeface.cpp",
2875 ]
Florin Malitab3418102020-10-15 18:10:29 -04002876 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002877 }
2878
2879 libfuzzer_app("region_set_path") {
2880 sources = [ "fuzz/oss_fuzz/FuzzRegionSetPath.cpp" ]
2881 deps = []
2882 }
2883
2884 libfuzzer_app("textblob_deserialize") {
2885 include_dirs = [
2886 "tools",
2887 "tools/fonts",
2888 ]
2889 sources = [
2890 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
2891 "tools/Resources.cpp",
2892 "tools/fonts/TestFontMgr.cpp",
2893 "tools/fonts/TestSVGTypeface.cpp",
2894 "tools/fonts/TestTypeface.cpp",
2895 ]
Florin Malitab3418102020-10-15 18:10:29 -04002896 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002897 }
2898
2899 libfuzzer_app("path_deserialize") {
2900 sources = [ "fuzz/oss_fuzz/FuzzPathDeserialize.cpp" ]
2901 deps = []
2902 }
2903
2904 libfuzzer_app("image_decode") {
2905 sources = [ "fuzz/oss_fuzz/FuzzImage.cpp" ]
2906 deps = []
2907 }
2908
2909 libfuzzer_app("animated_image_decode") {
2910 sources = [ "fuzz/oss_fuzz/FuzzAnimatedImage.cpp" ]
2911 deps = []
2912 }
2913
2914 libfuzzer_app("api_create_ddl") {
2915 include_dirs = [
2916 "include",
2917 "include/gpu",
2918 ]
2919 sources = [
2920 "fuzz/FuzzCreateDDL.cpp",
2921 "fuzz/oss_fuzz/FuzzAPICreateDDL.cpp",
2922 "tools/Resources.cpp",
2923 "tools/UrlDataManager.cpp",
2924 "tools/debugger/DebugCanvas.cpp",
2925 "tools/debugger/DebugLayerManager.cpp",
2926 "tools/debugger/DrawCommand.cpp",
2927 "tools/debugger/JsonWriteBuffer.cpp",
2928 "tools/fonts/TestFontMgr.cpp",
2929 "tools/fonts/TestSVGTypeface.cpp",
2930 "tools/fonts/TestTypeface.cpp",
2931 ]
2932 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04002933 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002934 "//third_party/libpng",
2935 ]
2936 }
2937
2938 libfuzzer_app("api_draw_functions") {
2939 sources = [
2940 "fuzz/FuzzDrawFunctions.cpp",
2941 "fuzz/oss_fuzz/FuzzDrawFunctions.cpp",
2942 ]
2943 deps = []
2944 }
2945
Adlai Hollerccb68662021-02-25 10:28:44 -05002946 libfuzzer_app("api_ddl_threading") {
2947 sources = [
2948 "fuzz/FuzzDDLThreading.cpp",
2949 "fuzz/oss_fuzz/FuzzDDLThreading.cpp",
2950 ]
2951 deps = []
2952 }
2953
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002954 libfuzzer_app("api_gradients") {
2955 sources = [
2956 "fuzz/FuzzGradients.cpp",
2957 "fuzz/oss_fuzz/FuzzGradients.cpp",
2958 ]
2959 deps = []
2960 }
2961
2962 libfuzzer_app("api_image_filter") {
2963 include_dirs = [
2964 "tools",
2965 "tools/debugger",
2966 ]
2967 sources = [
2968 "fuzz/FuzzCanvas.cpp",
2969 "fuzz/oss_fuzz/FuzzAPIImageFilter.cpp",
2970 "tools/UrlDataManager.cpp",
2971 "tools/debugger/DebugCanvas.cpp",
2972 "tools/debugger/DebugLayerManager.cpp",
2973 "tools/debugger/DrawCommand.cpp",
2974 "tools/debugger/JsonWriteBuffer.cpp",
2975 ]
2976 deps = [ "//third_party/libpng" ]
2977 }
2978
2979 libfuzzer_app("api_path_measure") {
2980 sources = [
2981 "fuzz/FuzzPathMeasure.cpp",
2982 "fuzz/oss_fuzz/FuzzPathMeasure.cpp",
2983 ]
2984 deps = []
2985 }
2986
2987 libfuzzer_app("api_pathop") {
2988 sources = [
2989 "fuzz/FuzzPathop.cpp",
2990 "fuzz/oss_fuzz/FuzzPathop.cpp",
2991 ]
2992 deps = []
2993 }
2994
2995 libfuzzer_app("api_raster_n32_canvas") {
2996 include_dirs = [
2997 "tools",
2998 "tools/debugger",
2999 "tools/fonts",
3000 ]
3001 sources = [
3002 "fuzz/FuzzCanvas.cpp",
3003 "fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp",
3004 "tools/Resources.cpp",
3005 "tools/UrlDataManager.cpp",
3006 "tools/debugger/DebugCanvas.cpp",
3007 "tools/debugger/DebugLayerManager.cpp",
3008 "tools/debugger/DrawCommand.cpp",
3009 "tools/debugger/JsonWriteBuffer.cpp",
3010 "tools/fonts/TestFontMgr.cpp",
3011 "tools/fonts/TestSVGTypeface.cpp",
3012 "tools/fonts/TestTypeface.cpp",
3013 ]
3014 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003015 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003016 "//third_party/libpng",
3017 ]
3018 }
3019
3020 if (skia_use_gl) {
3021 libfuzzer_app("api_mock_gpu_canvas") {
3022 include_dirs = [
3023 "tools",
3024 "tools/debugger",
3025 "tools/fonts",
3026 ]
3027 sources = [
3028 "fuzz/FuzzCanvas.cpp",
3029 "fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp",
3030 "tools/LsanSuppressions.cpp",
3031 "tools/Resources.cpp",
3032 "tools/UrlDataManager.cpp",
3033 "tools/debugger/DebugCanvas.cpp",
3034 "tools/debugger/DebugLayerManager.cpp",
3035 "tools/debugger/DrawCommand.cpp",
3036 "tools/debugger/JsonWriteBuffer.cpp",
3037 "tools/fonts/TestFontMgr.cpp",
3038 "tools/fonts/TestSVGTypeface.cpp",
3039 "tools/fonts/TestTypeface.cpp",
3040 ]
3041 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003042 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003043 "//third_party/libpng",
3044 ]
3045 }
3046 }
3047
3048 libfuzzer_app("api_null_canvas") {
3049 include_dirs = [
3050 "tools",
3051 "tools/debugger",
3052 "tools/fonts",
3053 ]
3054 sources = [
3055 "fuzz/FuzzCanvas.cpp",
3056 "fuzz/oss_fuzz/FuzzNullCanvas.cpp",
3057 "tools/Resources.cpp",
3058 "tools/UrlDataManager.cpp",
3059 "tools/debugger/DebugCanvas.cpp",
3060 "tools/debugger/DebugLayerManager.cpp",
3061 "tools/debugger/DrawCommand.cpp",
3062 "tools/debugger/JsonWriteBuffer.cpp",
3063 "tools/fonts/TestFontMgr.cpp",
3064 "tools/fonts/TestSVGTypeface.cpp",
3065 "tools/fonts/TestTypeface.cpp",
3066 ]
3067 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003068 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003069 "//third_party/libpng",
3070 ]
3071 }
3072
Weston Tracey1a771fe2021-02-04 11:09:59 -05003073 libfuzzer_app("api_skparagraph") {
3074 sources = [
3075 "fuzz/FuzzSkParagraph.cpp",
3076 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
3077 "tools/Resources.cpp",
3078 ]
3079 deps = [ "modules/skparagraph" ]
3080 }
3081
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003082 libfuzzer_app("api_svg_canvas") {
3083 include_dirs = [
3084 "include",
3085 "include/svg",
3086 ]
3087 sources = [
3088 "fuzz/FuzzCanvas.cpp",
3089 "fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp",
3090 "tools/Resources.cpp",
3091 "tools/UrlDataManager.cpp",
3092 "tools/debugger/DebugCanvas.cpp",
3093 "tools/debugger/DebugLayerManager.cpp",
3094 "tools/debugger/DrawCommand.cpp",
3095 "tools/debugger/JsonWriteBuffer.cpp",
3096 "tools/fonts/TestFontMgr.cpp",
3097 "tools/fonts/TestSVGTypeface.cpp",
3098 "tools/fonts/TestTypeface.cpp",
3099 ]
3100 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003101 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003102 "//third_party/libpng",
3103 ]
3104 }
3105
3106 libfuzzer_app("png_encoder") {
3107 sources = [
3108 "fuzz/FuzzEncoders.cpp",
3109 "fuzz/oss_fuzz/FuzzPNGEncoder.cpp",
3110 ]
3111 deps = []
3112 }
3113
3114 libfuzzer_app("jpeg_encoder") {
3115 sources = [
3116 "fuzz/FuzzEncoders.cpp",
3117 "fuzz/oss_fuzz/FuzzJPEGEncoder.cpp",
3118 ]
3119 deps = []
3120 }
3121
3122 libfuzzer_app("webp_encoder") {
3123 sources = [
3124 "fuzz/FuzzEncoders.cpp",
3125 "fuzz/oss_fuzz/FuzzWEBPEncoder.cpp",
3126 ]
3127 deps = []
3128 }
3129
3130 libfuzzer_app("skottie_json") {
3131 sources = [
3132 "modules/skottie/fuzz/FuzzSkottieJSON.cpp",
3133 "tools/Resources.cpp",
3134 "tools/fonts/TestFontMgr.cpp",
3135 "tools/fonts/TestSVGTypeface.cpp",
3136 "tools/fonts/TestTypeface.cpp",
3137 ]
3138 deps = [
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003139 "modules/skottie:skottie",
Florin Malitab3418102020-10-15 18:10:29 -04003140 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003141 ]
3142 }
3143
3144 libfuzzer_app("skjson") {
3145 sources = [ "fuzz/oss_fuzz/FuzzJSON.cpp" ]
3146 deps = []
3147 }
3148
3149 libfuzzer_app("api_polyutils") {
3150 sources = [
3151 "fuzz/FuzzPolyUtils.cpp",
3152 "fuzz/oss_fuzz/FuzzPolyUtils.cpp",
3153 ]
3154 deps = [ ":skia" ]
3155 }
3156
3157 libfuzzer_app("android_codec") {
3158 sources = [ "fuzz/oss_fuzz/FuzzAndroidCodec.cpp" ]
3159 deps = []
3160 }
3161
3162 libfuzzer_app("image_decode_incremental") {
3163 sources = [ "fuzz/oss_fuzz/FuzzIncrementalImage.cpp" ]
3164 deps = []
3165 }
3166
3167 libfuzzer_app("sksl2glsl") {
3168 sources = [ "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp" ]
3169 deps = []
3170 }
3171
3172 libfuzzer_app("sksl2spirv") {
3173 sources = [ "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp" ]
3174 deps = []
3175 }
3176
3177 libfuzzer_app("sksl2metal") {
3178 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp" ]
3179 deps = []
3180 }
3181
3182 libfuzzer_app("sksl2pipeline") {
3183 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp" ]
3184 deps = []
3185 }
3186
3187 libfuzzer_app("skdescriptor_deserialize") {
3188 sources = [ "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp" ]
3189 deps = []
3190 }
3191
3192 libfuzzer_app("svg_dom") {
3193 sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ]
Florin Malitab3418102020-10-15 18:10:29 -04003194 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003195 }
3196
3197 libfuzzer_app("skruntimeeffect") {
3198 sources = [ "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp" ]
3199 deps = []
3200 }
3201
3202 libfuzzer_app("skp") {
3203 sources = [ "fuzz/oss_fuzz/FuzzSKP.cpp" ]
3204 deps = []
3205 }
3206 }
mtklein25c81d42016-07-27 13:55:26 -07003207}
Hal Canary932a2c02019-09-17 10:43:18 -04003208
Chinmay Gardea1ea0a92019-10-01 16:37:10 -07003209if (is_ios && skia_use_metal && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003210 group("minimal_ios_mtl_skia_app") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003211 deps = [ "experimental/minimal_ios_mtl_skia_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003212 }
Hal Canary27483062019-12-06 15:01:08 -05003213}
3214
Hal Canary60ff6512020-01-21 12:39:20 -05003215if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003216 group("skottie_ios") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003217 deps = [ "tools/skottie_ios_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003218 }
3219}
Martin Kustermannb65d2992020-12-15 16:15:13 +01003220
3221executable("skia_c_api_example") {
3222 sources = [ "experimental/c-api-example/skia-c-example.c" ]
3223 include_dirs = [ "." ]
3224 deps = [ ":skia" ]
3225}