blob: c8106911a51f1787b521dc5b14fc3c84fe7331c7 [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
Kevin Lubick32dfdbe2018-10-18 09:47:01 -040052 skia_enable_skpicture = true
Brian Osman489cf882019-07-09 10:48:28 -040053 skia_enable_sksl_interpreter = is_skia_dev_build
Mike Klein977e5322019-07-15 11:38:12 -050054 skia_enable_skvm_jit =
Mike Klein08ba1132019-07-15 11:44:52 -050055 is_skia_dev_build && ((target_cpu == "x64" && (is_linux || is_mac)) ||
56 (target_cpu == "arm64" && is_android))
Mike Klein3669a822017-03-03 10:55:02 -050057 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Robert Phillipsa6d2d702017-09-01 12:17:03 -040058 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040059 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070060 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070061 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040062
Hal Canary2331c822018-02-01 14:06:13 -050063 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040064
65 skia_llvm_path = ""
66 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040067
68 skia_tools_require_resources = false
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -040069 skia_include_multiframe_procs = false
mtkleinc04ff472016-06-23 10:29:30 -070070}
Stephen White0d70b712019-07-10 15:51:30 -040071
72if (skia_use_dawn) {
73 import("third_party/externals/dawn/scripts/dawn_features.gni")
74}
75
Brian Salomon23d73ea2016-10-27 13:31:37 -040076declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040077 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040078 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050079 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -050080 skia_enable_fontmgr_empty = false
Kevin Lubickddd0a332018-12-12 10:35:13 -050081 skia_enable_fontmgr_custom =
82 is_linux && skia_use_freetype && !skia_use_fontconfig
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -050083 skia_enable_fontmgr_custom_empty = is_fuchsia && skia_use_freetype
84 skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
Sergey Ulanovf3babcd2018-11-30 17:42:00 -080085 skia_enable_fontmgr_fuchsia = is_fuchsia
Leon Scroggins III631dbc82019-03-04 13:54:02 -050086 skia_enable_fontmgr_win = is_win
87 skia_enable_fontmgr_win_gdi = is_win
Mike Klein10d665d2016-11-01 11:46:10 -040088
Kevin Lubick27ba7032019-03-21 08:13:54 -040089 if (is_mac) {
90 skia_gl_standard = "gl"
91 } else if (is_ios) {
92 skia_gl_standard = "gles"
93 } else {
94 skia_gl_standard = ""
95 }
96
Mike Klein4d598a32016-10-31 13:44:49 -040097 if (is_android) {
98 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070099 } else if (is_fuchsia) {
100 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -0400101 } else {
Mike Klein98dea7b2019-01-15 11:26:43 -0500102 skia_use_vulkan = defined(skia_moltenvk_path) && skia_moltenvk_path != ""
Mike Klein4d598a32016-10-31 13:44:49 -0400103 }
Jim Van Verth4e502972017-12-07 15:16:10 -0500104
105 if (is_ios) {
106 skia_ios_identity = ".*Google.*"
107 skia_ios_profile = "Google Development"
108 }
Brian Salomon23d73ea2016-10-27 13:31:37 -0400109}
Brian Salomon789e25e2016-09-30 13:41:03 -0400110
Adam Barth54ef74a2017-10-13 10:59:38 -0700111if (defined(skia_settings)) {
112 import(skia_settings)
113}
114
mtkleinc04ff472016-06-23 10:29:30 -0700115# Skia public API, generally provided by :skia.
116config("skia_public") {
Mike Klein9e25bb92019-04-29 09:46:36 -0500117 include_dirs = [ "." ]
118
Mike Kleinae7e6712016-10-11 17:49:33 -0400119 defines = []
120 if (is_component_build) {
121 defines += [ "SKIA_DLL" ]
122 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400123 if (is_fuchsia || is_linux) {
Mike Kleinf0a53692019-04-24 11:42:40 -0500124 defines += [ "SK_R32_SHIFT=16" ]
jcgregorio5561e3d2016-08-25 09:25:11 -0700125 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400126 if (skia_enable_flutter_defines) {
127 defines += flutter_defines
128 }
mtklein06c35c02016-09-20 12:28:12 -0700129 if (!skia_enable_gpu) {
130 defines += [ "SK_SUPPORT_GPU=0" ]
131 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500132 if (skia_enable_atlas_text) {
133 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
134 }
Mike Reed025f7832018-11-12 09:27:05 -0500135 if (is_fuchsia) {
136 defines += fuchsia_defines
137 }
Kevin Lubick27ba7032019-03-21 08:13:54 -0400138 if (skia_gl_standard == "gles") {
139 defines += [ "SK_ASSUME_GL_ES=1" ]
140 } else if (skia_gl_standard == "gl") {
141 defines += [ "SK_ASSUME_GL=1" ]
Kevin Lubick39026282019-03-28 12:46:40 -0400142 } else if (skia_gl_standard == "webgl") {
143 defines += [ "SK_ASSUME_WEBGL=1" ]
Kevin Lubick27ba7032019-03-21 08:13:54 -0400144 }
mtkleinc04ff472016-06-23 10:29:30 -0700145}
146
147# Skia internal APIs, used by Skia itself and a few test tools.
148config("skia_private") {
149 visibility = [ ":*" ]
150
Mike Reeda9e241d2017-05-03 10:52:00 -0400151 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
Leon Scroggins IIIc41a5f52018-11-15 15:54:59 -0500152 if (skia_use_fixed_gamma_text) {
mtkleinb37c0342016-09-09 11:07:45 -0700153 defines += [
154 "SK_GAMMA_EXPONENT=1.4",
155 "SK_GAMMA_CONTRAST=0.0",
156 ]
157 }
Mike Kleinb45d8622019-04-24 14:04:01 -0500158 if (is_skia_dev_build) {
159 defines += [
160 "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
161 "GR_TEST_UTILS=1",
162 ]
mtklein88a7ac02016-09-14 11:16:49 -0700163 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400164 libs = []
165 lib_dirs = []
Brian Osman34755e22016-12-05 09:46:02 -0500166 if (skia_use_angle) {
167 defines += [ "SK_ANGLE" ]
168 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400169 if (skia_llvm_path != "") {
170 defines += [ "SK_LLVM_AVAILABLE" ]
171 include_dirs += [ "$skia_llvm_path/include" ]
172 libs += [ skia_llvm_lib ]
173 lib_dirs += [ "$skia_llvm_path/lib/" ]
174 }
mtkleinc04ff472016-06-23 10:29:30 -0700175}
176
177# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
178config("skia_library") {
179 visibility = [ ":*" ]
Mike Kleinf5f4e812019-04-29 15:45:14 +0000180 defines = [ "SKIA_IMPLEMENTATION=1" ]
mtkleinc04ff472016-06-23 10:29:30 -0700181}
182
183skia_library_configs = [
184 ":skia_public",
185 ":skia_private",
186 ":skia_library",
187]
188
mtklein9b8583d2016-08-24 17:32:30 -0700189# Use for CPU-specific Skia code that needs particular compiler flags.
190template("opts") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500191 visibility = [ ":*" ]
mtklein9b8583d2016-08-24 17:32:30 -0700192 if (invoker.enabled) {
193 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500194 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700195 forward_variables_from(invoker, "*")
196 configs += skia_library_configs
197 }
198 } else {
199 # If not enabled, a phony empty target that swallows all otherwise unused variables.
200 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500201 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700202 forward_variables_from(invoker,
203 "*",
204 [
205 "sources",
206 "cflags",
207 ])
208 }
209 }
anmittala7eaf2e2016-08-17 13:57:26 -0700210}
211
mtklein422310d2016-08-16 18:28:43 -0700212is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700213
mtklein7d6fb2c2016-08-25 14:50:44 -0700214opts("none") {
215 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700216 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700217 cflags = []
218}
219
mtklein7d6fb2c2016-08-25 14:50:44 -0700220opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700221 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700222 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700223 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700224}
225
226opts("arm64") {
227 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700228 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700229 cflags = []
230}
231
232opts("crc32") {
233 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700234 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700235 cflags = [ "-march=armv8-a+crc" ]
236}
237
mtklein9b8583d2016-08-24 17:32:30 -0700238opts("sse2") {
239 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700240 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400241 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400242 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
243 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400244 cflags = [ "-msse2" ]
245 }
mtklein9b8583d2016-08-24 17:32:30 -0700246}
mtkleinc04ff472016-06-23 10:29:30 -0700247
mtklein9b8583d2016-08-24 17:32:30 -0700248opts("ssse3") {
249 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700250 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400251 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400252 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
253 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400254 cflags = [ "-mssse3" ]
255 }
mtklein9b8583d2016-08-24 17:32:30 -0700256}
mtkleinc04ff472016-06-23 10:29:30 -0700257
mtklein9b8583d2016-08-24 17:32:30 -0700258opts("sse41") {
259 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700260 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400261 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400262 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
263 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400264 cflags = [ "-msse4.1" ]
265 }
mtklein9b8583d2016-08-24 17:32:30 -0700266}
mtklein4e976072016-08-08 09:06:27 -0700267
mtklein9b8583d2016-08-24 17:32:30 -0700268opts("sse42") {
269 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700270 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400271 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400272 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
273 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400274 cflags = [ "-msse4.2" ]
275 }
mtklein9b8583d2016-08-24 17:32:30 -0700276}
277
278opts("avx") {
279 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700280 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400281 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000282 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400283 } else {
284 cflags = [ "-mavx" ]
285 }
mtkleinc04ff472016-06-23 10:29:30 -0700286}
287
Mike Klein1b9b7d52018-02-27 10:37:40 -0500288opts("hsw") {
289 enabled = is_x86
290 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400291 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500292 cflags = [ "/arch:AVX2" ]
293 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000294 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500295 }
Mike Klein1b9b7d52018-02-27 10:37:40 -0500296}
297
mtkleinc095df52016-08-24 12:23:52 -0700298# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700299template("optional") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500300 visibility = [ ":*" ]
mtklein457b42a2016-08-23 13:56:37 -0700301 if (invoker.enabled) {
302 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700303 if (defined(invoker.public_defines)) {
304 defines = invoker.public_defines
305 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600306 if (defined(invoker.public_configs)) {
307 configs = invoker.public_configs
308 }
mtklein457b42a2016-08-23 13:56:37 -0700309 }
310 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500311 check_includes = false
mtkleincd01b032016-08-31 04:58:19 -0700312 forward_variables_from(invoker,
313 "*",
314 [
315 "public_defines",
316 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700317 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700318 ])
mtklein457b42a2016-08-23 13:56:37 -0700319 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700320 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700321 if (defined(invoker.configs_to_remove)) {
322 configs -= invoker.configs_to_remove
323 }
mtklein457b42a2016-08-23 13:56:37 -0700324 }
325 } else {
mtklein457b42a2016-08-23 13:56:37 -0700326 source_set(target_name) {
327 forward_variables_from(invoker,
328 "*",
329 [
330 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400331 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700332 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700333 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700334 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700335 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700336 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700337 ])
mtkleincd01b032016-08-31 04:58:19 -0700338 if (defined(invoker.sources_when_disabled)) {
339 sources = invoker.sources_when_disabled
340 }
341 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700342 }
mtkleineb3c4252016-08-23 07:38:09 -0700343 }
mtklein457b42a2016-08-23 13:56:37 -0700344}
mtklein457b42a2016-08-23 13:56:37 -0700345
mtkleina45be612016-08-29 15:22:10 -0700346optional("fontmgr_android") {
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500347 enabled = skia_enable_fontmgr_android
mtkleina45be612016-08-29 15:22:10 -0700348
349 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500350 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700351 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700352 ]
353 sources = [
354 "src/ports/SkFontMgr_android.cpp",
355 "src/ports/SkFontMgr_android_factory.cpp",
356 "src/ports/SkFontMgr_android_parser.cpp",
357 ]
358}
359
mtkleind2e39db2016-09-07 07:52:55 -0700360optional("fontmgr_custom") {
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500361 enabled = skia_enable_fontmgr_custom
mtkleind2e39db2016-09-07 07:52:55 -0700362
363 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500364 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700365 ]
366 sources = [
367 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500368 "src/ports/SkFontMgr_custom.h",
369 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700370 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500371 "src/ports/SkFontMgr_custom_embedded.cpp",
372 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700373 ]
374}
375
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500376optional("fontmgr_custom_empty") {
377 enabled = skia_enable_fontmgr_custom_empty
Kevin Lubickddd0a332018-12-12 10:35:13 -0500378
379 deps = [
380 ":typeface_freetype",
381 ]
382 sources = [
383 "src/ports/SkFontMgr_custom.cpp",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500384 "src/ports/SkFontMgr_custom_empty.cpp",
385 "src/ports/SkFontMgr_custom_empty_factory.cpp",
Sergey Ulanovf3babcd2018-11-30 17:42:00 -0800386 ]
387}
388
Hal Canaryff2742e2018-01-30 11:35:47 -0500389optional("fontmgr_empty") {
390 enabled = skia_enable_fontmgr_empty
391 sources = [
392 "src/ports/SkFontMgr_empty_factory.cpp",
393 ]
394}
395
mtklein3cc22182016-08-29 13:26:14 -0700396optional("fontmgr_fontconfig") {
397 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700398
399 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500400 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700401 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700402 ]
403 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700404 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700405 "src/ports/SkFontConfigInterface_direct.cpp",
406 "src/ports/SkFontConfigInterface_direct_factory.cpp",
407 "src/ports/SkFontMgr_FontConfigInterface.cpp",
408 "src/ports/SkFontMgr_fontconfig.cpp",
409 "src/ports/SkFontMgr_fontconfig_factory.cpp",
410 ]
411}
412
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500413optional("fontmgr_fuchsia") {
414 enabled = skia_enable_fontmgr_fuchsia
415
Chinmay Garde89820762019-05-06 16:44:06 -0700416 deps = []
417
418 if (is_fuchsia && using_fuchsia_sdk) {
419 deps += [ "$fuchsia_sdk_root/fidl:fuchsia.fonts" ]
420 } else {
421 deps += [ "//sdk/fidl/fuchsia.fonts" ]
422 }
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500423 sources = [
424 "src/ports/SkFontMgr_fuchsia.cpp",
425 "src/ports/SkFontMgr_fuchsia.h",
426 ]
427}
428
429optional("fontmgr_wasm") {
Kevin Lubick0e3342c2019-04-16 13:31:25 -0400430 enabled = !skia_enable_fontmgr_empty && target_cpu == "wasm"
mtkleincdedd0e2016-09-12 15:15:44 -0700431
432 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500433 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700434 ]
435 sources = [
436 "src/ports/SkFontMgr_custom.cpp",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500437 "src/ports/SkFontMgr_custom.h",
438 "src/ports/SkFontMgr_custom_embedded.cpp",
439 "src/ports/SkFontMgr_custom_embedded_factory.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700440 ]
441}
442
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500443optional("fontmgr_win") {
444 enabled = skia_enable_fontmgr_win
445
446 sources = [
447 "src/fonts/SkFontMgr_indirect.cpp",
448 "src/ports/SkFontMgr_win_dw.cpp",
449 "src/ports/SkFontMgr_win_dw_factory.cpp",
450 "src/ports/SkScalerContext_win_dw.cpp",
451 "src/ports/SkTypeface_win_dw.cpp",
452 ]
453}
454
455optional("fontmgr_win_gdi") {
456 enabled = skia_enable_fontmgr_win_gdi
457
458 sources = [
459 "src/ports/SkFontHost_win.cpp",
460 ]
461 libs = [ "Gdi32.lib" ]
462}
463
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700464if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400465 executable("sksllex") {
466 sources = [
467 "src/sksl/lex/Main.cpp",
468 "src/sksl/lex/NFA.cpp",
469 "src/sksl/lex/RegexNode.cpp",
470 "src/sksl/lex/RegexParser.cpp",
471 ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500472 include_dirs = [ "." ]
Ethan Nicholasca82a922017-09-07 09:39:50 -0400473 }
474
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700475 action("run_sksllex") {
476 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400477 deps = [
478 ":sksllex(//gn/toolchain:$host_toolchain)",
479 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700480 sources = [
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700481 "src/sksl/lex/sksl.lex",
482 ]
483
484 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
485 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
486 outputs = [
487 "$target_out_dir/" +
488 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
489 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
490 # confused due to the same file being named by two different paths
491 ]
492 sksllex_path = "$root_out_dir/"
493 sksllex_path += "sksllex"
494 if (host_os == "win") {
495 sksllex_path += ".exe"
496 }
497 args = [
498 rebase_path(sksllex_path),
499 rebase_path("bin/clang-format"),
500 rebase_path("src"),
501 ]
502 }
503} else {
504 group("run_sksllex") {
505 }
506}
507
508if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400509 executable("skslc") {
510 defines = [ "SKSL_STANDALONE" ]
511 sources = [
512 "src/sksl/SkSLMain.cpp",
513 ]
514 sources += skia_sksl_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400515 sources += skia_sksl_gpu_sources
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500516 include_dirs = [ "." ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400517 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500518 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400519 "//third_party/spirv-tools",
520 ]
521 }
522
523 skia_gpu_processor_outputs = []
524 foreach(src, skia_gpu_processor_sources) {
525 dir = get_path_info(src, "dir")
526 name = get_path_info(src, "name")
527
528 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
529 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
530 skia_gpu_processor_outputs += [
Brian Osmanf5ac1992019-07-18 11:23:16 -0400531 "$target_out_dir/" +
532 rebase_path("$dir/generated/$name.h", target_out_dir),
Ethan Nicholas762466e2017-06-29 10:03:38 -0400533 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
534 # confused due to the same file being named by two different paths
535 ]
536 }
537
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500538 action("create_sksl_enums") {
539 script = "gn/create_sksl_enums.py"
540 sources = [
541 "include/private/GrSharedEnums.h",
542 ]
543 outputs = [
544 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500545 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500546 ]
547 args = [
548 rebase_path(sources[0]),
549 rebase_path(outputs[0]),
550 ]
551 }
552
Ethan Nicholas762466e2017-06-29 10:03:38 -0400553 action("compile_processors") {
554 script = "gn/compile_processors.py"
555 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500556 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400557 ":skslc(//gn/toolchain:$host_toolchain)",
558 ]
559 sources = skia_gpu_processor_sources
560 outputs = skia_gpu_processor_outputs
561 skslc_path = "$root_out_dir/"
562 if (host_toolchain != default_toolchain_name) {
563 skslc_path += "$host_toolchain/"
564 }
565 skslc_path += "skslc"
566 if (host_os == "win") {
567 skslc_path += ".exe"
568 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400569 args = [
570 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400571 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400572 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400573 args += rebase_path(skia_gpu_processor_sources)
574 }
575} else {
576 skia_gpu_processor_outputs = []
577 group("compile_processors") {
578 }
579}
580
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500581optional("gpu") {
mtklein06c35c02016-09-20 12:28:12 -0700582 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400583 deps = [
584 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700585 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400586 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700587 if (skia_generate_workarounds) {
588 deps += [ ":workaround_list" ]
589 }
Robert Phillipsefb9f142019-05-17 14:19:44 -0400590 public_defines = [ "SK_GL" ]
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600591 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400592 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700593
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400594 sources =
595 skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400596 if (!skia_enable_ccpr) {
597 sources -= skia_ccpr_sources
598 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
599 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400600 if (!skia_enable_nvpr) {
601 sources -= skia_nvpr_sources
602 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
603 }
mtklein06c35c02016-09-20 12:28:12 -0700604
605 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500606 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700607 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400608 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700609 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400610 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400611
612 # this lib is required to link against AHardwareBuffer
613 if (defined(ndk_api) && ndk_api >= 26) {
614 libs += [ "android" ]
615 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400616 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500617 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400618 libs += [ "EGL" ]
Chinmay Garded92d0352018-09-17 10:23:28 -0700619 } else if (is_linux && skia_use_x11) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500620 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -0400621 libs += [ "GL" ]
mtklein06c35c02016-09-20 12:28:12 -0700622 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500623 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800624 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500625 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400626 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500627 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -0500628 if (target_cpu != "arm64") {
629 libs += [ "OpenGL32.lib" ]
630 }
mtklein06c35c02016-09-20 12:28:12 -0700631 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500632 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700633 }
mtkleine9fb3d52016-09-20 15:11:46 -0700634
635 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400636 public_defines += [ "SK_VULKAN" ]
Greg Daniel18dbfd02018-05-29 10:46:51 -0400637 deps += [ "third_party/vulkanmemoryallocator" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700638 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700639 if (skia_enable_vulkan_debug_layers) {
640 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
641 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800642 if (is_fuchsia) {
Chinmay Garde89820762019-05-06 16:44:06 -0700643 if (using_fuchsia_sdk) {
644 public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
645 } else {
Brian Osman489cf882019-07-09 10:48:28 -0400646 public_deps += [ "//src/graphics/lib/vulkan" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700647 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800648 }
mtkleine9fb3d52016-09-20 15:11:46 -0700649 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400650
Stephen White0d70b712019-07-10 15:51:30 -0400651 if (skia_use_dawn) {
652 public_defines += [ "SK_DAWN" ]
Stephen White985741a2019-07-18 11:43:45 -0400653 sources += skia_dawn_sources
Stephen White0d70b712019-07-10 15:51:30 -0400654 public_deps += [
655 "//third_party/dawn:dawn_headers",
656 "//third_party/dawn:libdawn",
657 "//third_party/dawn:libdawn_native_sources",
658 ]
659 if (dawn_enable_d3d12) {
660 libs += [
661 "d3d12.lib",
662 "dxgi.lib",
663 "d3dcompiler.lib",
664 ]
665 } else if (dawn_enable_metal) {
666 libs += [ "Metal.framework" ]
667 }
668 }
669
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400670 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400671 if (skia_use_metal) {
672 public_defines += [ "SK_METAL" ]
673 sources += skia_metal_sources
674 libs += [ "Metal.framework" ]
Greg Daniel53956d92018-08-08 14:41:19 -0400675 libs += [ "Foundation.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400676 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400677 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500678
679 if (skia_enable_atlas_text) {
680 sources += skia_atlas_text_sources
681 }
Kevin Lubickf4def342018-10-04 12:52:50 -0400682
683 if (is_debug) {
684 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
685 }
mtklein06c35c02016-09-20 12:28:12 -0700686}
687
Leon Scroggins III41169202019-01-29 09:29:57 -0500688optional("gif") {
689 enabled = !skia_use_wuffs
690 sources = [
691 "src/codec/SkGifCodec.cpp",
692 "third_party/gif/SkGifImageReader.cpp",
693 ]
694}
695
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400696optional("heif") {
697 enabled = skia_use_libheif
698 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
699
700 deps = []
701
702 sources = [
703 "src/codec/SkHeifCodec.cpp",
704 ]
705}
706
mtklein63213812016-08-24 09:55:56 -0700707optional("jpeg") {
708 enabled = skia_use_libjpeg_turbo
709 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
710
mtklein63213812016-08-24 09:55:56 -0700711 deps = [
712 "//third_party/libjpeg-turbo:libjpeg",
713 ]
Mike Kleinf105dc72018-06-05 15:22:54 -0400714 public = [
715 "include/encode/SkJpegEncoder.h",
716 ]
mtklein63213812016-08-24 09:55:56 -0700717 sources = [
718 "src/codec/SkJpegCodec.cpp",
719 "src/codec/SkJpegDecoderMgr.cpp",
720 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700721 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400722 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700723 ]
724}
725
726optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500727 enabled = skia_use_zlib && skia_enable_pdf
728 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700729
mtklein63213812016-08-24 09:55:56 -0700730 deps = [
731 "//third_party/zlib",
732 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400733 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700734 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400735 }
brettwb9447282016-09-01 14:24:39 -0700736 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700737 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
Hal Canary2a3093c2019-02-20 11:25:45 -0500738 if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
739 deps += [ "//third_party/harfbuzz" ]
740 defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
741 } else if (skia_use_icu && skia_use_sfntly) {
mtklein63213812016-08-24 09:55:56 -0700742 deps += [ "//third_party/sfntly" ]
Hal Canary32498f02019-02-04 15:36:31 -0500743 defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700744 }
745}
746
747optional("png") {
748 enabled = skia_use_libpng
749 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
750
mtklein63213812016-08-24 09:55:56 -0700751 deps = [
752 "//third_party/libpng",
753 ]
754 sources = [
755 "src/codec/SkIcoCodec.cpp",
756 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400757 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700758 ]
759}
760
scroggof84ad642016-10-31 09:02:57 -0700761optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400762 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700763 public_defines = [ "SK_CODEC_DECODES_RAW" ]
764
765 deps = [
766 "//third_party/dng_sdk",
767 "//third_party/libjpeg-turbo:libjpeg",
768 "//third_party/piex",
769 ]
770
771 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
772 # Skia.
773 configs_to_remove = [ "//gn:no_exceptions" ]
774
775 sources = [
scroggof84ad642016-10-31 09:02:57 -0700776 "src/codec/SkRawCodec.cpp",
777 ]
778}
779
Mike Klein852a8cb2018-05-15 10:46:58 -0400780import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -0400781source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -0400782 cflags = []
783 if (!is_win || is_clang) {
784 cflags += [
785 "-w",
786 "-std=c11",
787 ]
788 }
789
790 public = [
Brian Osmanea236bf2019-04-29 10:28:22 -0400791 "include/third_party/skcms/skcms.h",
Mike Klein852a8cb2018-05-15 10:46:58 -0400792 ]
Brian Osmanea236bf2019-04-29 10:28:22 -0400793 include_dirs = [ "include/third_party/skcms" ]
Mike Klein852a8cb2018-05-15 10:46:58 -0400794 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
795}
796
mtklein3cc22182016-08-29 13:26:14 -0700797optional("typeface_freetype") {
798 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700799
800 deps = [
801 "//third_party/freetype2",
802 ]
803 sources = [
804 "src/ports/SkFontHost_FreeType.cpp",
805 "src/ports/SkFontHost_FreeType_common.cpp",
806 ]
807}
808
mtklein457b42a2016-08-23 13:56:37 -0700809optional("webp") {
810 enabled = skia_use_libwebp
811 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
812
mtklein457b42a2016-08-23 13:56:37 -0700813 deps = [
814 "//third_party/libwebp",
815 ]
816 sources = [
mtklein457b42a2016-08-23 13:56:37 -0700817 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400818 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700819 ]
mtkleineb3c4252016-08-23 07:38:09 -0700820}
821
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -0400822optional("wuffs") {
823 enabled = skia_use_wuffs
824 public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
825
826 deps = [
827 "//third_party/wuffs",
828 ]
829 sources = [
830 "src/codec/SkWuffsCodec.cpp",
831 ]
832}
833
mtklein63213812016-08-24 09:55:56 -0700834optional("xml") {
835 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000836 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700837
mtklein63213812016-08-24 09:55:56 -0700838 deps = [
839 "//third_party/expat",
840 ]
841 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500842 "src/svg/SkSVGCanvas.cpp",
843 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700844 "src/xml/SkDOM.cpp",
845 "src/xml/SkXMLParser.cpp",
846 "src/xml/SkXMLWriter.cpp",
847 ]
848}
849
Brian Osman489cf882019-07-09 10:48:28 -0400850optional("sksl_interpreter") {
851 enabled = skia_enable_sksl_interpreter
852 public_defines = [ "SK_ENABLE_SKSL_INTERPRETER" ]
853}
854
Mike Klein613ad382019-06-06 11:42:02 -0500855optional("skvm_jit") {
Mike Klein6bbeb4a2019-06-21 16:34:06 -0500856 enabled = skia_enable_skvm_jit
Mike Klein613ad382019-06-06 11:42:02 -0500857 public_defines = [ "SKVM_JIT" ]
Mike Klein613ad382019-06-06 11:42:02 -0500858}
859
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700860if (skia_enable_gpu && skia_generate_workarounds) {
861 action("workaround_list") {
862 script = "tools/build_workaround_header.py"
863
864 inputs = [
865 "src/gpu/gpu_workaround_list.txt",
866 ]
867
868 # see comments in skia_compile_processors about out dir path shenanigans.
869 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700870 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700871
872 outputs = [
873 "$root_out_dir/$output_file",
874 ]
875 args = [
876 "--output-file",
877 "$output_file",
878 ]
879
880 foreach(file, inputs) {
881 args += [ rebase_path(file, root_build_dir) ]
882 }
883 }
884}
885
mtkleinc04ff472016-06-23 10:29:30 -0700886component("skia") {
887 public_configs = [ ":skia_public" ]
888 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700889
Mike Klein607b0a72018-11-07 16:17:34 -0500890 public_deps = [
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500891 ":gpu",
Mike Klein607b0a72018-11-07 16:17:34 -0500892 ":pdf",
893 ":skcms",
894 ]
895
mtkleinc04ff472016-06-23 10:29:30 -0700896 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700897 ":arm64",
898 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700899 ":avx",
Mike Klein54378232018-11-08 12:08:05 +0000900 ":compile_processors",
anmittalb8b3f712016-08-25 04:55:19 -0700901 ":crc32",
mtkleina45be612016-08-29 15:22:10 -0700902 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700903 ":fontmgr_custom",
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500904 ":fontmgr_custom_empty",
Hal Canaryff2742e2018-01-30 11:35:47 -0500905 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700906 ":fontmgr_fontconfig",
Sergey Ulanovf3babcd2018-11-30 17:42:00 -0800907 ":fontmgr_fuchsia",
Kevin Lubickddd0a332018-12-12 10:35:13 -0500908 ":fontmgr_wasm",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500909 ":fontmgr_win",
910 ":fontmgr_win_gdi",
Leon Scroggins III41169202019-01-29 09:29:57 -0500911 ":gif",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400912 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500913 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700914 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700915 ":none",
mtklein63213812016-08-24 09:55:56 -0700916 ":png",
scroggof84ad642016-10-31 09:02:57 -0700917 ":raw",
Brian Osman489cf882019-07-09 10:48:28 -0400918 ":sksl_interpreter",
Mike Klein613ad382019-06-06 11:42:02 -0500919 ":skvm_jit",
mtklein9b8583d2016-08-24 17:32:30 -0700920 ":sse2",
921 ":sse41",
922 ":sse42",
923 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700924 ":webp",
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -0400925 ":wuffs",
mtklein63213812016-08-24 09:55:56 -0700926 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700927 ]
928
Chinmay Garde43f115c2016-11-16 15:04:12 -0800929 # This file (and all GN files in Skia) are designed to work with an
930 # empty sources assignment filter; we handle all that explicitly.
931 # We clear the filter here for clients who may have set up a global filter.
932 set_sources_assignment_filter([])
933
Hal Canaryc25f4e92019-02-26 11:54:25 -0500934 public = skia_core_public
935 public += skia_utils_public
936 public += skia_effects_public
937 public += skia_effects_imagefilter_public
938 public += skia_xps_public
939
mtkleinc04ff472016-06-23 10:29:30 -0700940 sources = []
brettwb9447282016-09-01 14:24:39 -0700941 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700942 sources += skia_utils_sources
Leon Scroggins IIIee0e5d02019-02-27 10:59:11 -0500943 if (skia_use_xps) {
944 sources += skia_xps_sources
945 }
Mike Klein54378232018-11-08 12:08:05 +0000946 sources += skia_effects_sources
947 sources += skia_effects_imagefilter_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400948 sources += skia_sksl_sources
mtkleinc04ff472016-06-23 10:29:30 -0700949 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400950 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500951 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700952 "src/android/SkBitmapRegionCodec.cpp",
953 "src/android/SkBitmapRegionDecoder.cpp",
954 "src/codec/SkAndroidCodec.cpp",
Nigel Tao612a65d2018-11-09 10:10:31 +1100955 "src/codec/SkAndroidCodecAdapter.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400956 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700957 "src/codec/SkBmpCodec.cpp",
958 "src/codec/SkBmpMaskCodec.cpp",
959 "src/codec/SkBmpRLECodec.cpp",
960 "src/codec/SkBmpStandardCodec.cpp",
961 "src/codec/SkCodec.cpp",
962 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -0400963 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -0400964 "src/codec/SkEncodedInfo.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700965 "src/codec/SkMaskSwizzler.cpp",
966 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700967 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700968 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700969 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700970 "src/codec/SkSwizzler.cpp",
971 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700972 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700973 "src/ports/SkDiscardableMemory_none.cpp",
Mike Klein54378232018-11-08 12:08:05 +0000974 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700975 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700976 "src/ports/SkMemory_malloc.cpp",
977 "src/ports/SkOSFile_stdio.cpp",
978 "src/sfnt/SkOTTable_name.cpp",
979 "src/sfnt/SkOTUtils.cpp",
980 "src/utils/mac/SkStream_mac.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700981 ]
brettwb9447282016-09-01 14:24:39 -0700982
Kevin Lubick32dfdbe2018-10-18 09:47:01 -0400983 defines = []
984 if (!skia_enable_skpicture) {
985 defines = [ "SK_DISABLE_SKPICTURE" ]
Hal Canaryc25f4e92019-02-26 11:54:25 -0500986 public -= skia_skpicture_public
Kevin Lubick32dfdbe2018-10-18 09:47:01 -0400987 sources -= skia_skpicture_sources
Mike Klein54378232018-11-08 12:08:05 +0000988 sources -= [ "//src/effects/imagefilters/SkPictureImageFilter.cpp" ]
Kevin Lubick32dfdbe2018-10-18 09:47:01 -0400989 sources += [ "src/core/SkPicture_none.cpp" ]
990 }
991
mtklein7d6fb2c2016-08-25 14:50:44 -0700992 libs = []
993
mtkleinc04ff472016-06-23 10:29:30 -0700994 if (is_win) {
995 sources += [
996 "src/ports/SkDebug_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700997 "src/ports/SkImageEncoder_WIC.cpp",
998 "src/ports/SkImageGeneratorWIC.cpp",
999 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -07001000 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001001 "src/ports/SkTLS_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001002 ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001003 libs += [
1004 "FontSub.lib",
1005 "Ole32.lib",
1006 "OleAut32.lib",
1007 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -05001008 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -04001009 ]
mtkleinc04ff472016-06-23 10:29:30 -07001010 } else {
1011 sources += [
mtkleinc04ff472016-06-23 10:29:30 -07001012 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -07001013 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001014 "src/ports/SkTLS_pthread.cpp",
1015 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -04001016 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -07001017 }
1018
mtklein7d6fb2c2016-08-25 14:50:44 -07001019 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -05001020 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -05001021 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -05001022 deps += [ "//third_party/cpu-features" ]
1023 }
mtklein06c35c02016-09-20 12:28:12 -07001024 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001025 libs += [
1026 "EGL",
1027 "GLESv2",
1028 "log",
1029 ]
1030 }
1031
Kevin Lubick217056c2018-09-20 17:39:31 -04001032 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -07001033 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001034 if (skia_use_egl) {
1035 libs += [ "GLESv2" ]
1036 }
mtkleinc04ff472016-06-23 10:29:30 -07001037 }
1038
Leon Scroggins III85e22fc2018-11-28 08:58:47 -05001039 if (skia_use_fonthost_mac) {
Sergey Ulanovf3babcd2018-11-30 17:42:00 -08001040 sources += [ "src/ports/SkFontHost_mac.cpp" ]
Leon Scroggins III85e22fc2018-11-28 08:58:47 -05001041 }
1042
mtkleinc04ff472016-06-23 10:29:30 -07001043 if (is_mac) {
1044 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001045 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001046 "src/ports/SkImageEncoder_CG.cpp",
1047 "src/ports/SkImageGeneratorCG.cpp",
1048 ]
mtklein09e61f72016-08-23 13:35:28 -07001049 libs += [
bungeman3e306f62017-03-29 11:32:02 -04001050 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
1051 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -07001052 "ApplicationServices.framework",
1053 "OpenGL.framework",
1054 ]
mtkleinc04ff472016-06-23 10:29:30 -07001055 }
abarth6fc8ff02016-07-15 15:15:15 -07001056
Mike Klein7d302882016-11-03 14:06:31 -04001057 if (is_ios) {
1058 sources += [
1059 "src/ports/SkDebug_stdio.cpp",
1060 "src/ports/SkFontHost_mac.cpp",
1061 "src/ports/SkImageEncoder_CG.cpp",
1062 "src/ports/SkImageGeneratorCG.cpp",
1063 ]
1064 libs += [
1065 "CoreFoundation.framework",
1066 "CoreGraphics.framework",
1067 "CoreText.framework",
1068 "ImageIO.framework",
1069 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -04001070
1071 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
1072 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001073 ]
1074 }
1075
abarth6fc8ff02016-07-15 15:15:15 -07001076 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001077 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001078 }
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001079
1080 if (skia_enable_spirv_validation) {
1081 deps += [ "//third_party/spirv-tools" ]
1082 defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
1083 }
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -04001084
1085 if (skia_include_multiframe_procs) {
1086 sources += [ "tools/SkSharingProc.cpp" ]
1087 }
mtkleinc04ff472016-06-23 10:29:30 -07001088}
1089
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001090# DebugCanvas used in experimental/wasm-skp-debugger
1091if (target_cpu == "wasm") {
1092 static_library("debugcanvas") {
1093 public_configs = [ ":skia_public" ]
1094
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001095 sources = [
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001096 "tools/SkSharingProc.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001097 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001098 "tools/debugger/DebugCanvas.cpp",
1099 "tools/debugger/DrawCommand.cpp",
1100 "tools/debugger/JsonWriteBuffer.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001101 ]
1102
1103 deps = [
1104 ":fontmgr_wasm",
1105 ]
1106 }
1107}
1108
Kevin Lubickcbcff382018-10-02 09:02:18 -04001109static_library("pathkit") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001110 check_includes = false
Kevin Lubickcbcff382018-10-02 09:02:18 -04001111 public_configs = [ ":skia_public" ]
1112 configs += skia_library_configs
1113
1114 deps = [
1115 ":arm64",
1116 ":armv7",
1117 ":avx",
1118 ":crc32",
1119 ":hsw",
1120 ":none",
1121 ":sse2",
1122 ":sse41",
1123 ":sse42",
1124 ":ssse3",
1125 ]
1126
1127 # This file (and all GN files in Skia) are designed to work with an
1128 # empty sources assignment filter; we handle all that explicitly.
1129 # We clear the filter here for clients who may have set up a global filter.
1130 set_sources_assignment_filter([])
1131
1132 sources = []
1133 sources += skia_pathops_sources
Hal Canaryc25f4e92019-02-26 11:54:25 -05001134 sources += skia_pathops_public
Kevin Lubickcbcff382018-10-02 09:02:18 -04001135 sources += [
1136 "src/core/SkAnalyticEdge.cpp",
1137 "src/core/SkArenaAlloc.cpp",
Mike Reedcc88f3a2019-02-06 11:40:27 -05001138 "src/core/SkContourMeasure.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001139 "src/core/SkCubicMap.cpp",
1140 "src/core/SkEdge.cpp",
1141 "src/core/SkEdgeBuilder.cpp",
1142 "src/core/SkEdgeClipper.cpp",
1143 "src/core/SkGeometry.cpp",
1144 "src/core/SkLineClipper.cpp",
1145 "src/core/SkMallocPixelRef.cpp",
1146 "src/core/SkMath.cpp",
1147 "src/core/SkMatrix.cpp",
1148 "src/core/SkOpts.cpp",
1149 "src/core/SkPaint.cpp",
1150 "src/core/SkPath.cpp",
1151 "src/core/SkPathEffect.cpp",
1152 "src/core/SkPathMeasure.cpp",
1153 "src/core/SkPathRef.cpp",
1154 "src/core/SkPoint.cpp",
1155 "src/core/SkRRect.cpp",
1156 "src/core/SkRect.cpp",
1157 "src/core/SkSemaphore.cpp",
1158 "src/core/SkStream.cpp",
1159 "src/core/SkString.cpp",
1160 "src/core/SkStringUtils.cpp",
1161 "src/core/SkStroke.cpp",
1162 "src/core/SkStrokeRec.cpp",
1163 "src/core/SkStrokerPriv.cpp",
1164 "src/core/SkThreadID.cpp",
1165 "src/core/SkUtils.cpp",
1166 "src/effects/SkDashPathEffect.cpp",
1167 "src/effects/SkTrimPathEffect.cpp",
1168 "src/ports/SkDebug_stdio.cpp",
1169 "src/ports/SkMemory_malloc.cpp",
1170 "src/utils/SkDashPath.cpp",
1171 "src/utils/SkParse.cpp",
1172 "src/utils/SkParsePath.cpp",
1173 "src/utils/SkUTF.cpp",
1174 ]
1175}
1176
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001177group("modules") {
1178 deps = [
Kevin Lubick96634842019-03-05 14:09:24 -05001179 "modules/particles",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001180 "modules/skottie",
1181 "modules/skshaper",
1182 ]
1183}
1184
mtkleinc095df52016-08-24 12:23:52 -07001185# Targets guarded by skia_enable_tools may use //third_party freely.
1186if (skia_enable_tools) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001187 skia_public_includes = [
1188 "include/android",
1189 "include/atlastext",
1190 "include/c",
1191 "include/codec",
1192 "include/config",
1193 "include/core",
1194 "include/docs",
1195 "include/effects",
1196 "include/encode",
1197 "include/gpu",
1198 "include/pathops",
1199 "include/ports",
1200 "include/svg",
1201 "include/utils",
1202 "include/utils/mac",
1203 "modules/sksg/include",
1204 "modules/skshaper/include",
1205 "modules/skottie/include",
1206 ]
1207
Mike Klein308b5ac2016-12-06 16:03:52 -05001208 # Used by gn_to_bp.py to list our public include dirs.
1209 source_set("public") {
1210 configs += [ ":skia_public" ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001211 include_dirs = skia_public_includes
Mike Klein308b5ac2016-12-06 16:03:52 -05001212 }
1213
Mike Kleinc36dedf2016-11-18 09:35:28 -05001214 config("skia.h_config") {
1215 include_dirs = [ "$target_gen_dir" ]
1216 }
1217 action("skia.h") {
1218 public_configs = [ ":skia.h_config" ]
1219 skia_h = "$target_gen_dir/skia.h"
1220 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001221
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001222 args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1223 [ rebase_path(skia_h, root_build_dir) ] +
1224 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001225 depfile = "$skia_h.deps"
1226 outputs = [
1227 skia_h,
1228 ]
1229 }
1230
Brian Osmanc9a42472018-05-31 13:17:12 -04001231 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001232 executable("fiddle") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001233 check_includes = false
Mike Kleinc36dedf2016-11-18 09:35:28 -05001234 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001235 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001236 "tools/fiddle/draw.cpp",
1237 "tools/fiddle/fiddle_main.cpp",
1238 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001239
1240 if (skia_use_egl) {
1241 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001242 } else {
1243 sources += [ "tools/fiddle/null_context.cpp" ]
1244 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001245 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001246 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001247 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001248 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001249 ":skia",
1250 ":skia.h",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001251 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001252 "modules/skshaper",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001253 ]
1254 }
1255 }
1256
Mike Klein9e25bb92019-04-29 09:46:36 -05001257 config("our_vulkan_headers") {
1258 # We add this directory to simulate the client already have
1259 # vulkan/vulkan_core.h on their path.
1260 include_dirs = [ "include/third_party/vulkan" ]
1261 }
1262
Brian Osmanc9a42472018-05-31 13:17:12 -04001263 source_set("public_headers_warnings_check") {
1264 sources = [
1265 "tools/public_headers_warnings_check.cpp",
1266 ]
1267 configs -= [ "//gn:warnings_except_public_headers" ]
Mike Klein9e25bb92019-04-29 09:46:36 -05001268 configs += [ ":our_vulkan_headers" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001269 deps = [
1270 ":skia",
1271 ":skia.h",
1272 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001273 "modules/skshaper",
Brian Osmanc9a42472018-05-31 13:17:12 -04001274 ]
Stephen White0d70b712019-07-10 15:51:30 -04001275
1276 if (skia_use_dawn) {
1277 deps += [ "//third_party/dawn:dawn_headers" ]
1278 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001279 }
1280
mtkleinc095df52016-08-24 12:23:52 -07001281 template("test_lib") {
1282 config(target_name + "_config") {
mtkleina627b5c2016-09-20 13:36:47 -07001283 if (defined(invoker.public_defines)) {
1284 defines = invoker.public_defines
1285 }
mtklein25c81d42016-07-27 13:55:26 -07001286 }
mtkleinc095df52016-08-24 12:23:52 -07001287 source_set(target_name) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001288 forward_variables_from(invoker, "*", [])
Hal Canaryc25f4e92019-02-26 11:54:25 -05001289 check_includes = false
mtkleinc095df52016-08-24 12:23:52 -07001290 public_configs = [
1291 ":" + target_name + "_config",
1292 ":skia_private",
1293 ]
1294
1295 if (!defined(deps)) {
1296 deps = []
1297 }
1298 deps += [ ":skia" ]
1299 testonly = true
1300 }
mtklein25c81d42016-07-27 13:55:26 -07001301 }
mtklein25c81d42016-07-27 13:55:26 -07001302
Mike Kleine6682eb2017-01-05 10:54:57 -05001303 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001304 if (is_ios) {
1305 app_name = target_name
1306 gen_path = target_gen_dir
1307
1308 action("${app_name}_generate_info_plist") {
1309 script = "//gn/gen_plist_ios.py"
1310 outputs = [
1311 "$gen_path/${app_name}_Info.plist",
1312 ]
1313 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1314 }
1315
1316 bundle_data("${app_name}_bundle_info_plist") {
1317 public_deps = [
1318 ":${app_name}_generate_info_plist",
1319 ]
1320 sources = [
1321 "$gen_path/${app_name}_Info.plist",
1322 ]
1323 outputs = [
1324 "{{bundle_root_dir}}/Info.plist",
1325 ]
1326 }
1327
Jim Van Verthffacf652019-04-02 11:59:34 -04001328 has_skps = "True" == exec_script("//gn/checkdir.py",
1329 [ rebase_path("skps", root_build_dir) ],
1330 "trim string")
1331 bundle_data("${app_name}_bundle_resources") {
1332 sources = [
1333 "resources",
1334 ]
1335 outputs = [
1336 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1337 "{{bundle_resources_dir}}/data/resources",
1338 ]
1339 }
1340 if (has_skps) {
1341 bundle_data("${app_name}_bundle_skps") {
Jim Van Verth329c5a62017-11-29 11:42:33 -05001342 sources = [
Jim Van Verthffacf652019-04-02 11:59:34 -04001343 "skps",
Jim Van Verth329c5a62017-11-29 11:42:33 -05001344 ]
1345 outputs = [
Jim Van Verthffacf652019-04-02 11:59:34 -04001346 # Store in same folder as resources
1347 "{{bundle_resources_dir}}/data/skps",
Jim Van Verth329c5a62017-11-29 11:42:33 -05001348 ]
1349 }
Jim Van Verth329c5a62017-11-29 11:42:33 -05001350 }
1351
Jim Van Verth443a9132017-11-28 09:45:26 -05001352 executable("${app_name}_generate_executable") {
1353 forward_variables_from(invoker,
1354 "*",
1355 [
1356 "output_name",
1357 "visibility",
1358 "is_shared_library",
1359 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001360 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001361 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001362 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1363 }
1364
1365 bundle_data("${app_name}_bundle_executable") {
1366 public_deps = [
1367 ":${app_name}_generate_executable",
1368 ]
1369 sources = [
1370 "$gen_path/$app_name",
1371 ]
1372 outputs = [
1373 "{{bundle_executable_dir}}/$app_name",
1374 ]
1375 testonly = true
1376 }
1377
Jim Van Verthffacf652019-04-02 11:59:34 -04001378 bundle_data("${app_name}_bundle_symbols") {
1379 public_deps = [
1380 ":${app_name}_generate_executable",
1381 ]
1382 sources = [
1383 "$gen_path/${app_name}.dSYM",
1384 ]
1385 outputs = [
1386 "{{bundle_executable_dir}}/${app_name}.dSYM",
1387 ]
1388 testonly = true
1389 }
1390
Jim Van Verth443a9132017-11-28 09:45:26 -05001391 create_bundle("$app_name") {
1392 product_type = "com.apple.product-type.application"
1393 testonly = true
1394
1395 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1396 bundle_resources_dir = bundle_root_dir
1397 bundle_executable_dir = bundle_root_dir
Jim Van Verth443a9132017-11-28 09:45:26 -05001398
1399 deps = [
1400 ":${app_name}_bundle_executable",
1401 ":${app_name}_bundle_info_plist",
Jim Van Verthffacf652019-04-02 11:59:34 -04001402 ":${app_name}_bundle_resources",
1403 ":${app_name}_bundle_symbols",
Jim Van Verth443a9132017-11-28 09:45:26 -05001404 ]
Jim Van Verthffacf652019-04-02 11:59:34 -04001405 if (has_skps) {
1406 deps += [ ":${app_name}_bundle_skps" ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001407 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001408
1409 # should only code sign when running on a device, not the simulator
1410 if (target_cpu != "x64") {
1411 code_signing_script = "//gn/codesign_ios.py"
1412 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1413 code_signing_outputs = [
1414 "$bundle_root_dir/_CodeSignature/CodeResources",
1415 "$bundle_root_dir/embedded.mobileprovision",
1416 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001417 code_signing_args = [
1418 rebase_path("$bundle_root_dir", root_build_dir),
1419 skia_ios_identity,
1420 skia_ios_profile,
1421 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001422 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001423 }
1424 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001425 # !is_ios
1426
1427 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1428 shared_library("lib" + target_name) {
1429 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1430 configs += [ ":skia_private" ]
1431 testonly = true
1432 }
1433 } else {
1434 _executable = target_name
1435 executable(_executable) {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001436 check_includes = false
Jim Van Verth443a9132017-11-28 09:45:26 -05001437 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1438 configs += [ ":skia_private" ]
1439 testonly = true
1440 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001441 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001442 if (is_android && skia_android_serial != "" && defined(_executable)) {
1443 action("push_" + target_name) {
1444 script = "gn/push_to_android.py"
1445 deps = [
1446 ":" + _executable,
1447 ]
1448 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1449 outputs = [
1450 _stamp,
1451 ]
1452 args = [
1453 rebase_path("$root_build_dir/$_executable"),
1454 skia_android_serial,
1455 rebase_path(_stamp),
1456 ]
1457 testonly = true
1458 }
Mike Klein7d921032017-01-05 12:20:41 -05001459 }
1460 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001461 }
1462
Greg Danielda16cce2018-08-01 09:23:57 -04001463 config("moltenvk_config") {
1464 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1465 if (is_ios) {
1466 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
1467 } else {
1468 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
1469 }
1470 cflags = [ "-F$moltenvk_framework_path" ]
1471 ldflags = [ "-F$moltenvk_framework_path" ]
1472 libs = [
1473 "MoltenVK.framework",
1474 "Metal.framework",
1475 "IOSurface.framework",
1476 "QuartzCore.framework",
1477 "Foundation.framework",
1478 ]
1479 if (is_ios) {
1480 libs += [ "UIKit.framework" ]
1481 } else {
1482 libs += [ "IOKit.framework" ]
1483 }
1484 defines = [ "SK_MOLTENVK" ]
1485 }
1486 }
1487
1488 source_set("moltenvk") {
1489 public_configs = [ ":moltenvk_config" ]
1490 }
1491
mtkleinc095df52016-08-24 12:23:52 -07001492 test_lib("gpu_tool_utils") {
Brian Osmanc9a42472018-05-31 13:17:12 -04001493 public_defines = []
mtkleind68f9b02016-09-23 13:18:41 -07001494
Mike Klein9e25bb92019-04-29 09:46:36 -05001495 # Bots and even devs may not have Vulkan headers, so put
1496 # include/third_party/vulkan on our path so they're always available.
1497 all_dependent_configs = [ ":our_vulkan_headers" ]
1498
Mike Klein333fb452019-04-24 08:48:11 -05001499 defines = []
1500 if (skia_enable_discrete_gpu) {
1501 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
1502 }
1503
Brian Osmanc9a42472018-05-31 13:17:12 -04001504 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001505 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001506 sources = [
1507 "tools/gpu/GrContextFactory.cpp",
1508 "tools/gpu/GrTest.cpp",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001509 "tools/gpu/MemoryCache.cpp",
1510 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001511 "tools/gpu/ProxyUtils.cpp",
1512 "tools/gpu/TestContext.cpp",
Michael Ludwigd9958f82019-03-21 13:08:36 -04001513 "tools/gpu/YUVUtils.cpp",
1514 "tools/gpu/YUVUtils.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001515 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
1516 "tools/gpu/gl/GLTestContext.cpp",
1517 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04001518 "tools/gpu/mock/MockTestContext.cpp",
1519 ]
1520 libs = []
1521
1522 if (is_android || skia_use_egl) {
1523 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1524 } else if (is_ios) {
1525 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1526 libs += [ "OpenGLES.framework" ]
1527 } else if (is_linux) {
1528 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -04001529 libs += [
1530 "GLU",
1531 "X11",
1532 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001533 } else if (is_mac) {
1534 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
1535 } else if (is_win) {
1536 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -05001537 libs += [ "Gdi32.lib" ]
1538 if (target_cpu != "arm64") {
1539 libs += [ "OpenGL32.lib" ]
1540 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001541 }
mtklein25c81d42016-07-27 13:55:26 -07001542
Brian Osmanc9a42472018-05-31 13:17:12 -04001543 cflags_objcc = [ "-fobjc-arc" ]
mtklein6ef69992016-09-14 06:12:09 -07001544
Brian Osmanc9a42472018-05-31 13:17:12 -04001545 if (skia_use_angle) {
1546 deps += [ "//third_party/angle2" ]
1547 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1548 }
Greg Daniel54200e42018-12-11 17:03:39 -05001549
Brian Osmanc9a42472018-05-31 13:17:12 -04001550 if (skia_use_vulkan) {
1551 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
1552 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Greg Danielda16cce2018-08-01 09:23:57 -04001553 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1554 public_deps += [ ":moltenvk" ]
1555 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001556 }
1557 if (skia_use_metal) {
1558 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001559 }
Stephen White985741a2019-07-18 11:43:45 -04001560 if (skia_use_dawn) {
1561 public_deps += [ "//third_party/dawn:dawn_headers" ]
1562 sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
1563 }
mtklein25c81d42016-07-27 13:55:26 -07001564 }
mtklein25c81d42016-07-27 13:55:26 -07001565
mtkleinc095df52016-08-24 12:23:52 -07001566 test_lib("flags") {
mtkleinc095df52016-08-24 12:23:52 -07001567 sources = [
Mike Klein88544fb2019-03-20 10:50:33 -05001568 "tools/flags/CommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001569 ]
1570 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001571
1572 test_lib("common_flags_config") {
mtklein046cb562016-09-16 10:23:12 -07001573 sources = [
Mike Klein88544fb2019-03-20 10:50:33 -05001574 "tools/flags/CommonFlagsConfig.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001575 ]
1576 deps = [
mtklein046cb562016-09-16 10:23:12 -07001577 ":flags",
Greg Danielda16cce2018-08-01 09:23:57 -04001578 ]
1579 public_deps = [
mtkleinc095df52016-08-24 12:23:52 -07001580 ":gpu_tool_utils",
1581 ]
1582 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001583 test_lib("common_flags_gpu") {
Mike Kleinc6142d82019-03-25 10:54:59 -05001584 sources = [
1585 "tools/flags/CommonFlagsGpu.cpp",
1586 ]
1587 deps = [
1588 ":flags",
1589 ]
1590 public_deps = [
1591 ":gpu_tool_utils",
1592 ]
1593 }
1594 test_lib("common_flags_images") {
Mike Kleinc6142d82019-03-25 10:54:59 -05001595 sources = [
1596 "tools/flags/CommonFlagsImages.cpp",
1597 ]
1598 deps = [
1599 ":flags",
1600 ]
1601 }
1602 test_lib("common_flags_aa") {
Mike Kleinc6142d82019-03-25 10:54:59 -05001603 sources = [
1604 "tools/flags/CommonFlagsAA.cpp",
1605 ]
1606 deps = [
1607 ":flags",
1608 ]
1609 }
mtklein25c81d42016-07-27 13:55:26 -07001610
Mike Klein499f0ac2019-03-25 13:00:12 -05001611 test_lib("trace") {
Mike Klein499f0ac2019-03-25 13:00:12 -05001612 deps = [
1613 ":flags",
1614 ]
1615 sources = [
1616 "tools/trace/ChromeTracingTracer.cpp",
1617 "tools/trace/ChromeTracingTracer.h",
1618 "tools/trace/EventTracingPriv.cpp",
1619 "tools/trace/EventTracingPriv.h",
1620 "tools/trace/SkDebugfTracer.cpp",
1621 "tools/trace/SkDebugfTracer.h",
1622 ]
1623 }
1624
mtkleinc095df52016-08-24 12:23:52 -07001625 test_lib("tool_utils") {
mtkleinc095df52016-08-24 12:23:52 -07001626 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001627 "tools/AndroidSkDebugToStdOut.cpp",
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001628 "tools/AutoreleasePool.h",
mtkleinc095df52016-08-24 12:23:52 -07001629 "tools/CrashHandler.cpp",
Robert Phillips96601082018-05-29 16:13:26 -04001630 "tools/DDLPromiseImageHelper.cpp",
1631 "tools/DDLTileHelper.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001632 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001633 "tools/ProcStats.cpp",
1634 "tools/Resources.cpp",
Hal Canarye574f1e2019-07-15 14:01:37 -04001635 "tools/SkMetaData.cpp",
1636 "tools/SkMetaData.h",
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001637 "tools/SkSharingProc.cpp",
Mike Kleinea3f0142019-03-20 11:12:10 -05001638 "tools/ToolUtils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001639 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001640 "tools/debugger/DebugCanvas.cpp",
1641 "tools/debugger/DrawCommand.cpp",
1642 "tools/debugger/JsonWriteBuffer.cpp",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001643 "tools/fonts/RandomScalerContext.cpp",
1644 "tools/fonts/TestEmptyTypeface.h",
1645 "tools/fonts/TestFontMgr.cpp",
1646 "tools/fonts/TestFontMgr.h",
1647 "tools/fonts/TestSVGTypeface.cpp",
1648 "tools/fonts/TestSVGTypeface.h",
1649 "tools/fonts/TestTypeface.cpp",
1650 "tools/fonts/TestTypeface.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001651 "tools/fonts/ToolUtilsFont.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001652 "tools/random_parse_path.cpp",
Hal Canary41248072019-07-11 16:32:53 -04001653 "tools/timer/TimeUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001654 "tools/timer/Timer.cpp",
1655 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001656 libs = []
1657 if (is_ios) {
1658 sources += [ "tools/ios_utils.m" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001659 sources += [ "tools/ios_utils.h" ]
1660 if (skia_use_metal) {
1661 sources += [ "tools/AutoreleasePool.mm" ]
1662 }
Mike Kleinadacaef2017-02-06 09:26:14 -05001663 libs += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001664 } else if (is_mac) {
1665 if (skia_use_metal) {
1666 sources += [ "tools/AutoreleasePool.mm" ]
1667 libs += [ "Foundation.framework" ]
1668 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001669 } else if (is_win) {
1670 libs += [ "DbgHelp.lib" ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001671 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001672
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001673 defines = []
1674 if (skia_tools_require_resources) {
1675 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1676 }
mtkleinc095df52016-08-24 12:23:52 -07001677 deps = [
Ben Wagner97182cc2018-02-15 10:20:04 -05001678 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001679 ":flags",
Mike Kleine4ad58a2019-03-26 09:05:52 -05001680 ]
1681 public_deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05001682 ":gpu_tool_utils",
mtkleinc095df52016-08-24 12:23:52 -07001683 ]
mtkleinc095df52016-08-24 12:23:52 -07001684 }
mtklein25c81d42016-07-27 13:55:26 -07001685
Mike Kleine11e5c12019-04-24 12:46:06 -05001686 test_lib("etc1") {
1687 sources = [
1688 "third_party/etc1/etc1.cpp",
1689 ]
1690 }
1691
Mike Reed7bf160e2019-05-17 16:50:51 -04001692 if (skia_use_ffmpeg) {
1693 test_lib("video_decoder") {
1694 sources = [
1695 "experimental/ffmpeg/SkVideoDecoder.cpp",
1696 "experimental/ffmpeg/SkVideoDecoder.h",
Mike Reedc0ee21f2019-05-28 16:11:03 -04001697 "experimental/ffmpeg/SkVideoEncoder.cpp",
1698 "experimental/ffmpeg/SkVideoEncoder.h",
Mike Reed7bf160e2019-05-17 16:50:51 -04001699 ]
1700 libs = [
Mike Reedf97e8e92019-05-29 13:33:55 -04001701 "swscale",
Mike Reed7bf160e2019-05-17 16:50:51 -04001702 "avcodec",
1703 "avformat",
1704 "avutil",
1705 ]
1706 }
1707 }
1708
Mike Klein6e744122016-10-27 12:21:40 -04001709 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001710 test_lib("gm") {
mtkleinc095df52016-08-24 12:23:52 -07001711 sources = gm_sources
1712 deps = [
Mike Kleine11e5c12019-04-24 12:46:06 -05001713 ":etc1",
scroggo19b91532016-10-24 09:03:26 -07001714 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001715 ":skia",
1716 ":tool_utils",
Mike Reed2f0edd52018-05-31 14:22:30 -04001717 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001718 "modules/skottie:gm",
Florin Malita3b526b02018-05-25 12:43:51 -04001719 "modules/sksg",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001720 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001721 ]
Mike Kleinc4abade2019-08-09 10:11:35 -04001722 if (is_skia_dev_build) {
1723 sources += [ "gm/fiddle.cpp" ]
1724 deps += [ ":skia.h" ]
1725 }
Greg Danielda16cce2018-08-01 09:23:57 -04001726 public_deps = [
1727 ":gpu_tool_utils",
1728 ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001729
1730 if (skia_use_ffmpeg) {
1731 deps += [ ":video_decoder" ]
1732 sources += [ "gm/video_decoder.cpp" ]
1733 }
mtkleinc095df52016-08-24 12:23:52 -07001734 }
mtklein25c81d42016-07-27 13:55:26 -07001735
Mike Klein7b7077c2019-06-03 17:10:59 -05001736 test_lib("skvm_builders") {
1737 sources = [
1738 "tools/SkVMBuilders.cpp",
1739 "tools/SkVMBuilders.h",
1740 ]
1741 }
1742
Mike Klein6e744122016-10-27 12:21:40 -04001743 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001744 test_lib("tests") {
Mike Klein6e744122016-10-27 12:21:40 -04001745 sources = tests_sources + pathops_tests_sources
Robert Phillips0c6daf02019-05-16 12:43:11 -04001746 if (skia_use_metal) {
1747 sources += metal_tests_sources
1748 }
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -05001749 if (!skia_enable_fontmgr_android) {
Mike Klein6e744122016-10-27 12:21:40 -04001750 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001751 }
Ben Wagner37a06c02018-06-22 21:11:00 +00001752 if (!(skia_use_freetype && skia_use_fontconfig)) {
1753 sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
1754 }
mtkleinc095df52016-08-24 12:23:52 -07001755 deps = [
Hal Canary0f666812018-03-22 15:21:12 -04001756 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001757 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001758 ":skia",
Mike Klein7b7077c2019-06-03 17:10:59 -05001759 ":skvm_builders",
mtkleinc095df52016-08-24 12:23:52 -07001760 ":tool_utils",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001761 "modules/skottie:tests",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001762 "modules/skparagraph:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001763 "modules/sksg:tests",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001764 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001765 "//third_party/libpng",
Leon Scroggins III194580d2019-02-22 12:32:16 -05001766 "//third_party/libwebp",
mtkleinc095df52016-08-24 12:23:52 -07001767 "//third_party/zlib",
1768 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001769 public_deps = [
1770 ":gpu_tool_utils", # Test.h #includes headers from this target.
1771 ]
mtkleinc095df52016-08-24 12:23:52 -07001772 }
mtklein2f3416d2016-08-02 16:02:05 -07001773
Mike Klein6e744122016-10-27 12:21:40 -04001774 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001775 test_lib("bench") {
mtkleinc095df52016-08-24 12:23:52 -07001776 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001777 deps = [
1778 ":flags",
1779 ":gm",
1780 ":gpu_tool_utils",
1781 ":skia",
Mike Klein7b7077c2019-06-03 17:10:59 -05001782 ":skvm_builders",
mtkleinc095df52016-08-24 12:23:52 -07001783 ":tool_utils",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001784 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04001785 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001786 ]
1787 }
mtklein2b6870c2016-07-28 14:17:33 -07001788
mtkleinc095df52016-08-24 12:23:52 -07001789 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001790 if (skia_use_expat) {
Hal Canary0f666812018-03-22 15:21:12 -04001791 sources = [
1792 "experimental/svg/model/SkSVGAttribute.cpp",
1793 "experimental/svg/model/SkSVGAttributeParser.cpp",
1794 "experimental/svg/model/SkSVGCircle.cpp",
1795 "experimental/svg/model/SkSVGClipPath.cpp",
1796 "experimental/svg/model/SkSVGContainer.cpp",
1797 "experimental/svg/model/SkSVGDOM.cpp",
1798 "experimental/svg/model/SkSVGEllipse.cpp",
1799 "experimental/svg/model/SkSVGGradient.cpp",
1800 "experimental/svg/model/SkSVGLine.cpp",
1801 "experimental/svg/model/SkSVGLinearGradient.cpp",
1802 "experimental/svg/model/SkSVGNode.cpp",
1803 "experimental/svg/model/SkSVGPath.cpp",
1804 "experimental/svg/model/SkSVGPattern.cpp",
1805 "experimental/svg/model/SkSVGPoly.cpp",
1806 "experimental/svg/model/SkSVGRadialGradient.cpp",
1807 "experimental/svg/model/SkSVGRect.cpp",
1808 "experimental/svg/model/SkSVGRenderContext.cpp",
1809 "experimental/svg/model/SkSVGSVG.cpp",
1810 "experimental/svg/model/SkSVGShape.cpp",
1811 "experimental/svg/model/SkSVGStop.cpp",
1812 "experimental/svg/model/SkSVGTransformableNode.cpp",
1813 "experimental/svg/model/SkSVGUse.cpp",
1814 "experimental/svg/model/SkSVGValue.cpp",
1815 ]
1816 deps = [
1817 ":skia",
1818 ":xml",
1819 ]
1820 }
mtkleinc095df52016-08-24 12:23:52 -07001821 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001822
Mike Reedd62d4062019-06-12 10:20:44 -04001823 test_lib("experimental_xform") {
1824 sources = [
1825 "experimental/xform/SkShape.cpp",
1826 "experimental/xform/SkXform.cpp",
1827 "experimental/xform/XContext.cpp",
1828 ]
1829 deps = [
1830 ":skia",
1831 ]
1832 }
1833
Mike Klein38af9432016-11-11 11:39:44 -05001834 if (skia_use_lua) {
1835 test_lib("lua") {
Mike Klein38af9432016-11-11 11:39:44 -05001836 sources = [
1837 "src/utils/SkLua.cpp",
1838 "src/utils/SkLuaCanvas.cpp",
1839 ]
1840 deps = [
Herb Derby264182c2018-05-29 15:53:40 -04001841 "modules/skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001842 "//third_party/lua",
1843 ]
1844 }
1845
Mike Kleine6682eb2017-01-05 10:54:57 -05001846 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001847 sources = [
1848 "tools/lua/lua_app.cpp",
1849 ]
1850 deps = [
1851 ":lua",
1852 ":skia",
1853 "//third_party/lua",
1854 ]
Mike Klein38af9432016-11-11 11:39:44 -05001855 }
1856
Mike Kleine6682eb2017-01-05 10:54:57 -05001857 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001858 sources = [
1859 "tools/lua/lua_pictures.cpp",
1860 ]
1861 deps = [
1862 ":flags",
1863 ":lua",
1864 ":skia",
1865 ":tool_utils",
1866 "//third_party/lua",
1867 ]
Mike Klein38af9432016-11-11 11:39:44 -05001868 }
1869 }
1870
Florin Malitabfe876a2018-09-02 12:33:59 -04001871 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04001872 test_app("skottie_tool") {
1873 deps = [
1874 "modules/skottie:tool",
1875 ]
1876 }
1877 }
1878
Hal Canary5b39dc82019-04-17 13:29:46 -04001879 test_app("make_skqp_model") {
1880 sources = [
1881 "tools/skqp/make_skqp_model.cpp",
1882 ]
1883 deps = [
1884 ":skia",
1885 ]
1886 }
1887
Kevin Lubickebf648e2017-09-21 13:45:16 -04001888 if (target_cpu != "wasm") {
1889 import("gn/samples.gni")
1890 test_lib("samples") {
Yuqian Li56a4a092018-02-12 14:47:34 +08001891 sources = samples_sources
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001892 public_deps = [
1893 ":tool_utils",
1894 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001895 deps = [
1896 ":experimental_svg_model",
1897 ":flags",
Mike Kleinc6142d82019-03-25 10:54:59 -05001898 ":gpu_tool_utils",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001899 ":xml",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001900 "modules/skparagraph:samples",
Mike Reedec80d902019-02-12 11:31:27 -05001901 "modules/sksg",
Herb Derby264182c2018-05-29 15:53:40 -04001902 "modules/skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001903 ]
Mike Klein38af9432016-11-11 11:39:44 -05001904
Kevin Lubickebf648e2017-09-21 13:45:16 -04001905 if (skia_use_lua) {
1906 sources += [ "samplecode/SampleLua.cpp" ]
1907 deps += [
1908 ":lua",
1909 "//third_party/lua",
1910 ]
1911 }
1912 }
Mike Klein7af351a2018-07-27 09:54:43 -04001913 test_app("imgcvt") {
1914 sources = [
1915 "tools/imgcvt.cpp",
1916 ]
1917 deps = [
1918 ":skcms",
1919 ":skia",
1920 ]
1921 }
Mike Klein735c7ba2019-03-25 12:57:58 -05001922 test_lib("hash_and_encode") {
Mike Klein735c7ba2019-03-25 12:57:58 -05001923 sources = [
1924 "tools/HashAndEncode.cpp",
1925 "tools/HashAndEncode.h",
1926 ]
1927 deps = [
1928 ":flags",
1929 ":skia",
1930 "//third_party/libpng",
1931 ]
1932 }
1933 test_app("fm") {
1934 sources = [
1935 "tools/fm/fm.cpp",
1936 ]
1937 deps = [
1938 ":common_flags_aa",
1939 ":common_flags_gpu",
Mike Klein6253d902019-03-27 15:09:12 -05001940 ":experimental_svg_model",
Mike Klein735c7ba2019-03-25 12:57:58 -05001941 ":flags",
1942 ":gm",
1943 ":gpu_tool_utils",
1944 ":hash_and_encode",
1945 ":skia",
1946 ":tool_utils",
1947 ":trace",
Mike Klein22924262019-04-02 14:14:56 -04001948 "modules/skottie",
1949 "modules/skottie:utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05001950 ]
1951 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04001952 test_app("dm") {
1953 sources = [
1954 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001955 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001956 "dm/DMJsonWriter.cpp",
1957 "dm/DMSrcSink.cpp",
1958 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001959 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05001960 ":common_flags_aa",
1961 ":common_flags_config",
1962 ":common_flags_gpu",
1963 ":common_flags_images",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001964 ":experimental_svg_model",
1965 ":flags",
1966 ":gm",
1967 ":gpu_tool_utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05001968 ":hash_and_encode",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001969 ":skia",
1970 ":tests",
1971 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05001972 ":trace",
Florin Malita3d856bd2018-05-26 09:49:28 -04001973 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05001974 "modules/skottie:utils",
Florin Malita3b526b02018-05-25 12:43:51 -04001975 "modules/sksg",
Mike Klein38af9432016-11-11 11:39:44 -05001976 ]
1977 }
Brian Osman16adfa32016-10-18 14:42:44 -04001978 }
1979
Mike Kleina8a51ce2018-01-09 12:34:11 -05001980 if (!is_win) {
1981 test_app("remote_demo") {
1982 sources = [
1983 "tools/remote_demo.cpp",
1984 ]
1985 deps = [
1986 ":skia",
1987 ]
1988 }
1989 }
1990
Mike Kleine6682eb2017-01-05 10:54:57 -05001991 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001992 sources = [
1993 "bench/nanobench.cpp",
1994 ]
1995 deps = [
1996 ":bench",
Mike Kleinc6142d82019-03-25 10:54:59 -05001997 ":common_flags_aa",
1998 ":common_flags_config",
1999 ":common_flags_gpu",
2000 ":common_flags_images",
fmalita6519c212016-09-14 08:05:17 -07002001 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07002002 ":flags",
2003 ":gm",
2004 ":gpu_tool_utils",
2005 ":skia",
2006 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002007 ":trace",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002008 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04002009 "modules/sksg",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002010 "modules/skshaper",
mtklein2b6870c2016-07-28 14:17:33 -07002011 ]
mtklein2b6870c2016-07-28 14:17:33 -07002012 }
halcanary19a97202016-08-03 15:08:04 -07002013
Ravi Mistry10d36c52017-01-31 09:49:18 -05002014 test_app("skpinfo") {
2015 sources = [
2016 "tools/skpinfo.cpp",
2017 ]
2018 deps = [
2019 ":flags",
2020 ":skia",
2021 ]
2022 }
2023
Mike Reedc0ee21f2019-05-28 16:11:03 -04002024 if (skia_use_ffmpeg) {
2025 test_app("skottie2movie") {
2026 sources = [
2027 "tools/skottie2movie.cpp",
2028 ]
2029 deps = [
2030 ":flags",
2031 ":skia",
2032 ":video_decoder",
2033 "modules/skottie",
Mike Reed5093e232019-05-30 10:10:50 -04002034 "modules/skottie:utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002035 ]
2036 }
2037 }
2038
Brian Osmanc9a42472018-05-31 13:17:12 -04002039 test_app("skpbench") {
2040 sources = [
2041 "tools/skpbench/skpbench.cpp",
2042 ]
2043 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002044 ":common_flags_config",
2045 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002046 ":flags",
2047 ":gpu_tool_utils",
2048 ":skia",
2049 ":tool_utils",
2050 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07002051 }
2052
Mike Kleine6682eb2017-01-05 10:54:57 -05002053 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07002054 sources = [
Herb Derby264182c2018-05-29 15:53:40 -04002055 "tools/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07002056 ]
2057 deps = [
2058 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04002059 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07002060 ]
halcanary3eee9d92016-09-10 07:01:53 -07002061 }
mtklein046cb562016-09-16 10:23:12 -07002062
Ben Wagner219f3622017-07-17 15:32:25 -04002063 test_app("create_test_font") {
2064 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05002065 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04002066 ]
2067 deps = [
2068 ":skia",
2069 ]
2070 assert_no_deps = [
2071 # tool_utils requires the output of this app.
2072 ":tool_utils",
2073 ]
2074 }
2075
Florin Malita5d3ff432018-07-31 16:38:43 -04002076 if (skia_use_expat) {
2077 test_app("create_test_font_color") {
2078 sources = [
2079 "tools/fonts/create_test_font_color.cpp",
2080 ]
2081 deps = [
2082 ":flags",
2083 ":skia",
2084 ":tool_utils",
2085 ]
2086 }
Ben Wagner97182cc2018-02-15 10:20:04 -05002087 }
2088
Mike Kleine6682eb2017-01-05 10:54:57 -05002089 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07002090 sources = [
2091 "tools/get_images_from_skps.cpp",
2092 ]
2093 deps = [
2094 ":flags",
2095 ":skia",
mtklein046cb562016-09-16 10:23:12 -07002096 ]
mtklein046cb562016-09-16 10:23:12 -07002097 }
mtkleinecbc5262016-09-22 11:51:24 -07002098
Brian Osman6788a542018-12-10 11:56:01 -05002099 if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
Mike Kleine6682eb2017-01-05 10:54:57 -05002100 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04002101 sources = [
2102 "tools/skiaserve/Request.cpp",
2103 "tools/skiaserve/Response.cpp",
2104 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002105 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
2106 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
2107 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
2108 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
2109 "tools/skiaserve/urlhandlers/DataHandler.cpp",
2110 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
2111 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
2112 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
2113 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05002114 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
2115 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002116 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
2117 "tools/skiaserve/urlhandlers/PostHandler.cpp",
2118 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
2119 "tools/skiaserve/urlhandlers/RootHandler.cpp",
2120 ]
2121 deps = [
2122 ":flags",
2123 ":gpu_tool_utils",
2124 ":skia",
2125 ":tool_utils",
Mike Klein7d302882016-11-03 14:06:31 -04002126 "//third_party/libmicrohttpd",
Mike Klein7d302882016-11-03 14:06:31 -04002127 ]
Mike Klein7d302882016-11-03 14:06:31 -04002128 }
mtkleinecbc5262016-09-22 11:51:24 -07002129 }
kjlubick14f984b2016-10-03 11:49:45 -07002130
Mike Kleine6682eb2017-01-05 10:54:57 -05002131 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07002132 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002133 "fuzz/Fuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05002134 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002135 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05002136 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04002137 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002138 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002139 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002140 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002141 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002142 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04002143 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04002144 "fuzz/FuzzRegionOp.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002145 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05002146 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
2147 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002148 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002149 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04002150 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002151 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05002152 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
2153 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002154 "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
2155 "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
Kevin Lubick0f0a7102019-03-18 16:20:55 -04002156 "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002157 "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002158 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05002159 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002160 "tools/debugger/DebugCanvas.cpp",
2161 "tools/debugger/DrawCommand.cpp",
2162 "tools/debugger/JsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002163 ]
2164 deps = [
2165 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04002166 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07002167 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04002168 "modules/skottie:fuzz",
kjlubick14f984b2016-10-03 11:49:45 -07002169 ]
kjlubick14f984b2016-10-03 11:49:45 -07002170 }
Mike Klein38312422016-10-05 15:41:01 -04002171
Mike Kleine6682eb2017-01-05 10:54:57 -05002172 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04002173 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04002174 rebase_path("tests/skia_test.cpp"),
2175 rebase_path("tests/Test.cpp"),
2176 ]
caryclark9feb6322016-10-25 08:58:26 -07002177 deps = [
2178 ":flags",
2179 ":gpu_tool_utils",
2180 ":skia",
2181 ":tool_utils",
2182 ]
caryclark9feb6322016-10-25 08:58:26 -07002183 }
2184
Mike Kleine6682eb2017-01-05 10:54:57 -05002185 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04002186 sources = [
2187 "tools/DumpRecord.cpp",
2188 "tools/dump_record.cpp",
2189 ]
2190 deps = [
2191 ":flags",
2192 ":skia",
2193 ]
Mike Klein38312422016-10-05 15:41:01 -04002194 }
bungemanfe917272016-10-13 17:36:40 -04002195
Mike Kleine6682eb2017-01-05 10:54:57 -05002196 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04002197 sources = [
2198 "tools/skdiff/skdiff.cpp",
2199 "tools/skdiff/skdiff_html.cpp",
2200 "tools/skdiff/skdiff_main.cpp",
2201 "tools/skdiff/skdiff_utils.cpp",
2202 ]
2203 deps = [
2204 ":skia",
2205 ":tool_utils",
2206 ]
bungemanfe917272016-10-13 17:36:40 -04002207 }
halcanarya73d76a2016-10-17 13:19:02 -07002208
Mike Kleine6682eb2017-01-05 10:54:57 -05002209 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07002210 sources = [
2211 "tools/skp_parser.cpp",
2212 ]
2213 deps = [
2214 ":skia",
2215 ":tool_utils",
halcanarya73d76a2016-10-17 13:19:02 -07002216 ]
halcanarya73d76a2016-10-17 13:19:02 -07002217 }
Brian Osman16adfa32016-10-18 14:42:44 -04002218
Brian Osmanc9a42472018-05-31 13:17:12 -04002219 if (!is_win) {
Hal Canaryd7b38452017-12-11 17:46:26 -05002220 test_lib("skqp_lib") {
Hal Canary0e07ad72018-02-08 13:06:56 -05002221 defines =
2222 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary75427132017-10-11 16:00:31 -04002223 sources = [
2224 "dm/DMGpuTestProcs.cpp",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002225 "tools/skqp/src/skqp.cpp",
2226 "tools/skqp/src/skqp_model.cpp",
Hal Canary75427132017-10-11 16:00:31 -04002227 ]
2228 deps = [
2229 ":gm",
2230 ":gpu_tool_utils",
2231 ":skia",
2232 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05002233 ":tool_utils",
2234 ]
2235 }
2236 test_app("skqp") {
2237 sources = [
Hal Canaryac7f23c2018-11-26 14:07:41 -05002238 "tools/skqp/src/skqp_main.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05002239 ]
2240 deps = [
2241 ":skia",
2242 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05002243 ":tool_utils",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002244 ]
2245 }
2246 test_app("jitter_gms") {
2247 sources = [
2248 "tools/skqp/jitter_gms.cpp",
2249 ]
2250 deps = [
2251 ":gm",
2252 ":skia",
2253 ":skqp_lib",
Hal Canary75427132017-10-11 16:00:31 -04002254 ]
2255 }
2256 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002257 if (is_android) {
Hal Canary28f89382017-12-12 09:42:14 -05002258 test_app("skqp_app") {
2259 is_shared_library = true
2260 sources = [
Hal Canaryac7f23c2018-11-26 14:07:41 -05002261 "tools/skqp/src/jni_skqp.cpp",
Hal Canary28f89382017-12-12 09:42:14 -05002262 ]
2263 deps = [
2264 ":skia",
2265 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05002266 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05002267 ]
2268 libs = [ "android" ]
2269 }
2270 }
Stan Iliev93151722018-08-02 11:10:52 -04002271 if (is_android && skia_enable_gpu) {
2272 test_app("skottie_android") {
2273 is_shared_library = true
2274
2275 sources = [
2276 "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
2277 "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
2278 ]
2279 libs = []
2280
Stan Iliev93151722018-08-02 11:10:52 -04002281 deps = [
2282 ":skia",
2283 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04002284 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04002285 ]
2286 }
2287 }
Hal Canary75427132017-10-11 16:00:31 -04002288
Hal Canarya9de7602018-01-19 13:08:23 -05002289 test_app("list_gms") {
2290 sources = [
2291 "tools/list_gms.cpp",
2292 ]
2293 deps = [
2294 ":gm",
2295 ":skia",
2296 ]
2297 }
2298 test_app("list_gpu_unit_tests") {
2299 sources = [
2300 "dm/DMGpuTestProcs.cpp",
2301 "tools/list_gpu_unit_tests.cpp",
2302 ]
2303 deps = [
2304 ":skia",
2305 ":tests",
2306 ]
2307 }
2308
Brian Osmanc9a42472018-05-31 13:17:12 -04002309 test_lib("sk_app") {
Hal Canary378be8d2019-04-26 08:20:14 -04002310 public_deps = [
Hal Canary378be8d2019-04-26 08:20:14 -04002311 ":gpu_tool_utils",
Hal Canary05694472019-05-03 17:14:21 -04002312 ":skia",
Hal Canary378be8d2019-04-26 08:20:14 -04002313 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002314 sources = [
2315 "tools/sk_app/CommandSet.cpp",
2316 "tools/sk_app/GLWindowContext.cpp",
2317 "tools/sk_app/Window.cpp",
2318 ]
2319 libs = []
2320
Stephen Whitea800ec92019-08-02 15:04:52 -04002321 if (skia_use_dawn) {
2322 sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
2323 }
2324
Brian Osmanc9a42472018-05-31 13:17:12 -04002325 if (is_android) {
2326 sources += [
2327 "tools/sk_app/android/GLWindowContext_android.cpp",
2328 "tools/sk_app/android/RasterWindowContext_android.cpp",
2329 "tools/sk_app/android/Window_android.cpp",
2330 "tools/sk_app/android/main_android.cpp",
2331 "tools/sk_app/android/surface_glue_android.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002332 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002333 libs += [ "android" ]
2334 } else if (is_linux) {
2335 sources += [
2336 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2337 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2338 "tools/sk_app/unix/Window_unix.cpp",
2339 "tools/sk_app/unix/keysym2ucs.c",
2340 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002341 ]
Stephen Whitea800ec92019-08-02 15:04:52 -04002342 if (skia_use_dawn) {
2343 if (dawn_enable_vulkan) {
2344 sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
2345 defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
2346 libs += [ "X11-xcb" ]
2347 }
2348 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002349 libs += [
2350 "GL",
2351 "X11",
2352 ]
2353 } else if (is_win) {
2354 sources += [
2355 "tools/sk_app/win/GLWindowContext_win.cpp",
2356 "tools/sk_app/win/RasterWindowContext_win.cpp",
2357 "tools/sk_app/win/Window_win.cpp",
2358 "tools/sk_app/win/main_win.cpp",
2359 ]
Brian Salomon194db172017-08-17 14:37:06 -04002360 if (skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002361 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002362 }
Stephen Whitea800ec92019-08-02 15:04:52 -04002363 if (skia_use_dawn) {
2364 if (dawn_enable_d3d12) {
2365 sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
2366 }
2367 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002368 } else if (is_mac) {
2369 sources += [
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002370 "tools/sk_app/mac/GLWindowContext_mac.mm",
2371 "tools/sk_app/mac/RasterWindowContext_mac.mm",
2372 "tools/sk_app/mac/Window_mac.mm",
2373 "tools/sk_app/mac/main_mac.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002374 ]
Stephen Whitea800ec92019-08-02 15:04:52 -04002375 if (skia_use_dawn) {
2376 if (dawn_enable_metal) {
2377 sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
2378 }
2379 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002380 libs += [
2381 "QuartzCore.framework",
2382 "Cocoa.framework",
2383 "Foundation.framework",
2384 ]
2385 } else if (is_ios) {
2386 sources += [
2387 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2388 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2389 "tools/sk_app/ios/Window_ios.cpp",
2390 "tools/sk_app/ios/main_ios.cpp",
2391 ]
2392 }
2393
2394 if (skia_use_vulkan) {
2395 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
2396 if (is_android) {
2397 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2398 } else if (is_linux) {
2399 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2400 libs += [ "X11-xcb" ]
2401 } else if (is_win) {
2402 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Jim Van Verthce51c142019-02-14 14:07:46 -05002403 } else if (is_mac) {
2404 sources += [ "tools/sk_app/mac/VulkanWindowContext_mac.mm" ]
2405 libs += [ "MetalKit.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002406 }
2407 }
2408
Jim Van Verthbe39f712019-02-08 15:36:14 -05002409 if (skia_use_metal) {
2410 sources += [ "tools/sk_app/MetalWindowContext.mm" ]
2411 if (is_mac) {
2412 sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
2413 }
2414 libs += [ "MetalKit.framework" ]
2415 }
2416
Brian Osmanc9a42472018-05-31 13:17:12 -04002417 deps = [
Brian Osmanc9a42472018-05-31 13:17:12 -04002418 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002419 ]
2420 if (is_android) {
2421 deps += [ "//third_party/native_app_glue" ]
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002422 } else if (is_ios) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002423 deps += [ "//third_party/libsdl" ]
2424 }
2425 if (skia_use_angle) {
2426 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002427 }
Brian Osman16adfa32016-10-18 14:42:44 -04002428 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002429
Hal Canary87515122019-03-15 14:22:51 -04002430 if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
2431 test_app("fiddle_examples") {
2432 sources = [
Brian Osmanc725e8f2019-04-10 14:08:44 -04002433 "tools/fiddle/all_examples.cpp",
Hal Canary87515122019-03-15 14:22:51 -04002434 "tools/fiddle/examples.cpp",
Brian Osman72ef2d52019-03-17 11:09:17 -04002435 "tools/fiddle/examples.h",
Hal Canary87515122019-03-15 14:22:51 -04002436 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002437 if (is_win) {
2438 cflags = [ "/wd4756" ] # Overflow in constant arithmetic
2439 }
Hal Canary87515122019-03-15 14:22:51 -04002440 deps = [
2441 ":skia",
2442 ":skia.h",
2443 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04002444 "modules/skshaper",
Hal Canary87515122019-03-15 14:22:51 -04002445 ]
2446 }
2447 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002448 test_app("viewer") {
2449 is_shared_library = is_android
Brian Osmanc9a42472018-05-31 13:17:12 -04002450 sources = [
Hal Canary41248072019-07-11 16:32:53 -04002451 "tools/viewer/AnimTimer.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002452 "tools/viewer/BisectSlide.cpp",
2453 "tools/viewer/GMSlide.cpp",
2454 "tools/viewer/ImGuiLayer.cpp",
2455 "tools/viewer/ImageSlide.cpp",
Brian Osman7c979f52019-02-12 13:27:51 -05002456 "tools/viewer/ParticlesSlide.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04002457 "tools/viewer/SKPSlide.cpp",
2458 "tools/viewer/SampleSlide.cpp",
2459 "tools/viewer/SkottieSlide.cpp",
2460 "tools/viewer/SlideDir.cpp",
2461 "tools/viewer/StatsLayer.cpp",
2462 "tools/viewer/SvgSlide.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002463 "tools/viewer/TouchGesture.cpp",
Leon Scroggins III81886e82018-08-22 11:18:08 -04002464 "tools/viewer/TouchGesture.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002465 "tools/viewer/Viewer.cpp",
2466 ]
2467 libs = []
2468
Brian Osmanc9a42472018-05-31 13:17:12 -04002469 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002470 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002471 ":experimental_svg_model",
2472 ":flags",
2473 ":gm",
2474 ":gpu_tool_utils",
2475 ":samples",
2476 ":sk_app",
2477 ":skia",
2478 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002479 ":trace",
Brian Osman7c979f52019-02-12 13:27:51 -05002480 "modules/particles",
Brian Osmanc9a42472018-05-31 13:17:12 -04002481 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05002482 "modules/skottie:utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002483 "modules/sksg",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002484 "modules/sksg:samples",
Brian Osmanc9a42472018-05-31 13:17:12 -04002485 "//third_party/imgui",
Brian Osmanc9a42472018-05-31 13:17:12 -04002486 ]
Mike Reedd62d4062019-06-12 10:20:44 -04002487 if (skia_use_experimental_xform) {
2488 deps += [ ":experimental_xform" ]
2489 sources += [ "gm/xform.cpp" ]
2490 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002491 }
2492
Brian Osmanc9a42472018-05-31 13:17:12 -04002493 if (!skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002494 test_app("HelloWorld") {
2495 sources = [
2496 "example/HelloWorld.cpp",
2497 ]
2498 libs = []
2499
Brian Osmaneff04b52017-11-21 13:18:02 -05002500 deps = [
2501 ":flags",
2502 ":gpu_tool_utils",
2503 ":sk_app",
2504 ":skia",
2505 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002506 ]
2507 }
2508 }
2509
Brian Osmanc9a42472018-05-31 13:17:12 -04002510 if (is_linux || is_mac || is_ios) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002511 test_app("SkiaSDLExample") {
2512 sources = [
2513 "example/SkiaSDLExample.cpp",
2514 ]
2515 libs = []
Jim Van Verth4c70c752017-07-11 12:03:01 -04002516 deps = [
2517 ":gpu_tool_utils",
2518 ":skia",
2519 "//third_party/libsdl",
2520 ]
2521 }
2522 }
2523
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002524 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2525 action_foreach("generate_mocs") {
2526 script = "gn/call.py"
2527 sources = [
2528 "tools/mdbviz/MainWindow.h",
2529 ]
2530 outputs = [
2531 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2532 ]
2533 args = [
2534 "$skia_qt_path" + "/bin/moc",
2535 "{{source}}",
2536 "-o",
2537 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2538 ]
2539 }
2540 action_foreach("generate_resources") {
2541 script = "gn/call.py"
2542 sources = [
2543 "tools/mdbviz/resources.qrc",
2544 ]
2545 outputs = [
2546 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2547 ]
2548 args = [
2549 "$skia_qt_path" + "/bin/rcc",
2550 "{{source}}",
2551 "-o",
2552 "gen/mdbviz/{{source_name_part}}_res.cpp",
2553 ]
2554 }
2555 test_app("mdbviz") {
2556 if (is_win) {
2557 # on Windows we need to disable some exception handling warnings due to the Qt headers
2558 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2559 }
2560 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002561 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002562 "tools/debugger/DebugCanvas.cpp",
2563 "tools/debugger/DrawCommand.cpp",
2564 "tools/debugger/JsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002565 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002566 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002567 "tools/mdbviz/main.cpp",
2568
2569 # generated files
2570 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2571 "$target_gen_dir/mdbviz/resources_res.cpp",
2572 ]
2573 lib_dirs = [ "$skia_qt_path/lib" ]
2574 libs = [
2575 "Qt5Core.lib",
2576 "Qt5Gui.lib",
2577 "Qt5Widgets.lib",
2578 ]
2579 include_dirs = [
2580 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002581 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002582 "$skia_qt_path/include/QtWidgets",
2583 ]
2584 deps = [
2585 ":generate_mocs",
2586 ":generate_resources",
2587 ":skia",
2588 ]
2589 }
2590 }
2591
Mike Kleine459afd2017-03-03 09:21:30 -05002592 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002593 copy("gdbserver") {
2594 sources = [
2595 "$ndk/$ndk_gdbserver",
2596 ]
2597 outputs = [
2598 "$root_out_dir/gdbserver",
2599 ]
2600 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002601 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002602
2603 if (skia_use_opencl) {
2604 test_app("hello-opencl") {
2605 sources = [
Mike Kleinf9ae6702018-06-20 14:05:05 -04002606 "tools/hello-opencl.cpp",
2607 ]
Mike Klein8a1f15d2019-02-11 11:59:41 -05002608 deps = [
2609 "//third_party/opencl",
2610 ]
Mike Kleinf9ae6702018-06-20 14:05:05 -04002611 }
2612 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002613
Brian Osmanf564f152019-07-23 15:14:30 -04002614 executable("cpu_modules") {
2615 sources = [
2616 "tools/cpu_modules.cpp",
2617 ]
2618 deps = [
2619 ":skia",
2620 "modules/particles",
2621 ]
2622 }
2623
Hal Canary1f94d392019-07-30 09:27:56 -04002624 if (skia_use_icu && skia_use_harfbuzz) {
2625 test_app("editor") {
2626 is_shared_library = is_android
2627 deps = [
2628 "experimental/editor:editor_app",
2629 ]
2630 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002631 }
Mike Kleinb5f95cd2019-07-02 14:16:26 -05002632
Mike Klein7e650762019-07-02 15:21:11 -05002633 if (skia_enable_skvm_jit) {
Mike Kleinb5f95cd2019-07-02 14:16:26 -05002634 test_app("skvmtool") {
2635 defines = [
2636 "SKVM_JIT",
2637 "SKVM_PERF_DUMPS",
2638 ]
2639 include_dirs = [ "." ]
2640 sources = [
2641 "src/core/SkSpinlock.cpp",
2642 "src/core/SkThreadID.cpp",
2643 "src/core/SkVM.cpp",
Mike Klein84bcd0c2019-07-23 11:46:09 -05002644 "tools/SkVMBuilders.cpp",
Mike Kleinb5f95cd2019-07-02 14:16:26 -05002645 "tools/SkVMTool.cpp",
2646 ]
2647 if (target_cpu == "x64") {
2648 sources += [ "src/core/SkCpu.cpp" ]
2649 }
2650 }
2651 }
mtklein25c81d42016-07-27 13:55:26 -07002652}