blob: 4760f2d35d10daaee0383a0d16b5e3363430166a [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 Canary32498f02019-02-04 15:36:31 -05009import("gn/skia.gni")
brettwb9447282016-09-01 14:24:39 -070010
Forrest Reiling30229ac2017-04-17 13:36:39 -070011if (is_fuchsia) {
Chinmay Garde89820762019-05-06 16:44:06 -070012 import("//build/fuchsia/sdk.gni")
Forrest Reiling30229ac2017-04-17 13:36:39 -070013 import("//build/vulkan/config.gni")
14}
15
mtkleinc04ff472016-06-23 10:29:30 -070016declare_args() {
Mike Klein26a60492018-10-15 10:38:25 -040017 skia_enable_flutter_defines = false
18}
19
20declare_args() {
Mike Kleinc168a3a2016-11-14 14:53:13 +000021 skia_use_angle = false
Kevin Lubick4a24e102017-03-29 11:19:01 -040022 skia_use_egl = false
mtklein63213812016-08-24 09:55:56 -070023 skia_use_expat = true
Mike Reedd62d4062019-06-12 10:20:44 -040024 skia_use_experimental_xform = false
Mike Reed7bf160e2019-05-17 16:50:51 -040025 skia_use_ffmpeg = false
mtklein3cc22182016-08-29 13:26:14 -070026 skia_use_fontconfig = is_linux
Leon Scroggins III85e22fc2018-11-28 08:58:47 -050027 skia_use_fonthost_mac = is_mac
mtkleincdedd0e2016-09-12 15:15:44 -070028 skia_use_freetype = is_android || is_fuchsia || is_linux
Leon Scroggins IIIc41a5f52018-11-15 15:54:59 -050029 skia_use_fixed_gamma_text = is_android
mtklein63213812016-08-24 09:55:56 -070030 skia_use_libjpeg_turbo = true
31 skia_use_libpng = true
mtkleineb3c4252016-08-23 07:38:09 -070032 skia_use_libwebp = !is_fuchsia
Mike Kleinfae86b72018-01-08 15:49:09 -050033 skia_use_lua = is_skia_dev_build && !is_ios
Mike Kleinf9ae6702018-06-20 14:05:05 -040034 skia_use_opencl = false
Mike Klein10d665d2016-11-01 11:46:10 -040035 skia_use_piex = !is_win
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -040036 skia_use_wuffs = false
mtklein63213812016-08-24 09:55:56 -070037 skia_use_zlib = true
Greg Daniele5ddff52017-07-05 16:49:36 -040038 skia_use_metal = false
Stephen White0d70b712019-07-10 15:51:30 -040039 skia_use_dawn = false
Mike Klein36f182f2017-10-20 12:33:53 -040040 skia_use_libheif = is_skia_dev_build
Chinmay Garded92d0352018-09-17 10:23:28 -070041 skia_use_x11 = is_linux
Leon Scroggins IIIee0e5d02019-02-27 10:59:11 -050042 skia_use_xps = true
Stephen White0d70b712019-07-10 15:51:30 -040043}
mtklein1bd72ba2016-09-16 07:45:52 -070044
Stephen White0d70b712019-07-10 15:51:30 -040045declare_args() {
Mike Klein7d921032017-01-05 12:20:41 -050046 skia_android_serial = ""
Kevin Lubick93faa672018-10-10 15:54:53 -040047 skia_enable_ccpr = true
Kevin Lubickca7c2972018-10-17 13:52:24 +000048 skia_enable_nvpr = !skia_enable_flutter_defines
Brian Osman3f375d02016-12-28 11:19:22 -050049 skia_enable_discrete_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050050 skia_enable_pdf = true
Stephen White0d70b712019-07-10 15:51:30 -040051 skia_enable_spirv_validation = is_skia_dev_build && is_debug && !skia_use_dawn
Brian Osman489cf882019-07-09 10:48:28 -040052 skia_enable_sksl_interpreter = is_skia_dev_build
Mike Klein977e5322019-07-15 11:38:12 -050053 skia_enable_skvm_jit =
Mike Klein08ba1132019-07-15 11:44:52 -050054 is_skia_dev_build && ((target_cpu == "x64" && (is_linux || is_mac)) ||
55 (target_cpu == "arm64" && is_android))
Mike Klein3669a822017-03-03 10:55:02 -050056 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Robert Phillipsa6d2d702017-09-01 12:17:03 -040057 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040058 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070059 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070060 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040061
Hal Canary2331c822018-02-01 14:06:13 -050062 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040063
64 skia_llvm_path = ""
65 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040066
67 skia_tools_require_resources = false
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -040068 skia_include_multiframe_procs = false
mtkleinc04ff472016-06-23 10:29:30 -070069}
Stephen White0d70b712019-07-10 15:51:30 -040070
71if (skia_use_dawn) {
72 import("third_party/externals/dawn/scripts/dawn_features.gni")
73}
74
Brian Salomon23d73ea2016-10-27 13:31:37 -040075declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040076 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040077 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050078 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -050079 skia_enable_fontmgr_empty = false
Kevin Lubickddd0a332018-12-12 10:35:13 -050080 skia_enable_fontmgr_custom =
81 is_linux && skia_use_freetype && !skia_use_fontconfig
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -050082 skia_enable_fontmgr_custom_empty = is_fuchsia && skia_use_freetype
83 skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
Sergey Ulanovf3babcd2018-11-30 17:42:00 -080084 skia_enable_fontmgr_fuchsia = is_fuchsia
Leon Scroggins III631dbc82019-03-04 13:54:02 -050085 skia_enable_fontmgr_win = is_win
86 skia_enable_fontmgr_win_gdi = is_win
Mike Klein10d665d2016-11-01 11:46:10 -040087
Kevin Lubick27ba7032019-03-21 08:13:54 -040088 if (is_mac) {
89 skia_gl_standard = "gl"
90 } else if (is_ios) {
91 skia_gl_standard = "gles"
92 } else {
93 skia_gl_standard = ""
94 }
95
Mike Klein4d598a32016-10-31 13:44:49 -040096 if (is_android) {
97 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070098 } else if (is_fuchsia) {
99 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -0400100 } else {
Mike Klein98dea7b2019-01-15 11:26:43 -0500101 skia_use_vulkan = defined(skia_moltenvk_path) && skia_moltenvk_path != ""
Mike Klein4d598a32016-10-31 13:44:49 -0400102 }
Jim Van Verth4e502972017-12-07 15:16:10 -0500103
104 if (is_ios) {
105 skia_ios_identity = ".*Google.*"
106 skia_ios_profile = "Google Development"
107 }
Brian Salomon23d73ea2016-10-27 13:31:37 -0400108}
Brian Salomon789e25e2016-09-30 13:41:03 -0400109
Adam Barth54ef74a2017-10-13 10:59:38 -0700110if (defined(skia_settings)) {
111 import(skia_settings)
112}
113
mtkleinc04ff472016-06-23 10:29:30 -0700114# Skia public API, generally provided by :skia.
115config("skia_public") {
Mike Klein9e25bb92019-04-29 09:46:36 -0500116 include_dirs = [ "." ]
117
Mike Kleinae7e6712016-10-11 17:49:33 -0400118 defines = []
119 if (is_component_build) {
120 defines += [ "SKIA_DLL" ]
121 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400122 if (is_fuchsia || is_linux) {
Mike Kleinf0a53692019-04-24 11:42:40 -0500123 defines += [ "SK_R32_SHIFT=16" ]
jcgregorio5561e3d2016-08-25 09:25:11 -0700124 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400125 if (skia_enable_flutter_defines) {
126 defines += flutter_defines
127 }
mtklein06c35c02016-09-20 12:28:12 -0700128 if (!skia_enable_gpu) {
129 defines += [ "SK_SUPPORT_GPU=0" ]
130 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500131 if (skia_enable_atlas_text) {
132 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
133 }
Mike Reed025f7832018-11-12 09:27:05 -0500134 if (is_fuchsia) {
135 defines += fuchsia_defines
136 }
Kevin Lubick27ba7032019-03-21 08:13:54 -0400137 if (skia_gl_standard == "gles") {
138 defines += [ "SK_ASSUME_GL_ES=1" ]
139 } else if (skia_gl_standard == "gl") {
140 defines += [ "SK_ASSUME_GL=1" ]
Kevin Lubick39026282019-03-28 12:46:40 -0400141 } else if (skia_gl_standard == "webgl") {
142 defines += [ "SK_ASSUME_WEBGL=1" ]
Kevin Lubick27ba7032019-03-21 08:13:54 -0400143 }
mtkleinc04ff472016-06-23 10:29:30 -0700144}
145
146# Skia internal APIs, used by Skia itself and a few test tools.
147config("skia_private") {
148 visibility = [ ":*" ]
149
Mike Reeda9e241d2017-05-03 10:52:00 -0400150 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
Leon Scroggins IIIc41a5f52018-11-15 15:54:59 -0500151 if (skia_use_fixed_gamma_text) {
mtkleinb37c0342016-09-09 11:07:45 -0700152 defines += [
153 "SK_GAMMA_EXPONENT=1.4",
154 "SK_GAMMA_CONTRAST=0.0",
155 ]
156 }
Mike Kleinb45d8622019-04-24 14:04:01 -0500157 if (is_skia_dev_build) {
158 defines += [
159 "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
160 "GR_TEST_UTILS=1",
161 ]
mtklein88a7ac02016-09-14 11:16:49 -0700162 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400163 libs = []
164 lib_dirs = []
Brian Osman34755e22016-12-05 09:46:02 -0500165 if (skia_use_angle) {
166 defines += [ "SK_ANGLE" ]
167 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400168 if (skia_llvm_path != "") {
169 defines += [ "SK_LLVM_AVAILABLE" ]
170 include_dirs += [ "$skia_llvm_path/include" ]
171 libs += [ skia_llvm_lib ]
172 lib_dirs += [ "$skia_llvm_path/lib/" ]
173 }
mtkleinc04ff472016-06-23 10:29:30 -0700174}
175
176# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
177config("skia_library") {
178 visibility = [ ":*" ]
Mike Kleinf5f4e812019-04-29 15:45:14 +0000179 defines = [ "SKIA_IMPLEMENTATION=1" ]
mtkleinc04ff472016-06-23 10:29:30 -0700180}
181
182skia_library_configs = [
183 ":skia_public",
184 ":skia_private",
185 ":skia_library",
186]
187
mtklein9b8583d2016-08-24 17:32:30 -0700188# Use for CPU-specific Skia code that needs particular compiler flags.
189template("opts") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500190 visibility = [ ":*" ]
mtklein9b8583d2016-08-24 17:32:30 -0700191 if (invoker.enabled) {
192 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500193 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700194 forward_variables_from(invoker, "*")
195 configs += skia_library_configs
196 }
197 } else {
198 # If not enabled, a phony empty target that swallows all otherwise unused variables.
199 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500200 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700201 forward_variables_from(invoker,
202 "*",
203 [
204 "sources",
205 "cflags",
206 ])
207 }
208 }
anmittala7eaf2e2016-08-17 13:57:26 -0700209}
210
mtklein422310d2016-08-16 18:28:43 -0700211is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700212
mtklein7d6fb2c2016-08-25 14:50:44 -0700213opts("none") {
214 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700215 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700216 cflags = []
217}
218
mtklein7d6fb2c2016-08-25 14:50:44 -0700219opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700220 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700221 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700222 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700223}
224
225opts("arm64") {
226 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700227 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700228 cflags = []
229}
230
231opts("crc32") {
232 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700233 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700234 cflags = [ "-march=armv8-a+crc" ]
235}
236
mtklein9b8583d2016-08-24 17:32:30 -0700237opts("sse2") {
238 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700239 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400240 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400241 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
242 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400243 cflags = [ "-msse2" ]
244 }
mtklein9b8583d2016-08-24 17:32:30 -0700245}
mtkleinc04ff472016-06-23 10:29:30 -0700246
mtklein9b8583d2016-08-24 17:32:30 -0700247opts("ssse3") {
248 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700249 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400250 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400251 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
252 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400253 cflags = [ "-mssse3" ]
254 }
mtklein9b8583d2016-08-24 17:32:30 -0700255}
mtkleinc04ff472016-06-23 10:29:30 -0700256
mtklein9b8583d2016-08-24 17:32:30 -0700257opts("sse41") {
258 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700259 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400260 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400261 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
262 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400263 cflags = [ "-msse4.1" ]
264 }
mtklein9b8583d2016-08-24 17:32:30 -0700265}
mtklein4e976072016-08-08 09:06:27 -0700266
mtklein9b8583d2016-08-24 17:32:30 -0700267opts("sse42") {
268 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700269 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400270 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400271 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
272 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400273 cflags = [ "-msse4.2" ]
274 }
mtklein9b8583d2016-08-24 17:32:30 -0700275}
276
277opts("avx") {
278 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700279 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400280 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000281 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400282 } else {
283 cflags = [ "-mavx" ]
284 }
mtkleinc04ff472016-06-23 10:29:30 -0700285}
286
Mike Klein1b9b7d52018-02-27 10:37:40 -0500287opts("hsw") {
288 enabled = is_x86
289 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400290 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500291 cflags = [ "/arch:AVX2" ]
292 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000293 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500294 }
Mike Klein1b9b7d52018-02-27 10:37:40 -0500295}
296
mtkleinc095df52016-08-24 12:23:52 -0700297# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700298template("optional") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500299 visibility = [ ":*" ]
mtklein457b42a2016-08-23 13:56:37 -0700300 if (invoker.enabled) {
301 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700302 if (defined(invoker.public_defines)) {
303 defines = invoker.public_defines
304 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600305 if (defined(invoker.public_configs)) {
306 configs = invoker.public_configs
307 }
mtklein457b42a2016-08-23 13:56:37 -0700308 }
309 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500310 check_includes = false
mtkleincd01b032016-08-31 04:58:19 -0700311 forward_variables_from(invoker,
312 "*",
313 [
314 "public_defines",
315 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700316 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700317 ])
mtklein457b42a2016-08-23 13:56:37 -0700318 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700319 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700320 if (defined(invoker.configs_to_remove)) {
321 configs -= invoker.configs_to_remove
322 }
mtklein457b42a2016-08-23 13:56:37 -0700323 }
324 } else {
mtklein457b42a2016-08-23 13:56:37 -0700325 source_set(target_name) {
326 forward_variables_from(invoker,
327 "*",
328 [
329 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400330 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700331 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700332 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700333 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700334 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700335 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700336 ])
mtkleincd01b032016-08-31 04:58:19 -0700337 if (defined(invoker.sources_when_disabled)) {
338 sources = invoker.sources_when_disabled
339 }
340 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700341 }
mtkleineb3c4252016-08-23 07:38:09 -0700342 }
mtklein457b42a2016-08-23 13:56:37 -0700343}
mtklein457b42a2016-08-23 13:56:37 -0700344
mtkleina45be612016-08-29 15:22:10 -0700345optional("fontmgr_android") {
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500346 enabled = skia_enable_fontmgr_android
mtkleina45be612016-08-29 15:22:10 -0700347
348 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500349 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700350 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700351 ]
352 sources = [
353 "src/ports/SkFontMgr_android.cpp",
354 "src/ports/SkFontMgr_android_factory.cpp",
355 "src/ports/SkFontMgr_android_parser.cpp",
356 ]
357}
358
mtkleind2e39db2016-09-07 07:52:55 -0700359optional("fontmgr_custom") {
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500360 enabled = skia_enable_fontmgr_custom
mtkleind2e39db2016-09-07 07:52:55 -0700361
362 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500363 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700364 ]
365 sources = [
366 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500367 "src/ports/SkFontMgr_custom.h",
368 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700369 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500370 "src/ports/SkFontMgr_custom_embedded.cpp",
371 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700372 ]
373}
374
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500375optional("fontmgr_custom_empty") {
376 enabled = skia_enable_fontmgr_custom_empty
Kevin Lubickddd0a332018-12-12 10:35:13 -0500377
378 deps = [
379 ":typeface_freetype",
380 ]
381 sources = [
382 "src/ports/SkFontMgr_custom.cpp",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500383 "src/ports/SkFontMgr_custom_empty.cpp",
384 "src/ports/SkFontMgr_custom_empty_factory.cpp",
Sergey Ulanovf3babcd2018-11-30 17:42:00 -0800385 ]
386}
387
Hal Canaryff2742e2018-01-30 11:35:47 -0500388optional("fontmgr_empty") {
389 enabled = skia_enable_fontmgr_empty
390 sources = [
391 "src/ports/SkFontMgr_empty_factory.cpp",
392 ]
393}
394
mtklein3cc22182016-08-29 13:26:14 -0700395optional("fontmgr_fontconfig") {
396 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700397
398 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500399 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700400 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700401 ]
402 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700403 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700404 "src/ports/SkFontConfigInterface_direct.cpp",
405 "src/ports/SkFontConfigInterface_direct_factory.cpp",
406 "src/ports/SkFontMgr_FontConfigInterface.cpp",
407 "src/ports/SkFontMgr_fontconfig.cpp",
408 "src/ports/SkFontMgr_fontconfig_factory.cpp",
409 ]
410}
411
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500412optional("fontmgr_fuchsia") {
413 enabled = skia_enable_fontmgr_fuchsia
414
Chinmay Garde89820762019-05-06 16:44:06 -0700415 deps = []
416
417 if (is_fuchsia && using_fuchsia_sdk) {
418 deps += [ "$fuchsia_sdk_root/fidl:fuchsia.fonts" ]
419 } else {
420 deps += [ "//sdk/fidl/fuchsia.fonts" ]
421 }
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500422 sources = [
423 "src/ports/SkFontMgr_fuchsia.cpp",
424 "src/ports/SkFontMgr_fuchsia.h",
425 ]
426}
427
428optional("fontmgr_wasm") {
Kevin Lubick0e3342c2019-04-16 13:31:25 -0400429 enabled = !skia_enable_fontmgr_empty && target_cpu == "wasm"
mtkleincdedd0e2016-09-12 15:15:44 -0700430
431 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500432 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700433 ]
434 sources = [
435 "src/ports/SkFontMgr_custom.cpp",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500436 "src/ports/SkFontMgr_custom.h",
437 "src/ports/SkFontMgr_custom_embedded.cpp",
438 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700439 ]
440}
441
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500442optional("fontmgr_win") {
443 enabled = skia_enable_fontmgr_win
444
445 sources = [
446 "src/fonts/SkFontMgr_indirect.cpp",
447 "src/ports/SkFontMgr_win_dw.cpp",
448 "src/ports/SkFontMgr_win_dw_factory.cpp",
449 "src/ports/SkScalerContext_win_dw.cpp",
450 "src/ports/SkTypeface_win_dw.cpp",
451 ]
452}
453
454optional("fontmgr_win_gdi") {
455 enabled = skia_enable_fontmgr_win_gdi
456
457 sources = [
458 "src/ports/SkFontHost_win.cpp",
459 ]
460 libs = [ "Gdi32.lib" ]
461}
462
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700463if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400464 executable("sksllex") {
465 sources = [
466 "src/sksl/lex/Main.cpp",
467 "src/sksl/lex/NFA.cpp",
468 "src/sksl/lex/RegexNode.cpp",
469 "src/sksl/lex/RegexParser.cpp",
470 ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500471 include_dirs = [ "." ]
Ethan Nicholasca82a922017-09-07 09:39:50 -0400472 }
473
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700474 action("run_sksllex") {
475 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400476 deps = [
477 ":sksllex(//gn/toolchain:$host_toolchain)",
478 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700479 sources = [
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700480 "src/sksl/lex/sksl.lex",
481 ]
482
483 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
484 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
485 outputs = [
486 "$target_out_dir/" +
487 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
488 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
489 # confused due to the same file being named by two different paths
490 ]
491 sksllex_path = "$root_out_dir/"
492 sksllex_path += "sksllex"
493 if (host_os == "win") {
494 sksllex_path += ".exe"
495 }
496 args = [
497 rebase_path(sksllex_path),
498 rebase_path("bin/clang-format"),
499 rebase_path("src"),
500 ]
501 }
502} else {
503 group("run_sksllex") {
504 }
505}
506
507if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400508 executable("skslc") {
509 defines = [ "SKSL_STANDALONE" ]
510 sources = [
511 "src/sksl/SkSLMain.cpp",
512 ]
513 sources += skia_sksl_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400514 sources += skia_sksl_gpu_sources
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500515 include_dirs = [ "." ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400516 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500517 ":run_sksllex",
Stephen White238fc242019-08-26 10:19:23 -0400518 "//third_party/spirv-tools:spvtools",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400519 ]
520 }
521
522 skia_gpu_processor_outputs = []
523 foreach(src, skia_gpu_processor_sources) {
524 dir = get_path_info(src, "dir")
525 name = get_path_info(src, "name")
526
527 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
528 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
529 skia_gpu_processor_outputs += [
Brian Osmanf5ac1992019-07-18 11:23:16 -0400530 "$target_out_dir/" +
531 rebase_path("$dir/generated/$name.h", target_out_dir),
Ethan Nicholas762466e2017-06-29 10:03:38 -0400532 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
533 # confused due to the same file being named by two different paths
534 ]
535 }
536
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500537 action("create_sksl_enums") {
538 script = "gn/create_sksl_enums.py"
539 sources = [
540 "include/private/GrSharedEnums.h",
541 ]
542 outputs = [
543 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500544 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500545 ]
546 args = [
547 rebase_path(sources[0]),
548 rebase_path(outputs[0]),
549 ]
550 }
551
Ethan Nicholas762466e2017-06-29 10:03:38 -0400552 action("compile_processors") {
553 script = "gn/compile_processors.py"
554 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500555 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400556 ":skslc(//gn/toolchain:$host_toolchain)",
557 ]
558 sources = skia_gpu_processor_sources
559 outputs = skia_gpu_processor_outputs
560 skslc_path = "$root_out_dir/"
561 if (host_toolchain != default_toolchain_name) {
562 skslc_path += "$host_toolchain/"
563 }
564 skslc_path += "skslc"
565 if (host_os == "win") {
566 skslc_path += ".exe"
567 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400568 args = [
569 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400570 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400571 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400572 args += rebase_path(skia_gpu_processor_sources)
573 }
574} else {
575 skia_gpu_processor_outputs = []
576 group("compile_processors") {
577 }
578}
579
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500580optional("gpu") {
mtklein06c35c02016-09-20 12:28:12 -0700581 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400582 deps = [
583 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700584 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400585 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700586 if (skia_generate_workarounds) {
587 deps += [ ":workaround_list" ]
588 }
Robert Phillipsefb9f142019-05-17 14:19:44 -0400589 public_defines = [ "SK_GL" ]
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600590 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400591 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700592
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400593 sources =
594 skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400595 if (!skia_enable_ccpr) {
596 sources -= skia_ccpr_sources
597 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
598 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400599 if (!skia_enable_nvpr) {
600 sources -= skia_nvpr_sources
601 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
602 }
mtklein06c35c02016-09-20 12:28:12 -0700603
604 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500605 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700606 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400607 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700608 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400609 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400610
611 # this lib is required to link against AHardwareBuffer
612 if (defined(ndk_api) && ndk_api >= 26) {
613 libs += [ "android" ]
614 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400615 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500616 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400617 libs += [ "EGL" ]
Chinmay Garded92d0352018-09-17 10:23:28 -0700618 } else if (is_linux && skia_use_x11) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500619 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -0400620 libs += [ "GL" ]
mtklein06c35c02016-09-20 12:28:12 -0700621 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500622 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800623 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500624 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400625 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500626 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -0500627 if (target_cpu != "arm64") {
628 libs += [ "OpenGL32.lib" ]
629 }
mtklein06c35c02016-09-20 12:28:12 -0700630 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500631 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700632 }
mtkleine9fb3d52016-09-20 15:11:46 -0700633
634 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400635 public_defines += [ "SK_VULKAN" ]
Greg Daniel18dbfd02018-05-29 10:46:51 -0400636 deps += [ "third_party/vulkanmemoryallocator" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700637 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700638 if (skia_enable_vulkan_debug_layers) {
639 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
640 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800641 if (is_fuchsia) {
Chinmay Garde89820762019-05-06 16:44:06 -0700642 if (using_fuchsia_sdk) {
643 public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
644 } else {
Brian Osman489cf882019-07-09 10:48:28 -0400645 public_deps += [ "//src/graphics/lib/vulkan" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700646 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800647 }
mtkleine9fb3d52016-09-20 15:11:46 -0700648 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400649
Stephen White0d70b712019-07-10 15:51:30 -0400650 if (skia_use_dawn) {
651 public_defines += [ "SK_DAWN" ]
Stephen White985741a2019-07-18 11:43:45 -0400652 sources += skia_dawn_sources
Stephen White0d70b712019-07-10 15:51:30 -0400653 public_deps += [
654 "//third_party/dawn:dawn_headers",
655 "//third_party/dawn:libdawn",
656 "//third_party/dawn:libdawn_native_sources",
657 ]
658 if (dawn_enable_d3d12) {
659 libs += [
660 "d3d12.lib",
661 "dxgi.lib",
662 "d3dcompiler.lib",
663 ]
664 } else if (dawn_enable_metal) {
665 libs += [ "Metal.framework" ]
666 }
667 }
668
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400669 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400670 if (skia_use_metal) {
671 public_defines += [ "SK_METAL" ]
672 sources += skia_metal_sources
673 libs += [ "Metal.framework" ]
Greg Daniel53956d92018-08-08 14:41:19 -0400674 libs += [ "Foundation.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400675 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400676 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500677
678 if (skia_enable_atlas_text) {
679 sources += skia_atlas_text_sources
680 }
Kevin Lubickf4def342018-10-04 12:52:50 -0400681
682 if (is_debug) {
683 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
684 }
mtklein06c35c02016-09-20 12:28:12 -0700685}
686
Leon Scroggins III41169202019-01-29 09:29:57 -0500687optional("gif") {
688 enabled = !skia_use_wuffs
689 sources = [
690 "src/codec/SkGifCodec.cpp",
691 "third_party/gif/SkGifImageReader.cpp",
692 ]
693}
694
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400695optional("heif") {
696 enabled = skia_use_libheif
697 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
698
699 deps = []
700
701 sources = [
702 "src/codec/SkHeifCodec.cpp",
703 ]
704}
705
mtklein63213812016-08-24 09:55:56 -0700706optional("jpeg") {
707 enabled = skia_use_libjpeg_turbo
708 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
709
mtklein63213812016-08-24 09:55:56 -0700710 deps = [
711 "//third_party/libjpeg-turbo:libjpeg",
712 ]
Mike Kleinf105dc72018-06-05 15:22:54 -0400713 public = [
714 "include/encode/SkJpegEncoder.h",
715 ]
mtklein63213812016-08-24 09:55:56 -0700716 sources = [
717 "src/codec/SkJpegCodec.cpp",
718 "src/codec/SkJpegDecoderMgr.cpp",
719 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700720 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400721 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700722 ]
723}
724
725optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500726 enabled = skia_use_zlib && skia_enable_pdf
727 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700728
mtklein63213812016-08-24 09:55:56 -0700729 deps = [
730 "//third_party/zlib",
731 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400732 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700733 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400734 }
brettwb9447282016-09-01 14:24:39 -0700735 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700736 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
Hal Canary2a3093c2019-02-20 11:25:45 -0500737 if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
738 deps += [ "//third_party/harfbuzz" ]
739 defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
740 } else if (skia_use_icu && skia_use_sfntly) {
mtklein63213812016-08-24 09:55:56 -0700741 deps += [ "//third_party/sfntly" ]
Hal Canary32498f02019-02-04 15:36:31 -0500742 defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700743 }
744}
745
746optional("png") {
747 enabled = skia_use_libpng
748 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
749
mtklein63213812016-08-24 09:55:56 -0700750 deps = [
751 "//third_party/libpng",
752 ]
753 sources = [
754 "src/codec/SkIcoCodec.cpp",
755 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400756 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700757 ]
758}
759
scroggof84ad642016-10-31 09:02:57 -0700760optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400761 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700762 public_defines = [ "SK_CODEC_DECODES_RAW" ]
763
764 deps = [
765 "//third_party/dng_sdk",
766 "//third_party/libjpeg-turbo:libjpeg",
767 "//third_party/piex",
768 ]
769
770 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
771 # Skia.
772 configs_to_remove = [ "//gn:no_exceptions" ]
773
774 sources = [
scroggof84ad642016-10-31 09:02:57 -0700775 "src/codec/SkRawCodec.cpp",
776 ]
777}
778
Mike Klein852a8cb2018-05-15 10:46:58 -0400779import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -0400780source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -0400781 cflags = []
782 if (!is_win || is_clang) {
783 cflags += [
784 "-w",
785 "-std=c11",
786 ]
787 }
788
789 public = [
Brian Osmanea236bf2019-04-29 10:28:22 -0400790 "include/third_party/skcms/skcms.h",
Mike Klein852a8cb2018-05-15 10:46:58 -0400791 ]
Brian Osmanea236bf2019-04-29 10:28:22 -0400792 include_dirs = [ "include/third_party/skcms" ]
Mike Klein852a8cb2018-05-15 10:46:58 -0400793 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
794}
795
mtklein3cc22182016-08-29 13:26:14 -0700796optional("typeface_freetype") {
797 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700798
799 deps = [
800 "//third_party/freetype2",
801 ]
802 sources = [
803 "src/ports/SkFontHost_FreeType.cpp",
804 "src/ports/SkFontHost_FreeType_common.cpp",
805 ]
806}
807
mtklein457b42a2016-08-23 13:56:37 -0700808optional("webp") {
809 enabled = skia_use_libwebp
810 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
811
mtklein457b42a2016-08-23 13:56:37 -0700812 deps = [
813 "//third_party/libwebp",
814 ]
815 sources = [
mtklein457b42a2016-08-23 13:56:37 -0700816 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400817 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700818 ]
mtkleineb3c4252016-08-23 07:38:09 -0700819}
820
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -0400821optional("wuffs") {
822 enabled = skia_use_wuffs
823 public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
824
825 deps = [
826 "//third_party/wuffs",
827 ]
828 sources = [
829 "src/codec/SkWuffsCodec.cpp",
830 ]
831}
832
mtklein63213812016-08-24 09:55:56 -0700833optional("xml") {
834 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000835 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700836
mtklein63213812016-08-24 09:55:56 -0700837 deps = [
838 "//third_party/expat",
839 ]
840 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500841 "src/svg/SkSVGCanvas.cpp",
842 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700843 "src/xml/SkDOM.cpp",
844 "src/xml/SkXMLParser.cpp",
845 "src/xml/SkXMLWriter.cpp",
846 ]
847}
848
Brian Osman489cf882019-07-09 10:48:28 -0400849optional("sksl_interpreter") {
850 enabled = skia_enable_sksl_interpreter
851 public_defines = [ "SK_ENABLE_SKSL_INTERPRETER" ]
852}
853
Mike Klein613ad382019-06-06 11:42:02 -0500854optional("skvm_jit") {
Mike Klein6bbeb4a2019-06-21 16:34:06 -0500855 enabled = skia_enable_skvm_jit
Mike Klein613ad382019-06-06 11:42:02 -0500856 public_defines = [ "SKVM_JIT" ]
Mike Klein613ad382019-06-06 11:42:02 -0500857}
858
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700859if (skia_enable_gpu && skia_generate_workarounds) {
860 action("workaround_list") {
861 script = "tools/build_workaround_header.py"
862
863 inputs = [
864 "src/gpu/gpu_workaround_list.txt",
865 ]
866
867 # see comments in skia_compile_processors about out dir path shenanigans.
868 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700869 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700870
871 outputs = [
872 "$root_out_dir/$output_file",
873 ]
874 args = [
875 "--output-file",
876 "$output_file",
877 ]
878
879 foreach(file, inputs) {
880 args += [ rebase_path(file, root_build_dir) ]
881 }
882 }
883}
884
mtkleinc04ff472016-06-23 10:29:30 -0700885component("skia") {
886 public_configs = [ ":skia_public" ]
887 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700888
Mike Klein607b0a72018-11-07 16:17:34 -0500889 public_deps = [
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500890 ":gpu",
Mike Klein607b0a72018-11-07 16:17:34 -0500891 ":pdf",
892 ":skcms",
893 ]
894
mtkleinc04ff472016-06-23 10:29:30 -0700895 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700896 ":arm64",
897 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700898 ":avx",
Mike Klein54378232018-11-08 12:08:05 +0000899 ":compile_processors",
anmittalb8b3f712016-08-25 04:55:19 -0700900 ":crc32",
mtkleina45be612016-08-29 15:22:10 -0700901 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700902 ":fontmgr_custom",
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500903 ":fontmgr_custom_empty",
Hal Canaryff2742e2018-01-30 11:35:47 -0500904 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700905 ":fontmgr_fontconfig",
Sergey Ulanovf3babcd2018-11-30 17:42:00 -0800906 ":fontmgr_fuchsia",
Kevin Lubickddd0a332018-12-12 10:35:13 -0500907 ":fontmgr_wasm",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500908 ":fontmgr_win",
909 ":fontmgr_win_gdi",
Leon Scroggins III41169202019-01-29 09:29:57 -0500910 ":gif",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400911 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500912 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700913 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700914 ":none",
mtklein63213812016-08-24 09:55:56 -0700915 ":png",
scroggof84ad642016-10-31 09:02:57 -0700916 ":raw",
Brian Osman489cf882019-07-09 10:48:28 -0400917 ":sksl_interpreter",
Mike Klein613ad382019-06-06 11:42:02 -0500918 ":skvm_jit",
mtklein9b8583d2016-08-24 17:32:30 -0700919 ":sse2",
920 ":sse41",
921 ":sse42",
922 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700923 ":webp",
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -0400924 ":wuffs",
mtklein63213812016-08-24 09:55:56 -0700925 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700926 ]
927
Chinmay Garde43f115c2016-11-16 15:04:12 -0800928 # This file (and all GN files in Skia) are designed to work with an
929 # empty sources assignment filter; we handle all that explicitly.
930 # We clear the filter here for clients who may have set up a global filter.
931 set_sources_assignment_filter([])
932
Hal Canaryc25f4e92019-02-26 11:54:25 -0500933 public = skia_core_public
934 public += skia_utils_public
935 public += skia_effects_public
936 public += skia_effects_imagefilter_public
937 public += skia_xps_public
938
mtkleinc04ff472016-06-23 10:29:30 -0700939 sources = []
brettwb9447282016-09-01 14:24:39 -0700940 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700941 sources += skia_utils_sources
Leon Scroggins IIIee0e5d02019-02-27 10:59:11 -0500942 if (skia_use_xps) {
943 sources += skia_xps_sources
944 }
Mike Klein54378232018-11-08 12:08:05 +0000945 sources += skia_effects_sources
946 sources += skia_effects_imagefilter_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400947 sources += skia_sksl_sources
mtkleinc04ff472016-06-23 10:29:30 -0700948 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400949 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500950 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700951 "src/android/SkBitmapRegionCodec.cpp",
952 "src/android/SkBitmapRegionDecoder.cpp",
953 "src/codec/SkAndroidCodec.cpp",
Nigel Tao612a65d2018-11-09 10:10:31 +1100954 "src/codec/SkAndroidCodecAdapter.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400955 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700956 "src/codec/SkBmpCodec.cpp",
957 "src/codec/SkBmpMaskCodec.cpp",
958 "src/codec/SkBmpRLECodec.cpp",
959 "src/codec/SkBmpStandardCodec.cpp",
960 "src/codec/SkCodec.cpp",
961 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -0400962 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -0400963 "src/codec/SkEncodedInfo.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700964 "src/codec/SkMaskSwizzler.cpp",
965 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700966 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700967 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700968 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700969 "src/codec/SkSwizzler.cpp",
970 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700971 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700972 "src/ports/SkDiscardableMemory_none.cpp",
Mike Klein54378232018-11-08 12:08:05 +0000973 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700974 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700975 "src/ports/SkMemory_malloc.cpp",
976 "src/ports/SkOSFile_stdio.cpp",
977 "src/sfnt/SkOTTable_name.cpp",
978 "src/sfnt/SkOTUtils.cpp",
979 "src/utils/mac/SkStream_mac.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700980 ]
brettwb9447282016-09-01 14:24:39 -0700981
Kevin Lubick32dfdbe2018-10-18 09:47:01 -0400982 defines = []
mtklein7d6fb2c2016-08-25 14:50:44 -0700983 libs = []
984
mtkleinc04ff472016-06-23 10:29:30 -0700985 if (is_win) {
986 sources += [
987 "src/ports/SkDebug_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700988 "src/ports/SkImageEncoder_WIC.cpp",
989 "src/ports/SkImageGeneratorWIC.cpp",
990 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700991 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700992 "src/ports/SkTLS_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700993 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400994 libs += [
995 "FontSub.lib",
996 "Ole32.lib",
997 "OleAut32.lib",
998 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500999 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -04001000 ]
mtkleinc04ff472016-06-23 10:29:30 -07001001 } else {
1002 sources += [
mtkleinc04ff472016-06-23 10:29:30 -07001003 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -07001004 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001005 "src/ports/SkTLS_pthread.cpp",
1006 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -04001007 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -07001008 }
1009
mtklein7d6fb2c2016-08-25 14:50:44 -07001010 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -05001011 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -05001012 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -05001013 deps += [ "//third_party/cpu-features" ]
1014 }
mtklein06c35c02016-09-20 12:28:12 -07001015 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001016 libs += [
1017 "EGL",
1018 "GLESv2",
1019 "log",
1020 ]
1021 }
1022
Kevin Lubick217056c2018-09-20 17:39:31 -04001023 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -07001024 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001025 if (skia_use_egl) {
1026 libs += [ "GLESv2" ]
1027 }
mtkleinc04ff472016-06-23 10:29:30 -07001028 }
1029
Leon Scroggins III85e22fc2018-11-28 08:58:47 -05001030 if (skia_use_fonthost_mac) {
Sergey Ulanovf3babcd2018-11-30 17:42:00 -08001031 sources += [ "src/ports/SkFontHost_mac.cpp" ]
Leon Scroggins III85e22fc2018-11-28 08:58:47 -05001032 }
1033
mtkleinc04ff472016-06-23 10:29:30 -07001034 if (is_mac) {
1035 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001036 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001037 "src/ports/SkImageEncoder_CG.cpp",
1038 "src/ports/SkImageGeneratorCG.cpp",
1039 ]
mtklein09e61f72016-08-23 13:35:28 -07001040 libs += [
bungeman3e306f62017-03-29 11:32:02 -04001041 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
1042 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -07001043 "ApplicationServices.framework",
1044 "OpenGL.framework",
1045 ]
mtkleinc04ff472016-06-23 10:29:30 -07001046 }
abarth6fc8ff02016-07-15 15:15:15 -07001047
Mike Klein7d302882016-11-03 14:06:31 -04001048 if (is_ios) {
1049 sources += [
1050 "src/ports/SkDebug_stdio.cpp",
1051 "src/ports/SkFontHost_mac.cpp",
1052 "src/ports/SkImageEncoder_CG.cpp",
1053 "src/ports/SkImageGeneratorCG.cpp",
1054 ]
1055 libs += [
1056 "CoreFoundation.framework",
1057 "CoreGraphics.framework",
1058 "CoreText.framework",
1059 "ImageIO.framework",
1060 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -04001061
1062 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
1063 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001064 ]
1065 }
1066
abarth6fc8ff02016-07-15 15:15:15 -07001067 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001068 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001069 }
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001070
1071 if (skia_enable_spirv_validation) {
Stephen White238fc242019-08-26 10:19:23 -04001072 deps += [ "//third_party/spirv-tools:spvtools_val" ]
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001073 defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
1074 }
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -04001075
1076 if (skia_include_multiframe_procs) {
1077 sources += [ "tools/SkSharingProc.cpp" ]
1078 }
mtkleinc04ff472016-06-23 10:29:30 -07001079}
1080
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001081# DebugCanvas used in experimental/wasm-skp-debugger
1082if (target_cpu == "wasm") {
1083 static_library("debugcanvas") {
1084 public_configs = [ ":skia_public" ]
1085
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001086 sources = [
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001087 "tools/SkSharingProc.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001088 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001089 "tools/debugger/DebugCanvas.cpp",
1090 "tools/debugger/DrawCommand.cpp",
1091 "tools/debugger/JsonWriteBuffer.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001092 ]
1093
1094 deps = [
1095 ":fontmgr_wasm",
1096 ]
1097 }
1098}
1099
Kevin Lubickcbcff382018-10-02 09:02:18 -04001100static_library("pathkit") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001101 check_includes = false
Kevin Lubickcbcff382018-10-02 09:02:18 -04001102 public_configs = [ ":skia_public" ]
1103 configs += skia_library_configs
1104
1105 deps = [
1106 ":arm64",
1107 ":armv7",
1108 ":avx",
1109 ":crc32",
1110 ":hsw",
1111 ":none",
1112 ":sse2",
1113 ":sse41",
1114 ":sse42",
1115 ":ssse3",
1116 ]
1117
1118 # This file (and all GN files in Skia) are designed to work with an
1119 # empty sources assignment filter; we handle all that explicitly.
1120 # We clear the filter here for clients who may have set up a global filter.
1121 set_sources_assignment_filter([])
1122
1123 sources = []
1124 sources += skia_pathops_sources
Hal Canaryc25f4e92019-02-26 11:54:25 -05001125 sources += skia_pathops_public
Kevin Lubickcbcff382018-10-02 09:02:18 -04001126 sources += [
1127 "src/core/SkAnalyticEdge.cpp",
1128 "src/core/SkArenaAlloc.cpp",
Mike Reedcc88f3a2019-02-06 11:40:27 -05001129 "src/core/SkContourMeasure.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001130 "src/core/SkCubicMap.cpp",
1131 "src/core/SkEdge.cpp",
1132 "src/core/SkEdgeBuilder.cpp",
1133 "src/core/SkEdgeClipper.cpp",
1134 "src/core/SkGeometry.cpp",
1135 "src/core/SkLineClipper.cpp",
1136 "src/core/SkMallocPixelRef.cpp",
1137 "src/core/SkMath.cpp",
1138 "src/core/SkMatrix.cpp",
1139 "src/core/SkOpts.cpp",
1140 "src/core/SkPaint.cpp",
1141 "src/core/SkPath.cpp",
1142 "src/core/SkPathEffect.cpp",
1143 "src/core/SkPathMeasure.cpp",
1144 "src/core/SkPathRef.cpp",
1145 "src/core/SkPoint.cpp",
1146 "src/core/SkRRect.cpp",
1147 "src/core/SkRect.cpp",
1148 "src/core/SkSemaphore.cpp",
1149 "src/core/SkStream.cpp",
1150 "src/core/SkString.cpp",
1151 "src/core/SkStringUtils.cpp",
1152 "src/core/SkStroke.cpp",
1153 "src/core/SkStrokeRec.cpp",
1154 "src/core/SkStrokerPriv.cpp",
1155 "src/core/SkThreadID.cpp",
1156 "src/core/SkUtils.cpp",
1157 "src/effects/SkDashPathEffect.cpp",
1158 "src/effects/SkTrimPathEffect.cpp",
1159 "src/ports/SkDebug_stdio.cpp",
1160 "src/ports/SkMemory_malloc.cpp",
1161 "src/utils/SkDashPath.cpp",
1162 "src/utils/SkParse.cpp",
1163 "src/utils/SkParsePath.cpp",
1164 "src/utils/SkUTF.cpp",
1165 ]
1166}
1167
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001168group("modules") {
1169 deps = [
Kevin Lubick96634842019-03-05 14:09:24 -05001170 "modules/particles",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001171 "modules/skottie",
1172 "modules/skshaper",
1173 ]
1174}
1175
mtkleinc095df52016-08-24 12:23:52 -07001176# Targets guarded by skia_enable_tools may use //third_party freely.
1177if (skia_enable_tools) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001178 skia_public_includes = [
1179 "include/android",
1180 "include/atlastext",
1181 "include/c",
1182 "include/codec",
1183 "include/config",
1184 "include/core",
1185 "include/docs",
1186 "include/effects",
1187 "include/encode",
1188 "include/gpu",
1189 "include/pathops",
1190 "include/ports",
1191 "include/svg",
1192 "include/utils",
1193 "include/utils/mac",
1194 "modules/sksg/include",
1195 "modules/skshaper/include",
1196 "modules/skottie/include",
1197 ]
1198
Mike Klein308b5ac2016-12-06 16:03:52 -05001199 # Used by gn_to_bp.py to list our public include dirs.
1200 source_set("public") {
1201 configs += [ ":skia_public" ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001202 include_dirs = skia_public_includes
Mike Klein308b5ac2016-12-06 16:03:52 -05001203 }
1204
Mike Kleinc36dedf2016-11-18 09:35:28 -05001205 config("skia.h_config") {
1206 include_dirs = [ "$target_gen_dir" ]
1207 }
1208 action("skia.h") {
1209 public_configs = [ ":skia.h_config" ]
1210 skia_h = "$target_gen_dir/skia.h"
1211 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001212
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001213 args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1214 [ rebase_path(skia_h, root_build_dir) ] +
1215 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001216 depfile = "$skia_h.deps"
1217 outputs = [
1218 skia_h,
1219 ]
1220 }
1221
Brian Osmanc9a42472018-05-31 13:17:12 -04001222 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001223 executable("fiddle") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001224 check_includes = false
Mike Kleinc36dedf2016-11-18 09:35:28 -05001225 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001226 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001227 "tools/fiddle/draw.cpp",
1228 "tools/fiddle/fiddle_main.cpp",
1229 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001230
1231 if (skia_use_egl) {
1232 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001233 } else {
1234 sources += [ "tools/fiddle/null_context.cpp" ]
1235 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001236 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001237 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001238 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001239 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001240 ":skia",
1241 ":skia.h",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001242 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001243 "modules/skshaper",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001244 ]
1245 }
1246 }
1247
Mike Klein9e25bb92019-04-29 09:46:36 -05001248 config("our_vulkan_headers") {
1249 # We add this directory to simulate the client already have
1250 # vulkan/vulkan_core.h on their path.
1251 include_dirs = [ "include/third_party/vulkan" ]
1252 }
1253
Brian Osmanc9a42472018-05-31 13:17:12 -04001254 source_set("public_headers_warnings_check") {
1255 sources = [
1256 "tools/public_headers_warnings_check.cpp",
1257 ]
1258 configs -= [ "//gn:warnings_except_public_headers" ]
Mike Klein9e25bb92019-04-29 09:46:36 -05001259 configs += [ ":our_vulkan_headers" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001260 deps = [
1261 ":skia",
1262 ":skia.h",
1263 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001264 "modules/skshaper",
Brian Osmanc9a42472018-05-31 13:17:12 -04001265 ]
Stephen White0d70b712019-07-10 15:51:30 -04001266
1267 if (skia_use_dawn) {
1268 deps += [ "//third_party/dawn:dawn_headers" ]
1269 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001270 }
1271
mtkleinc095df52016-08-24 12:23:52 -07001272 template("test_lib") {
1273 config(target_name + "_config") {
mtkleina627b5c2016-09-20 13:36:47 -07001274 if (defined(invoker.public_defines)) {
1275 defines = invoker.public_defines
1276 }
mtklein25c81d42016-07-27 13:55:26 -07001277 }
mtkleinc095df52016-08-24 12:23:52 -07001278 source_set(target_name) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001279 forward_variables_from(invoker, "*", [])
Hal Canaryc25f4e92019-02-26 11:54:25 -05001280 check_includes = false
mtkleinc095df52016-08-24 12:23:52 -07001281 public_configs = [
1282 ":" + target_name + "_config",
1283 ":skia_private",
1284 ]
1285
1286 if (!defined(deps)) {
1287 deps = []
1288 }
1289 deps += [ ":skia" ]
1290 testonly = true
1291 }
mtklein25c81d42016-07-27 13:55:26 -07001292 }
mtklein25c81d42016-07-27 13:55:26 -07001293
Mike Kleine6682eb2017-01-05 10:54:57 -05001294 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001295 if (is_ios) {
1296 app_name = target_name
1297 gen_path = target_gen_dir
1298
1299 action("${app_name}_generate_info_plist") {
1300 script = "//gn/gen_plist_ios.py"
1301 outputs = [
1302 "$gen_path/${app_name}_Info.plist",
1303 ]
1304 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1305 }
1306
1307 bundle_data("${app_name}_bundle_info_plist") {
1308 public_deps = [
1309 ":${app_name}_generate_info_plist",
1310 ]
1311 sources = [
1312 "$gen_path/${app_name}_Info.plist",
1313 ]
1314 outputs = [
1315 "{{bundle_root_dir}}/Info.plist",
1316 ]
1317 }
1318
Jim Van Verthffacf652019-04-02 11:59:34 -04001319 has_skps = "True" == exec_script("//gn/checkdir.py",
1320 [ rebase_path("skps", root_build_dir) ],
1321 "trim string")
1322 bundle_data("${app_name}_bundle_resources") {
1323 sources = [
1324 "resources",
1325 ]
1326 outputs = [
1327 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1328 "{{bundle_resources_dir}}/data/resources",
1329 ]
1330 }
1331 if (has_skps) {
1332 bundle_data("${app_name}_bundle_skps") {
Jim Van Verth329c5a62017-11-29 11:42:33 -05001333 sources = [
Jim Van Verthffacf652019-04-02 11:59:34 -04001334 "skps",
Jim Van Verth329c5a62017-11-29 11:42:33 -05001335 ]
1336 outputs = [
Jim Van Verthffacf652019-04-02 11:59:34 -04001337 # Store in same folder as resources
1338 "{{bundle_resources_dir}}/data/skps",
Jim Van Verth329c5a62017-11-29 11:42:33 -05001339 ]
1340 }
Jim Van Verth329c5a62017-11-29 11:42:33 -05001341 }
1342
Jim Van Verth443a9132017-11-28 09:45:26 -05001343 executable("${app_name}_generate_executable") {
1344 forward_variables_from(invoker,
1345 "*",
1346 [
1347 "output_name",
1348 "visibility",
1349 "is_shared_library",
1350 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001351 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001352 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001353 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1354 }
1355
1356 bundle_data("${app_name}_bundle_executable") {
1357 public_deps = [
1358 ":${app_name}_generate_executable",
1359 ]
1360 sources = [
1361 "$gen_path/$app_name",
1362 ]
1363 outputs = [
1364 "{{bundle_executable_dir}}/$app_name",
1365 ]
1366 testonly = true
1367 }
1368
Ben Wagnerd51ea412019-09-02 15:41:34 -04001369 action("${app_name}_dsymutil") {
Jim Van Verthffacf652019-04-02 11:59:34 -04001370 public_deps = [
1371 ":${app_name}_generate_executable",
1372 ]
1373 sources = [
Ben Wagnerd51ea412019-09-02 15:41:34 -04001374 "$gen_path/$app_name",
1375 ]
1376 script = "//gn/call.py"
1377 args = [
1378 "dsymutil",
1379 "$gen_path/$app_name",
1380 ]
1381 outputs = [
1382 "$gen_path/${app_name}.dSYM",
1383 ]
1384 testonly = true
Ben Wagneredcce312019-09-02 16:50:20 -04001385 pool = "//gn/toolchain:dsymutil_pool($default_toolchain)"
Ben Wagnerd51ea412019-09-02 15:41:34 -04001386 }
1387
1388 bundle_data("${app_name}_bundle_symbols") {
1389 public_deps = [
1390 ":${app_name}_dsymutil",
1391 ]
1392 sources = [
Jim Van Verthffacf652019-04-02 11:59:34 -04001393 "$gen_path/${app_name}.dSYM",
1394 ]
1395 outputs = [
1396 "{{bundle_executable_dir}}/${app_name}.dSYM",
1397 ]
1398 testonly = true
1399 }
1400
Jim Van Verth443a9132017-11-28 09:45:26 -05001401 create_bundle("$app_name") {
1402 product_type = "com.apple.product-type.application"
1403 testonly = true
1404
1405 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1406 bundle_resources_dir = bundle_root_dir
1407 bundle_executable_dir = bundle_root_dir
Jim Van Verth443a9132017-11-28 09:45:26 -05001408
1409 deps = [
1410 ":${app_name}_bundle_executable",
1411 ":${app_name}_bundle_info_plist",
Jim Van Verthffacf652019-04-02 11:59:34 -04001412 ":${app_name}_bundle_resources",
1413 ":${app_name}_bundle_symbols",
Jim Van Verth443a9132017-11-28 09:45:26 -05001414 ]
Jim Van Verthffacf652019-04-02 11:59:34 -04001415 if (has_skps) {
1416 deps += [ ":${app_name}_bundle_skps" ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001417 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001418
1419 # should only code sign when running on a device, not the simulator
1420 if (target_cpu != "x64") {
1421 code_signing_script = "//gn/codesign_ios.py"
1422 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1423 code_signing_outputs = [
1424 "$bundle_root_dir/_CodeSignature/CodeResources",
1425 "$bundle_root_dir/embedded.mobileprovision",
1426 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001427 code_signing_args = [
1428 rebase_path("$bundle_root_dir", root_build_dir),
1429 skia_ios_identity,
1430 skia_ios_profile,
1431 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001432 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001433 }
1434 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001435 # !is_ios
1436
1437 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1438 shared_library("lib" + target_name) {
1439 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1440 configs += [ ":skia_private" ]
1441 testonly = true
1442 }
1443 } else {
1444 _executable = target_name
1445 executable(_executable) {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001446 check_includes = false
Jim Van Verth443a9132017-11-28 09:45:26 -05001447 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1448 configs += [ ":skia_private" ]
1449 testonly = true
1450 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001451 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001452 if (is_android && skia_android_serial != "" && defined(_executable)) {
1453 action("push_" + target_name) {
1454 script = "gn/push_to_android.py"
1455 deps = [
1456 ":" + _executable,
1457 ]
1458 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1459 outputs = [
1460 _stamp,
1461 ]
1462 args = [
1463 rebase_path("$root_build_dir/$_executable"),
1464 skia_android_serial,
1465 rebase_path(_stamp),
1466 ]
1467 testonly = true
1468 }
Mike Klein7d921032017-01-05 12:20:41 -05001469 }
1470 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001471 }
1472
Greg Danielda16cce2018-08-01 09:23:57 -04001473 config("moltenvk_config") {
1474 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1475 if (is_ios) {
1476 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
1477 } else {
1478 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
1479 }
1480 cflags = [ "-F$moltenvk_framework_path" ]
1481 ldflags = [ "-F$moltenvk_framework_path" ]
1482 libs = [
1483 "MoltenVK.framework",
1484 "Metal.framework",
1485 "IOSurface.framework",
1486 "QuartzCore.framework",
1487 "Foundation.framework",
1488 ]
1489 if (is_ios) {
1490 libs += [ "UIKit.framework" ]
1491 } else {
1492 libs += [ "IOKit.framework" ]
1493 }
1494 defines = [ "SK_MOLTENVK" ]
1495 }
1496 }
1497
1498 source_set("moltenvk") {
1499 public_configs = [ ":moltenvk_config" ]
1500 }
1501
mtkleinc095df52016-08-24 12:23:52 -07001502 test_lib("gpu_tool_utils") {
Brian Osmanc9a42472018-05-31 13:17:12 -04001503 public_defines = []
mtkleind68f9b02016-09-23 13:18:41 -07001504
Mike Klein9e25bb92019-04-29 09:46:36 -05001505 # Bots and even devs may not have Vulkan headers, so put
1506 # include/third_party/vulkan on our path so they're always available.
1507 all_dependent_configs = [ ":our_vulkan_headers" ]
1508
Mike Klein333fb452019-04-24 08:48:11 -05001509 defines = []
1510 if (skia_enable_discrete_gpu) {
1511 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
1512 }
1513
Brian Osmanc9a42472018-05-31 13:17:12 -04001514 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001515 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001516 sources = [
1517 "tools/gpu/GrContextFactory.cpp",
1518 "tools/gpu/GrTest.cpp",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001519 "tools/gpu/MemoryCache.cpp",
1520 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001521 "tools/gpu/ProxyUtils.cpp",
1522 "tools/gpu/TestContext.cpp",
Michael Ludwigd9958f82019-03-21 13:08:36 -04001523 "tools/gpu/YUVUtils.cpp",
1524 "tools/gpu/YUVUtils.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001525 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
1526 "tools/gpu/gl/GLTestContext.cpp",
1527 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04001528 "tools/gpu/mock/MockTestContext.cpp",
1529 ]
1530 libs = []
1531
1532 if (is_android || skia_use_egl) {
1533 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1534 } else if (is_ios) {
1535 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1536 libs += [ "OpenGLES.framework" ]
1537 } else if (is_linux) {
1538 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -04001539 libs += [
1540 "GLU",
1541 "X11",
1542 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001543 } else if (is_mac) {
1544 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
1545 } else if (is_win) {
1546 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -05001547 libs += [ "Gdi32.lib" ]
1548 if (target_cpu != "arm64") {
1549 libs += [ "OpenGL32.lib" ]
1550 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001551 }
mtklein25c81d42016-07-27 13:55:26 -07001552
Brian Osmanc9a42472018-05-31 13:17:12 -04001553 cflags_objcc = [ "-fobjc-arc" ]
mtklein6ef69992016-09-14 06:12:09 -07001554
Brian Osmanc9a42472018-05-31 13:17:12 -04001555 if (skia_use_angle) {
1556 deps += [ "//third_party/angle2" ]
1557 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1558 }
Greg Daniel54200e42018-12-11 17:03:39 -05001559
Brian Osmanc9a42472018-05-31 13:17:12 -04001560 if (skia_use_vulkan) {
1561 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
1562 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Greg Danielda16cce2018-08-01 09:23:57 -04001563 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1564 public_deps += [ ":moltenvk" ]
1565 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001566 }
1567 if (skia_use_metal) {
1568 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001569 }
Stephen White985741a2019-07-18 11:43:45 -04001570 if (skia_use_dawn) {
1571 public_deps += [ "//third_party/dawn:dawn_headers" ]
1572 sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
1573 }
mtklein25c81d42016-07-27 13:55:26 -07001574 }
mtklein25c81d42016-07-27 13:55:26 -07001575
mtkleinc095df52016-08-24 12:23:52 -07001576 test_lib("flags") {
mtkleinc095df52016-08-24 12:23:52 -07001577 sources = [
Mike Klein88544fb2019-03-20 10:50:33 -05001578 "tools/flags/CommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001579 ]
1580 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001581
1582 test_lib("common_flags_config") {
mtklein046cb562016-09-16 10:23:12 -07001583 sources = [
Mike Klein88544fb2019-03-20 10:50:33 -05001584 "tools/flags/CommonFlagsConfig.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001585 ]
1586 deps = [
mtklein046cb562016-09-16 10:23:12 -07001587 ":flags",
Greg Danielda16cce2018-08-01 09:23:57 -04001588 ]
1589 public_deps = [
mtkleinc095df52016-08-24 12:23:52 -07001590 ":gpu_tool_utils",
1591 ]
1592 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001593 test_lib("common_flags_gpu") {
Mike Kleinc6142d82019-03-25 10:54:59 -05001594 sources = [
1595 "tools/flags/CommonFlagsGpu.cpp",
1596 ]
1597 deps = [
1598 ":flags",
1599 ]
1600 public_deps = [
1601 ":gpu_tool_utils",
1602 ]
1603 }
1604 test_lib("common_flags_images") {
Mike Kleinc6142d82019-03-25 10:54:59 -05001605 sources = [
1606 "tools/flags/CommonFlagsImages.cpp",
1607 ]
1608 deps = [
1609 ":flags",
1610 ]
1611 }
1612 test_lib("common_flags_aa") {
Mike Kleinc6142d82019-03-25 10:54:59 -05001613 sources = [
1614 "tools/flags/CommonFlagsAA.cpp",
1615 ]
1616 deps = [
1617 ":flags",
1618 ]
1619 }
mtklein25c81d42016-07-27 13:55:26 -07001620
Mike Klein499f0ac2019-03-25 13:00:12 -05001621 test_lib("trace") {
Mike Klein499f0ac2019-03-25 13:00:12 -05001622 deps = [
1623 ":flags",
1624 ]
1625 sources = [
1626 "tools/trace/ChromeTracingTracer.cpp",
1627 "tools/trace/ChromeTracingTracer.h",
1628 "tools/trace/EventTracingPriv.cpp",
1629 "tools/trace/EventTracingPriv.h",
1630 "tools/trace/SkDebugfTracer.cpp",
1631 "tools/trace/SkDebugfTracer.h",
1632 ]
1633 }
1634
mtkleinc095df52016-08-24 12:23:52 -07001635 test_lib("tool_utils") {
mtkleinc095df52016-08-24 12:23:52 -07001636 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001637 "tools/AndroidSkDebugToStdOut.cpp",
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001638 "tools/AutoreleasePool.h",
mtkleinc095df52016-08-24 12:23:52 -07001639 "tools/CrashHandler.cpp",
Robert Phillips96601082018-05-29 16:13:26 -04001640 "tools/DDLPromiseImageHelper.cpp",
1641 "tools/DDLTileHelper.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001642 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001643 "tools/ProcStats.cpp",
1644 "tools/Resources.cpp",
Hal Canarye574f1e2019-07-15 14:01:37 -04001645 "tools/SkMetaData.cpp",
1646 "tools/SkMetaData.h",
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001647 "tools/SkSharingProc.cpp",
Mike Kleinea3f0142019-03-20 11:12:10 -05001648 "tools/ToolUtils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001649 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001650 "tools/debugger/DebugCanvas.cpp",
1651 "tools/debugger/DrawCommand.cpp",
1652 "tools/debugger/JsonWriteBuffer.cpp",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001653 "tools/fonts/RandomScalerContext.cpp",
1654 "tools/fonts/TestEmptyTypeface.h",
1655 "tools/fonts/TestFontMgr.cpp",
1656 "tools/fonts/TestFontMgr.h",
1657 "tools/fonts/TestSVGTypeface.cpp",
1658 "tools/fonts/TestSVGTypeface.h",
1659 "tools/fonts/TestTypeface.cpp",
1660 "tools/fonts/TestTypeface.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001661 "tools/fonts/ToolUtilsFont.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001662 "tools/random_parse_path.cpp",
Hal Canary41248072019-07-11 16:32:53 -04001663 "tools/timer/TimeUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001664 "tools/timer/Timer.cpp",
1665 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001666 libs = []
1667 if (is_ios) {
1668 sources += [ "tools/ios_utils.m" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001669 sources += [ "tools/ios_utils.h" ]
1670 if (skia_use_metal) {
1671 sources += [ "tools/AutoreleasePool.mm" ]
1672 }
Mike Kleinadacaef2017-02-06 09:26:14 -05001673 libs += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001674 } else if (is_mac) {
1675 if (skia_use_metal) {
1676 sources += [ "tools/AutoreleasePool.mm" ]
1677 libs += [ "Foundation.framework" ]
1678 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001679 } else if (is_win) {
1680 libs += [ "DbgHelp.lib" ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001681 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001682
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001683 defines = []
1684 if (skia_tools_require_resources) {
1685 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1686 }
mtkleinc095df52016-08-24 12:23:52 -07001687 deps = [
Ben Wagner97182cc2018-02-15 10:20:04 -05001688 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001689 ":flags",
Mike Kleine4ad58a2019-03-26 09:05:52 -05001690 ]
1691 public_deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05001692 ":gpu_tool_utils",
mtkleinc095df52016-08-24 12:23:52 -07001693 ]
mtkleinc095df52016-08-24 12:23:52 -07001694 }
mtklein25c81d42016-07-27 13:55:26 -07001695
Mike Kleine11e5c12019-04-24 12:46:06 -05001696 test_lib("etc1") {
1697 sources = [
1698 "third_party/etc1/etc1.cpp",
1699 ]
1700 }
1701
Mike Reed7bf160e2019-05-17 16:50:51 -04001702 if (skia_use_ffmpeg) {
1703 test_lib("video_decoder") {
1704 sources = [
1705 "experimental/ffmpeg/SkVideoDecoder.cpp",
1706 "experimental/ffmpeg/SkVideoDecoder.h",
Mike Reedc0ee21f2019-05-28 16:11:03 -04001707 "experimental/ffmpeg/SkVideoEncoder.cpp",
1708 "experimental/ffmpeg/SkVideoEncoder.h",
Mike Reed7bf160e2019-05-17 16:50:51 -04001709 ]
1710 libs = [
Mike Reedf97e8e92019-05-29 13:33:55 -04001711 "swscale",
Mike Reed7bf160e2019-05-17 16:50:51 -04001712 "avcodec",
1713 "avformat",
1714 "avutil",
1715 ]
1716 }
1717 }
1718
Mike Klein6e744122016-10-27 12:21:40 -04001719 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001720 test_lib("gm") {
mtkleinc095df52016-08-24 12:23:52 -07001721 sources = gm_sources
1722 deps = [
Mike Kleine11e5c12019-04-24 12:46:06 -05001723 ":etc1",
scroggo19b91532016-10-24 09:03:26 -07001724 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001725 ":skia",
1726 ":tool_utils",
Mike Reed2f0edd52018-05-31 14:22:30 -04001727 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001728 "modules/skottie:gm",
Florin Malita3b526b02018-05-25 12:43:51 -04001729 "modules/sksg",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001730 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001731 ]
Mike Kleinc4abade2019-08-09 10:11:35 -04001732 if (is_skia_dev_build) {
1733 sources += [ "gm/fiddle.cpp" ]
1734 deps += [ ":skia.h" ]
1735 }
Greg Danielda16cce2018-08-01 09:23:57 -04001736 public_deps = [
1737 ":gpu_tool_utils",
1738 ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001739
1740 if (skia_use_ffmpeg) {
1741 deps += [ ":video_decoder" ]
1742 sources += [ "gm/video_decoder.cpp" ]
1743 }
mtkleinc095df52016-08-24 12:23:52 -07001744 }
mtklein25c81d42016-07-27 13:55:26 -07001745
Mike Klein7b7077c2019-06-03 17:10:59 -05001746 test_lib("skvm_builders") {
1747 sources = [
1748 "tools/SkVMBuilders.cpp",
1749 "tools/SkVMBuilders.h",
1750 ]
1751 }
1752
Mike Klein6e744122016-10-27 12:21:40 -04001753 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001754 test_lib("tests") {
Mike Klein6e744122016-10-27 12:21:40 -04001755 sources = tests_sources + pathops_tests_sources
Robert Phillips0c6daf02019-05-16 12:43:11 -04001756 if (skia_use_metal) {
1757 sources += metal_tests_sources
1758 }
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -05001759 if (!skia_enable_fontmgr_android) {
Mike Klein6e744122016-10-27 12:21:40 -04001760 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001761 }
Ben Wagner37a06c02018-06-22 21:11:00 +00001762 if (!(skia_use_freetype && skia_use_fontconfig)) {
1763 sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
1764 }
mtkleinc095df52016-08-24 12:23:52 -07001765 deps = [
Hal Canary0f666812018-03-22 15:21:12 -04001766 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001767 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001768 ":skia",
Mike Klein7b7077c2019-06-03 17:10:59 -05001769 ":skvm_builders",
mtkleinc095df52016-08-24 12:23:52 -07001770 ":tool_utils",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001771 "modules/skottie:tests",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001772 "modules/skparagraph:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001773 "modules/sksg:tests",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001774 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001775 "//third_party/libpng",
Leon Scroggins III194580d2019-02-22 12:32:16 -05001776 "//third_party/libwebp",
mtkleinc095df52016-08-24 12:23:52 -07001777 "//third_party/zlib",
1778 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001779 public_deps = [
1780 ":gpu_tool_utils", # Test.h #includes headers from this target.
1781 ]
mtkleinc095df52016-08-24 12:23:52 -07001782 }
mtklein2f3416d2016-08-02 16:02:05 -07001783
Mike Klein6e744122016-10-27 12:21:40 -04001784 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001785 test_lib("bench") {
mtkleinc095df52016-08-24 12:23:52 -07001786 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001787 deps = [
1788 ":flags",
1789 ":gm",
1790 ":gpu_tool_utils",
1791 ":skia",
Mike Klein7b7077c2019-06-03 17:10:59 -05001792 ":skvm_builders",
mtkleinc095df52016-08-24 12:23:52 -07001793 ":tool_utils",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001794 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04001795 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001796 ]
1797 }
mtklein2b6870c2016-07-28 14:17:33 -07001798
mtkleinc095df52016-08-24 12:23:52 -07001799 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001800 if (skia_use_expat) {
Hal Canary0f666812018-03-22 15:21:12 -04001801 sources = [
1802 "experimental/svg/model/SkSVGAttribute.cpp",
1803 "experimental/svg/model/SkSVGAttributeParser.cpp",
1804 "experimental/svg/model/SkSVGCircle.cpp",
1805 "experimental/svg/model/SkSVGClipPath.cpp",
1806 "experimental/svg/model/SkSVGContainer.cpp",
1807 "experimental/svg/model/SkSVGDOM.cpp",
1808 "experimental/svg/model/SkSVGEllipse.cpp",
1809 "experimental/svg/model/SkSVGGradient.cpp",
1810 "experimental/svg/model/SkSVGLine.cpp",
1811 "experimental/svg/model/SkSVGLinearGradient.cpp",
1812 "experimental/svg/model/SkSVGNode.cpp",
1813 "experimental/svg/model/SkSVGPath.cpp",
1814 "experimental/svg/model/SkSVGPattern.cpp",
1815 "experimental/svg/model/SkSVGPoly.cpp",
1816 "experimental/svg/model/SkSVGRadialGradient.cpp",
1817 "experimental/svg/model/SkSVGRect.cpp",
1818 "experimental/svg/model/SkSVGRenderContext.cpp",
1819 "experimental/svg/model/SkSVGSVG.cpp",
1820 "experimental/svg/model/SkSVGShape.cpp",
1821 "experimental/svg/model/SkSVGStop.cpp",
1822 "experimental/svg/model/SkSVGTransformableNode.cpp",
1823 "experimental/svg/model/SkSVGUse.cpp",
1824 "experimental/svg/model/SkSVGValue.cpp",
1825 ]
1826 deps = [
1827 ":skia",
1828 ":xml",
1829 ]
1830 }
mtkleinc095df52016-08-24 12:23:52 -07001831 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001832
Mike Reedd62d4062019-06-12 10:20:44 -04001833 test_lib("experimental_xform") {
1834 sources = [
1835 "experimental/xform/SkShape.cpp",
1836 "experimental/xform/SkXform.cpp",
1837 "experimental/xform/XContext.cpp",
1838 ]
1839 deps = [
1840 ":skia",
1841 ]
1842 }
1843
Mike Klein38af9432016-11-11 11:39:44 -05001844 if (skia_use_lua) {
1845 test_lib("lua") {
Mike Klein38af9432016-11-11 11:39:44 -05001846 sources = [
1847 "src/utils/SkLua.cpp",
1848 "src/utils/SkLuaCanvas.cpp",
1849 ]
1850 deps = [
Herb Derby264182c2018-05-29 15:53:40 -04001851 "modules/skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001852 "//third_party/lua",
1853 ]
1854 }
1855
Mike Kleine6682eb2017-01-05 10:54:57 -05001856 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001857 sources = [
1858 "tools/lua/lua_app.cpp",
1859 ]
1860 deps = [
1861 ":lua",
1862 ":skia",
1863 "//third_party/lua",
1864 ]
Mike Klein38af9432016-11-11 11:39:44 -05001865 }
1866
Mike Kleine6682eb2017-01-05 10:54:57 -05001867 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001868 sources = [
1869 "tools/lua/lua_pictures.cpp",
1870 ]
1871 deps = [
1872 ":flags",
1873 ":lua",
1874 ":skia",
1875 ":tool_utils",
1876 "//third_party/lua",
1877 ]
Mike Klein38af9432016-11-11 11:39:44 -05001878 }
1879 }
1880
Florin Malitabfe876a2018-09-02 12:33:59 -04001881 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04001882 test_app("skottie_tool") {
1883 deps = [
1884 "modules/skottie:tool",
1885 ]
1886 }
1887 }
1888
Hal Canary5b39dc82019-04-17 13:29:46 -04001889 test_app("make_skqp_model") {
1890 sources = [
1891 "tools/skqp/make_skqp_model.cpp",
1892 ]
1893 deps = [
1894 ":skia",
1895 ]
1896 }
1897
Kevin Lubickebf648e2017-09-21 13:45:16 -04001898 if (target_cpu != "wasm") {
1899 import("gn/samples.gni")
1900 test_lib("samples") {
Yuqian Li56a4a092018-02-12 14:47:34 +08001901 sources = samples_sources
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001902 public_deps = [
1903 ":tool_utils",
1904 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001905 deps = [
1906 ":experimental_svg_model",
1907 ":flags",
Mike Kleinc6142d82019-03-25 10:54:59 -05001908 ":gpu_tool_utils",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001909 ":xml",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001910 "modules/skparagraph:samples",
Mike Reedec80d902019-02-12 11:31:27 -05001911 "modules/sksg",
Herb Derby264182c2018-05-29 15:53:40 -04001912 "modules/skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001913 ]
Mike Klein38af9432016-11-11 11:39:44 -05001914
Kevin Lubickebf648e2017-09-21 13:45:16 -04001915 if (skia_use_lua) {
1916 sources += [ "samplecode/SampleLua.cpp" ]
1917 deps += [
1918 ":lua",
1919 "//third_party/lua",
1920 ]
1921 }
1922 }
Mike Klein7af351a2018-07-27 09:54:43 -04001923 test_app("imgcvt") {
1924 sources = [
1925 "tools/imgcvt.cpp",
1926 ]
1927 deps = [
1928 ":skcms",
1929 ":skia",
1930 ]
1931 }
Mike Klein735c7ba2019-03-25 12:57:58 -05001932 test_lib("hash_and_encode") {
Mike Klein735c7ba2019-03-25 12:57:58 -05001933 sources = [
1934 "tools/HashAndEncode.cpp",
1935 "tools/HashAndEncode.h",
1936 ]
1937 deps = [
1938 ":flags",
1939 ":skia",
1940 "//third_party/libpng",
1941 ]
1942 }
1943 test_app("fm") {
1944 sources = [
1945 "tools/fm/fm.cpp",
1946 ]
1947 deps = [
1948 ":common_flags_aa",
1949 ":common_flags_gpu",
Mike Klein6253d902019-03-27 15:09:12 -05001950 ":experimental_svg_model",
Mike Klein735c7ba2019-03-25 12:57:58 -05001951 ":flags",
1952 ":gm",
1953 ":gpu_tool_utils",
1954 ":hash_and_encode",
1955 ":skia",
1956 ":tool_utils",
1957 ":trace",
Mike Klein22924262019-04-02 14:14:56 -04001958 "modules/skottie",
1959 "modules/skottie:utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05001960 ]
1961 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04001962 test_app("dm") {
1963 sources = [
1964 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001965 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001966 "dm/DMJsonWriter.cpp",
1967 "dm/DMSrcSink.cpp",
1968 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001969 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05001970 ":common_flags_aa",
1971 ":common_flags_config",
1972 ":common_flags_gpu",
1973 ":common_flags_images",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001974 ":experimental_svg_model",
1975 ":flags",
1976 ":gm",
1977 ":gpu_tool_utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05001978 ":hash_and_encode",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001979 ":skia",
1980 ":tests",
1981 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05001982 ":trace",
Florin Malita3d856bd2018-05-26 09:49:28 -04001983 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05001984 "modules/skottie:utils",
Florin Malita3b526b02018-05-25 12:43:51 -04001985 "modules/sksg",
Mike Klein38af9432016-11-11 11:39:44 -05001986 ]
1987 }
Brian Osman16adfa32016-10-18 14:42:44 -04001988 }
1989
Mike Kleina8a51ce2018-01-09 12:34:11 -05001990 if (!is_win) {
1991 test_app("remote_demo") {
1992 sources = [
1993 "tools/remote_demo.cpp",
1994 ]
1995 deps = [
1996 ":skia",
1997 ]
1998 }
1999 }
2000
Mike Kleine6682eb2017-01-05 10:54:57 -05002001 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07002002 sources = [
2003 "bench/nanobench.cpp",
2004 ]
2005 deps = [
2006 ":bench",
Mike Kleinc6142d82019-03-25 10:54:59 -05002007 ":common_flags_aa",
2008 ":common_flags_config",
2009 ":common_flags_gpu",
2010 ":common_flags_images",
fmalita6519c212016-09-14 08:05:17 -07002011 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07002012 ":flags",
2013 ":gm",
2014 ":gpu_tool_utils",
2015 ":skia",
2016 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002017 ":trace",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002018 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04002019 "modules/sksg",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002020 "modules/skshaper",
mtklein2b6870c2016-07-28 14:17:33 -07002021 ]
mtklein2b6870c2016-07-28 14:17:33 -07002022 }
halcanary19a97202016-08-03 15:08:04 -07002023
Ravi Mistry10d36c52017-01-31 09:49:18 -05002024 test_app("skpinfo") {
2025 sources = [
2026 "tools/skpinfo.cpp",
2027 ]
2028 deps = [
2029 ":flags",
2030 ":skia",
2031 ]
2032 }
2033
Mike Reedc0ee21f2019-05-28 16:11:03 -04002034 if (skia_use_ffmpeg) {
2035 test_app("skottie2movie") {
2036 sources = [
2037 "tools/skottie2movie.cpp",
2038 ]
2039 deps = [
2040 ":flags",
2041 ":skia",
2042 ":video_decoder",
2043 "modules/skottie",
Mike Reed5093e232019-05-30 10:10:50 -04002044 "modules/skottie:utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002045 ]
2046 }
2047 }
2048
Brian Osmanc9a42472018-05-31 13:17:12 -04002049 test_app("skpbench") {
2050 sources = [
2051 "tools/skpbench/skpbench.cpp",
2052 ]
2053 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002054 ":common_flags_config",
2055 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002056 ":flags",
2057 ":gpu_tool_utils",
2058 ":skia",
2059 ":tool_utils",
2060 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07002061 }
2062
Mike Kleine6682eb2017-01-05 10:54:57 -05002063 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07002064 sources = [
Herb Derby264182c2018-05-29 15:53:40 -04002065 "tools/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07002066 ]
2067 deps = [
2068 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04002069 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07002070 ]
halcanary3eee9d92016-09-10 07:01:53 -07002071 }
mtklein046cb562016-09-16 10:23:12 -07002072
Ben Wagner219f3622017-07-17 15:32:25 -04002073 test_app("create_test_font") {
2074 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05002075 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04002076 ]
2077 deps = [
2078 ":skia",
2079 ]
2080 assert_no_deps = [
2081 # tool_utils requires the output of this app.
2082 ":tool_utils",
2083 ]
2084 }
2085
Florin Malita5d3ff432018-07-31 16:38:43 -04002086 if (skia_use_expat) {
2087 test_app("create_test_font_color") {
2088 sources = [
2089 "tools/fonts/create_test_font_color.cpp",
2090 ]
2091 deps = [
2092 ":flags",
2093 ":skia",
2094 ":tool_utils",
2095 ]
2096 }
Ben Wagner97182cc2018-02-15 10:20:04 -05002097 }
2098
Mike Kleine6682eb2017-01-05 10:54:57 -05002099 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07002100 sources = [
2101 "tools/get_images_from_skps.cpp",
2102 ]
2103 deps = [
2104 ":flags",
2105 ":skia",
mtklein046cb562016-09-16 10:23:12 -07002106 ]
mtklein046cb562016-09-16 10:23:12 -07002107 }
mtkleinecbc5262016-09-22 11:51:24 -07002108
Brian Osman6788a542018-12-10 11:56:01 -05002109 if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
Mike Kleine6682eb2017-01-05 10:54:57 -05002110 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04002111 sources = [
2112 "tools/skiaserve/Request.cpp",
2113 "tools/skiaserve/Response.cpp",
2114 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002115 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
2116 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
2117 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
2118 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
2119 "tools/skiaserve/urlhandlers/DataHandler.cpp",
2120 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
2121 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
2122 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
2123 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05002124 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
2125 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002126 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
2127 "tools/skiaserve/urlhandlers/PostHandler.cpp",
2128 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
2129 "tools/skiaserve/urlhandlers/RootHandler.cpp",
2130 ]
2131 deps = [
2132 ":flags",
2133 ":gpu_tool_utils",
2134 ":skia",
2135 ":tool_utils",
Mike Klein7d302882016-11-03 14:06:31 -04002136 "//third_party/libmicrohttpd",
Mike Klein7d302882016-11-03 14:06:31 -04002137 ]
Mike Klein7d302882016-11-03 14:06:31 -04002138 }
mtkleinecbc5262016-09-22 11:51:24 -07002139 }
kjlubick14f984b2016-10-03 11:49:45 -07002140
Mike Kleine6682eb2017-01-05 10:54:57 -05002141 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07002142 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002143 "fuzz/Fuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05002144 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002145 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05002146 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04002147 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002148 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002149 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002150 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002151 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002152 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04002153 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04002154 "fuzz/FuzzRegionOp.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002155 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05002156 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
2157 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002158 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002159 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04002160 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002161 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05002162 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
2163 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002164 "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
2165 "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
Kevin Lubick0f0a7102019-03-18 16:20:55 -04002166 "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002167 "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002168 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05002169 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002170 "tools/debugger/DebugCanvas.cpp",
2171 "tools/debugger/DrawCommand.cpp",
2172 "tools/debugger/JsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002173 ]
2174 deps = [
2175 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04002176 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07002177 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04002178 "modules/skottie:fuzz",
kjlubick14f984b2016-10-03 11:49:45 -07002179 ]
kjlubick14f984b2016-10-03 11:49:45 -07002180 }
Mike Klein38312422016-10-05 15:41:01 -04002181
Mike Kleine6682eb2017-01-05 10:54:57 -05002182 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04002183 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04002184 rebase_path("tests/skia_test.cpp"),
2185 rebase_path("tests/Test.cpp"),
2186 ]
caryclark9feb6322016-10-25 08:58:26 -07002187 deps = [
2188 ":flags",
2189 ":gpu_tool_utils",
2190 ":skia",
2191 ":tool_utils",
2192 ]
caryclark9feb6322016-10-25 08:58:26 -07002193 }
2194
Mike Kleine6682eb2017-01-05 10:54:57 -05002195 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04002196 sources = [
2197 "tools/DumpRecord.cpp",
2198 "tools/dump_record.cpp",
2199 ]
2200 deps = [
2201 ":flags",
2202 ":skia",
2203 ]
Mike Klein38312422016-10-05 15:41:01 -04002204 }
bungemanfe917272016-10-13 17:36:40 -04002205
Mike Kleine6682eb2017-01-05 10:54:57 -05002206 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04002207 sources = [
2208 "tools/skdiff/skdiff.cpp",
2209 "tools/skdiff/skdiff_html.cpp",
2210 "tools/skdiff/skdiff_main.cpp",
2211 "tools/skdiff/skdiff_utils.cpp",
2212 ]
2213 deps = [
2214 ":skia",
2215 ":tool_utils",
2216 ]
bungemanfe917272016-10-13 17:36:40 -04002217 }
halcanarya73d76a2016-10-17 13:19:02 -07002218
Mike Kleine6682eb2017-01-05 10:54:57 -05002219 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07002220 sources = [
2221 "tools/skp_parser.cpp",
2222 ]
2223 deps = [
2224 ":skia",
2225 ":tool_utils",
halcanarya73d76a2016-10-17 13:19:02 -07002226 ]
halcanarya73d76a2016-10-17 13:19:02 -07002227 }
Brian Osman16adfa32016-10-18 14:42:44 -04002228
Brian Osmanc9a42472018-05-31 13:17:12 -04002229 if (!is_win) {
Hal Canaryd7b38452017-12-11 17:46:26 -05002230 test_lib("skqp_lib") {
Hal Canary0e07ad72018-02-08 13:06:56 -05002231 defines =
2232 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary75427132017-10-11 16:00:31 -04002233 sources = [
2234 "dm/DMGpuTestProcs.cpp",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002235 "tools/skqp/src/skqp.cpp",
2236 "tools/skqp/src/skqp_model.cpp",
Hal Canary75427132017-10-11 16:00:31 -04002237 ]
2238 deps = [
2239 ":gm",
2240 ":gpu_tool_utils",
2241 ":skia",
2242 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05002243 ":tool_utils",
2244 ]
2245 }
2246 test_app("skqp") {
2247 sources = [
Hal Canaryac7f23c2018-11-26 14:07:41 -05002248 "tools/skqp/src/skqp_main.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05002249 ]
2250 deps = [
2251 ":skia",
2252 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05002253 ":tool_utils",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002254 ]
2255 }
2256 test_app("jitter_gms") {
2257 sources = [
2258 "tools/skqp/jitter_gms.cpp",
2259 ]
2260 deps = [
2261 ":gm",
2262 ":skia",
2263 ":skqp_lib",
Hal Canary75427132017-10-11 16:00:31 -04002264 ]
2265 }
2266 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002267 if (is_android) {
Hal Canary28f89382017-12-12 09:42:14 -05002268 test_app("skqp_app") {
2269 is_shared_library = true
2270 sources = [
Hal Canaryac7f23c2018-11-26 14:07:41 -05002271 "tools/skqp/src/jni_skqp.cpp",
Hal Canary28f89382017-12-12 09:42:14 -05002272 ]
2273 deps = [
2274 ":skia",
2275 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05002276 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05002277 ]
2278 libs = [ "android" ]
2279 }
2280 }
Stan Iliev93151722018-08-02 11:10:52 -04002281 if (is_android && skia_enable_gpu) {
2282 test_app("skottie_android") {
2283 is_shared_library = true
2284
2285 sources = [
2286 "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
2287 "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
2288 ]
2289 libs = []
2290
Stan Iliev93151722018-08-02 11:10:52 -04002291 deps = [
2292 ":skia",
2293 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04002294 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04002295 ]
2296 }
2297 }
Hal Canary75427132017-10-11 16:00:31 -04002298
Hal Canarya9de7602018-01-19 13:08:23 -05002299 test_app("list_gms") {
2300 sources = [
2301 "tools/list_gms.cpp",
2302 ]
2303 deps = [
2304 ":gm",
2305 ":skia",
2306 ]
2307 }
2308 test_app("list_gpu_unit_tests") {
2309 sources = [
2310 "dm/DMGpuTestProcs.cpp",
2311 "tools/list_gpu_unit_tests.cpp",
2312 ]
2313 deps = [
2314 ":skia",
2315 ":tests",
2316 ]
2317 }
2318
Brian Osmanc9a42472018-05-31 13:17:12 -04002319 test_lib("sk_app") {
Hal Canary378be8d2019-04-26 08:20:14 -04002320 public_deps = [
Hal Canary378be8d2019-04-26 08:20:14 -04002321 ":gpu_tool_utils",
Hal Canary05694472019-05-03 17:14:21 -04002322 ":skia",
Hal Canary378be8d2019-04-26 08:20:14 -04002323 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002324 sources = [
2325 "tools/sk_app/CommandSet.cpp",
2326 "tools/sk_app/GLWindowContext.cpp",
2327 "tools/sk_app/Window.cpp",
2328 ]
2329 libs = []
2330
Stephen Whitea800ec92019-08-02 15:04:52 -04002331 if (skia_use_dawn) {
2332 sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
2333 }
2334
Brian Osmanc9a42472018-05-31 13:17:12 -04002335 if (is_android) {
2336 sources += [
2337 "tools/sk_app/android/GLWindowContext_android.cpp",
2338 "tools/sk_app/android/RasterWindowContext_android.cpp",
2339 "tools/sk_app/android/Window_android.cpp",
2340 "tools/sk_app/android/main_android.cpp",
2341 "tools/sk_app/android/surface_glue_android.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002342 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002343 libs += [ "android" ]
2344 } else if (is_linux) {
2345 sources += [
2346 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2347 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2348 "tools/sk_app/unix/Window_unix.cpp",
2349 "tools/sk_app/unix/keysym2ucs.c",
2350 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002351 ]
Stephen Whitea800ec92019-08-02 15:04:52 -04002352 if (skia_use_dawn) {
2353 if (dawn_enable_vulkan) {
2354 sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
2355 defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
2356 libs += [ "X11-xcb" ]
2357 }
2358 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002359 libs += [
2360 "GL",
2361 "X11",
2362 ]
2363 } else if (is_win) {
2364 sources += [
2365 "tools/sk_app/win/GLWindowContext_win.cpp",
2366 "tools/sk_app/win/RasterWindowContext_win.cpp",
2367 "tools/sk_app/win/Window_win.cpp",
2368 "tools/sk_app/win/main_win.cpp",
2369 ]
Brian Salomon194db172017-08-17 14:37:06 -04002370 if (skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002371 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002372 }
Stephen Whitea800ec92019-08-02 15:04:52 -04002373 if (skia_use_dawn) {
2374 if (dawn_enable_d3d12) {
2375 sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
2376 }
2377 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002378 } else if (is_mac) {
2379 sources += [
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002380 "tools/sk_app/mac/GLWindowContext_mac.mm",
2381 "tools/sk_app/mac/RasterWindowContext_mac.mm",
2382 "tools/sk_app/mac/Window_mac.mm",
2383 "tools/sk_app/mac/main_mac.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002384 ]
Stephen Whitea800ec92019-08-02 15:04:52 -04002385 if (skia_use_dawn) {
2386 if (dawn_enable_metal) {
2387 sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
2388 }
2389 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002390 libs += [
2391 "QuartzCore.framework",
2392 "Cocoa.framework",
2393 "Foundation.framework",
2394 ]
2395 } else if (is_ios) {
2396 sources += [
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002397 "tools/sk_app/ios/GLWindowContext_ios.mm",
2398 "tools/sk_app/ios/RasterWindowContext_ios.mm",
2399 "tools/sk_app/ios/Window_ios.mm",
2400 "tools/sk_app/ios/main_ios.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002401 ]
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002402 libs += [ "QuartzCore.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002403 }
2404
2405 if (skia_use_vulkan) {
2406 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
2407 if (is_android) {
2408 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2409 } else if (is_linux) {
2410 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2411 libs += [ "X11-xcb" ]
2412 } else if (is_win) {
2413 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Jim Van Verthce51c142019-02-14 14:07:46 -05002414 } else if (is_mac) {
2415 sources += [ "tools/sk_app/mac/VulkanWindowContext_mac.mm" ]
2416 libs += [ "MetalKit.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002417 }
2418 }
2419
Jim Van Verthbe39f712019-02-08 15:36:14 -05002420 if (skia_use_metal) {
2421 sources += [ "tools/sk_app/MetalWindowContext.mm" ]
2422 if (is_mac) {
2423 sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002424 } else if (is_ios) {
Jim Van Verthe58d5322019-09-03 09:42:57 -04002425 sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002426 }
Jim Van Verthbe39f712019-02-08 15:36:14 -05002427 }
2428
Brian Osmanc9a42472018-05-31 13:17:12 -04002429 deps = [
Brian Osmanc9a42472018-05-31 13:17:12 -04002430 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002431 ]
2432 if (is_android) {
2433 deps += [ "//third_party/native_app_glue" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002434 }
2435 if (skia_use_angle) {
2436 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002437 }
Brian Osman16adfa32016-10-18 14:42:44 -04002438 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002439
Hal Canary87515122019-03-15 14:22:51 -04002440 if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
2441 test_app("fiddle_examples") {
2442 sources = [
Brian Osmanc725e8f2019-04-10 14:08:44 -04002443 "tools/fiddle/all_examples.cpp",
Hal Canary87515122019-03-15 14:22:51 -04002444 "tools/fiddle/examples.cpp",
Brian Osman72ef2d52019-03-17 11:09:17 -04002445 "tools/fiddle/examples.h",
Hal Canary87515122019-03-15 14:22:51 -04002446 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002447 if (is_win) {
2448 cflags = [ "/wd4756" ] # Overflow in constant arithmetic
2449 }
Hal Canary87515122019-03-15 14:22:51 -04002450 deps = [
2451 ":skia",
2452 ":skia.h",
2453 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04002454 "modules/skshaper",
Hal Canary87515122019-03-15 14:22:51 -04002455 ]
2456 }
2457 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002458 test_app("viewer") {
2459 is_shared_library = is_android
Brian Osmanc9a42472018-05-31 13:17:12 -04002460 sources = [
Hal Canary41248072019-07-11 16:32:53 -04002461 "tools/viewer/AnimTimer.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002462 "tools/viewer/BisectSlide.cpp",
2463 "tools/viewer/GMSlide.cpp",
2464 "tools/viewer/ImGuiLayer.cpp",
2465 "tools/viewer/ImageSlide.cpp",
Brian Osman7c979f52019-02-12 13:27:51 -05002466 "tools/viewer/ParticlesSlide.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04002467 "tools/viewer/SKPSlide.cpp",
2468 "tools/viewer/SampleSlide.cpp",
2469 "tools/viewer/SkottieSlide.cpp",
2470 "tools/viewer/SlideDir.cpp",
2471 "tools/viewer/StatsLayer.cpp",
2472 "tools/viewer/SvgSlide.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002473 "tools/viewer/TouchGesture.cpp",
Leon Scroggins III81886e82018-08-22 11:18:08 -04002474 "tools/viewer/TouchGesture.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002475 "tools/viewer/Viewer.cpp",
2476 ]
2477 libs = []
2478
Brian Osmanc9a42472018-05-31 13:17:12 -04002479 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002480 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002481 ":experimental_svg_model",
2482 ":flags",
2483 ":gm",
2484 ":gpu_tool_utils",
2485 ":samples",
2486 ":sk_app",
2487 ":skia",
2488 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002489 ":trace",
Brian Osman7c979f52019-02-12 13:27:51 -05002490 "modules/particles",
Brian Osmanc9a42472018-05-31 13:17:12 -04002491 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05002492 "modules/skottie:utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002493 "modules/sksg",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002494 "modules/sksg:samples",
Brian Osmanc9a42472018-05-31 13:17:12 -04002495 "//third_party/imgui",
Brian Osmanc9a42472018-05-31 13:17:12 -04002496 ]
Mike Reedd62d4062019-06-12 10:20:44 -04002497 if (skia_use_experimental_xform) {
2498 deps += [ ":experimental_xform" ]
2499 sources += [ "gm/xform.cpp" ]
2500 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002501 }
2502
Brian Osmanc9a42472018-05-31 13:17:12 -04002503 if (!skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002504 test_app("HelloWorld") {
2505 sources = [
2506 "example/HelloWorld.cpp",
2507 ]
2508 libs = []
2509
Brian Osmaneff04b52017-11-21 13:18:02 -05002510 deps = [
2511 ":flags",
2512 ":gpu_tool_utils",
2513 ":sk_app",
2514 ":skia",
2515 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002516 ]
2517 }
2518 }
2519
Brian Osmanc9a42472018-05-31 13:17:12 -04002520 if (is_linux || is_mac || is_ios) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002521 test_app("SkiaSDLExample") {
2522 sources = [
2523 "example/SkiaSDLExample.cpp",
2524 ]
2525 libs = []
Jim Van Verth4c70c752017-07-11 12:03:01 -04002526 deps = [
2527 ":gpu_tool_utils",
2528 ":skia",
2529 "//third_party/libsdl",
2530 ]
2531 }
2532 }
2533
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002534 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2535 action_foreach("generate_mocs") {
2536 script = "gn/call.py"
2537 sources = [
2538 "tools/mdbviz/MainWindow.h",
2539 ]
2540 outputs = [
2541 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2542 ]
2543 args = [
2544 "$skia_qt_path" + "/bin/moc",
2545 "{{source}}",
2546 "-o",
2547 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2548 ]
2549 }
2550 action_foreach("generate_resources") {
2551 script = "gn/call.py"
2552 sources = [
2553 "tools/mdbviz/resources.qrc",
2554 ]
2555 outputs = [
2556 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2557 ]
2558 args = [
2559 "$skia_qt_path" + "/bin/rcc",
2560 "{{source}}",
2561 "-o",
2562 "gen/mdbviz/{{source_name_part}}_res.cpp",
2563 ]
2564 }
2565 test_app("mdbviz") {
2566 if (is_win) {
2567 # on Windows we need to disable some exception handling warnings due to the Qt headers
2568 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2569 }
2570 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002571 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002572 "tools/debugger/DebugCanvas.cpp",
2573 "tools/debugger/DrawCommand.cpp",
2574 "tools/debugger/JsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002575 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002576 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002577 "tools/mdbviz/main.cpp",
2578
2579 # generated files
2580 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2581 "$target_gen_dir/mdbviz/resources_res.cpp",
2582 ]
2583 lib_dirs = [ "$skia_qt_path/lib" ]
2584 libs = [
2585 "Qt5Core.lib",
2586 "Qt5Gui.lib",
2587 "Qt5Widgets.lib",
2588 ]
2589 include_dirs = [
2590 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002591 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002592 "$skia_qt_path/include/QtWidgets",
2593 ]
2594 deps = [
2595 ":generate_mocs",
2596 ":generate_resources",
2597 ":skia",
2598 ]
2599 }
2600 }
2601
Mike Kleine459afd2017-03-03 09:21:30 -05002602 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002603 copy("gdbserver") {
2604 sources = [
2605 "$ndk/$ndk_gdbserver",
2606 ]
2607 outputs = [
2608 "$root_out_dir/gdbserver",
2609 ]
2610 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002611 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002612
2613 if (skia_use_opencl) {
2614 test_app("hello-opencl") {
2615 sources = [
Mike Kleinf9ae6702018-06-20 14:05:05 -04002616 "tools/hello-opencl.cpp",
2617 ]
Mike Klein8a1f15d2019-02-11 11:59:41 -05002618 deps = [
2619 "//third_party/opencl",
2620 ]
Mike Kleinf9ae6702018-06-20 14:05:05 -04002621 }
2622 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002623
Brian Osmanf564f152019-07-23 15:14:30 -04002624 executable("cpu_modules") {
2625 sources = [
2626 "tools/cpu_modules.cpp",
2627 ]
2628 deps = [
2629 ":skia",
2630 "modules/particles",
2631 ]
2632 }
2633
Hal Canary1f94d392019-07-30 09:27:56 -04002634 if (skia_use_icu && skia_use_harfbuzz) {
2635 test_app("editor") {
2636 is_shared_library = is_android
2637 deps = [
Hal Canarya0b66fc2019-08-23 10:16:51 -04002638 "modules/skplaintexteditor:editor_app",
Hal Canary1f94d392019-07-30 09:27:56 -04002639 ]
2640 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002641 }
Mike Kleinb5f95cd2019-07-02 14:16:26 -05002642
Mike Klein7e650762019-07-02 15:21:11 -05002643 if (skia_enable_skvm_jit) {
Mike Kleinb5f95cd2019-07-02 14:16:26 -05002644 test_app("skvmtool") {
2645 defines = [
2646 "SKVM_JIT",
2647 "SKVM_PERF_DUMPS",
2648 ]
2649 include_dirs = [ "." ]
2650 sources = [
2651 "src/core/SkSpinlock.cpp",
2652 "src/core/SkThreadID.cpp",
2653 "src/core/SkVM.cpp",
Mike Klein84bcd0c2019-07-23 11:46:09 -05002654 "tools/SkVMBuilders.cpp",
Mike Kleinb5f95cd2019-07-02 14:16:26 -05002655 "tools/SkVMTool.cpp",
2656 ]
2657 if (target_cpu == "x64") {
2658 sources += [ "src/core/SkCpu.cpp" ]
2659 }
2660 }
2661 }
mtklein25c81d42016-07-27 13:55:26 -07002662}