blob: 4b907e1dd7bd3a0d801d066fb6e3b34b6148d593 [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")
mikejurka8c24f4f2016-09-12 16:51:58 -07007import("gn/shared_sources.gni")
brettwb9447282016-09-01 14:24:39 -07008
Forrest Reiling30229ac2017-04-17 13:36:39 -07009if (is_fuchsia) {
10 import("//build/vulkan/config.gni")
11}
12
Mike Klein3669a822017-03-03 10:55:02 -050013if (!defined(is_skia_standalone)) {
14 is_skia_standalone = false
15}
16is_skia_dev_build = is_skia_standalone && !is_official_build
17
mtkleinc04ff472016-06-23 10:29:30 -070018declare_args() {
Mike Kleinc168a3a2016-11-14 14:53:13 +000019 skia_use_angle = false
Kevin Lubick4a24e102017-03-29 11:19:01 -040020 skia_use_egl = false
mtklein63213812016-08-24 09:55:56 -070021 skia_use_expat = true
mtklein3cc22182016-08-29 13:26:14 -070022 skia_use_fontconfig = is_linux
mtkleincdedd0e2016-09-12 15:15:44 -070023 skia_use_freetype = is_android || is_fuchsia || is_linux
Mike Klein7d302882016-11-03 14:06:31 -040024 skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows
mtklein63213812016-08-24 09:55:56 -070025 skia_use_libjpeg_turbo = true
26 skia_use_libpng = true
mtkleineb3c4252016-08-23 07:38:09 -070027 skia_use_libwebp = !is_fuchsia
Mike Kleinfae86b72018-01-08 15:49:09 -050028 skia_use_lua = is_skia_dev_build && !is_ios
Mike Klein10d665d2016-11-01 11:46:10 -040029 skia_use_piex = !is_win
mtklein63213812016-08-24 09:55:56 -070030 skia_use_zlib = true
Greg Daniele5ddff52017-07-05 16:49:36 -040031 skia_use_metal = false
Mike Klein36f182f2017-10-20 12:33:53 -040032 skia_use_libheif = is_skia_dev_build
Brian Osman670a2902018-04-23 13:31:56 -040033 skia_use_skcms = true
mtklein1bd72ba2016-09-16 07:45:52 -070034
Mike Klein7d921032017-01-05 12:20:41 -050035 skia_android_serial = ""
Brian Osman3f375d02016-12-28 11:19:22 -050036 skia_enable_discrete_gpu = true
Mike Kleina04bb452017-02-09 12:24:07 -050037 skia_enable_effects = true
Brian Osmanf2c90142017-07-13 15:50:03 -040038 skia_enable_flutter_defines = false
Hal Canaryff2742e2018-01-30 11:35:47 -050039 skia_enable_fontmgr_empty = false
Brian Osman74511012018-04-02 20:13:46 +000040 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050041 skia_enable_pdf = true
Florin Malita87ccf332018-05-04 12:23:24 -040042 skia_enable_skottie = true
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040043 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050044 skia_enable_tools = is_skia_dev_build
45 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Robert Phillipsa6d2d702017-09-01 12:17:03 -040046 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040047 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070048 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070049 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040050
Hal Canary4689b542018-01-31 11:54:14 -050051 skia_skqp_enable_driver_correctness_workarounds = false
Hal Canary2331c822018-02-01 14:06:13 -050052 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040053
54 skia_llvm_path = ""
55 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040056
57 skia_tools_require_resources = false
mtkleinc04ff472016-06-23 10:29:30 -070058}
Brian Salomon23d73ea2016-10-27 13:31:37 -040059declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040060 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040061 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050062 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Mike Klein10d665d2016-11-01 11:46:10 -040063
Brian Salomon5f33a8c2018-02-26 14:32:39 -050064 skia_use_legacy_gpu_pixel_ops = is_skia_dev_build && is_win # Arbitrary to keep old code path tested until deletion.
65
Mike Klein4d598a32016-10-31 13:44:49 -040066 if (is_android) {
67 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070068 } else if (is_fuchsia) {
69 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040070 } else {
Greg Daniel91dfa3b2018-05-22 13:25:15 -040071 skia_use_vulkan = (defined(skia_vulkan_sdk) && skia_vulkan_sdk != "") ||
72 (defined(skia_moltenvk_path) && skia_moltenvk_path != "")
Mike Klein4d598a32016-10-31 13:44:49 -040073 }
Jim Van Verth4e502972017-12-07 15:16:10 -050074
75 if (is_ios) {
76 skia_ios_identity = ".*Google.*"
77 skia_ios_profile = "Google Development"
78 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040079}
Brian Salomon789e25e2016-09-30 13:41:03 -040080
Adam Barth54ef74a2017-10-13 10:59:38 -070081if (defined(skia_settings)) {
82 import(skia_settings)
83}
84
mtklein38925aa2016-09-21 10:11:25 -070085# Our tools require static linking (they use non-exported symbols).
86skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070087
mtkleina45be612016-08-29 15:22:10 -070088fontmgr_android_enabled = skia_use_expat && skia_use_freetype
89
mtklein1211e0c2016-07-26 13:55:45 -070090skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070091 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070092 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070093 "include/codec",
94 "include/config",
95 "include/core",
96 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -040097 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -070098 "include/gpu",
Brian Salomoncbcb0a12017-11-19 13:20:13 -050099 "include/atlastext",
mtklein1211e0c2016-07-26 13:55:45 -0700100 "include/pathops",
101 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -0700102 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700103 "include/utils",
104 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700105]
106
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000107if (skia_use_vulkan) {
108 skia_public_includes += [ "include/gpu/vk" ]
109}
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500110if (skia_enable_atlas_text) {
111 skia_public_includes += [ "include/atlastext" ]
112}
Greg Daniele5ddff52017-07-05 16:49:36 -0400113if (skia_use_metal) {
114 skia_public_includes += [ "include/gpu/mtl" ]
115}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000116
mtkleinc04ff472016-06-23 10:29:30 -0700117# Skia public API, generally provided by :skia.
118config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700119 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -0400120 defines = []
121 if (is_component_build) {
122 defines += [ "SKIA_DLL" ]
123 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400124 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700125 defines += [ "SK_SAMPLES_FOR_X" ]
126 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400127 if (skia_enable_flutter_defines) {
128 defines += flutter_defines
129 }
mtklein06c35c02016-09-20 12:28:12 -0700130 if (!skia_enable_gpu) {
131 defines += [ "SK_SUPPORT_GPU=0" ]
132 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500133 if (skia_enable_atlas_text) {
134 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
135 }
mtkleinc04ff472016-06-23 10:29:30 -0700136}
137
138# Skia internal APIs, used by Skia itself and a few test tools.
139config("skia_private") {
140 visibility = [ ":*" ]
141
142 include_dirs = [
143 "include/private",
144 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700145 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700146 "src/core",
147 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700148 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700149 "src/image",
150 "src/images",
151 "src/lazy",
152 "src/opts",
153 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700154 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700155 "src/ports",
156 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400157 "src/shaders",
158 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700159 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700160 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700161 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500162 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700163 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700164 ]
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400165 if (skia_llvm_path != "") {
166 include_dirs += [ "$skia_llvm_path/include" ]
167 }
mtklein150d1132016-08-01 06:56:40 -0700168
Mike Reeda9e241d2017-05-03 10:52:00 -0400169 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700170 if (is_android) {
171 defines += [
172 "SK_GAMMA_EXPONENT=1.4",
173 "SK_GAMMA_CONTRAST=0.0",
174 ]
175 }
mtklein88a7ac02016-09-14 11:16:49 -0700176 if (is_official_build || is_android) {
177 # TODO(bsalomon): it'd be nice to make Android normal.
178 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
179 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400180 libs = []
181 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500182 if (skia_enable_gpu) {
183 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500184 if (is_skia_dev_build && skia_use_vulkan) {
185 include_dirs += [ "tools/gpu/vk" ]
186 }
Brian Salomon03e05842017-02-23 12:23:47 -0500187 }
Brian Osman34755e22016-12-05 09:46:02 -0500188 if (skia_use_angle) {
189 defines += [ "SK_ANGLE" ]
190 }
Brian Osman3f375d02016-12-28 11:19:22 -0500191 if (skia_enable_discrete_gpu) {
192 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
193 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400194 if (!is_official_build) {
195 defines += [ "GR_TEST_UTILS=1" ]
196 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400197 if (skia_llvm_path != "") {
198 defines += [ "SK_LLVM_AVAILABLE" ]
199 include_dirs += [ "$skia_llvm_path/include" ]
200 libs += [ skia_llvm_lib ]
201 lib_dirs += [ "$skia_llvm_path/lib/" ]
202 }
mtkleinc04ff472016-06-23 10:29:30 -0700203}
204
205# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
206config("skia_library") {
207 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700208 defines = [ "SKIA_IMPLEMENTATION=1" ]
209}
210
211skia_library_configs = [
212 ":skia_public",
213 ":skia_private",
214 ":skia_library",
215]
216
mtklein9b8583d2016-08-24 17:32:30 -0700217# Use for CPU-specific Skia code that needs particular compiler flags.
218template("opts") {
219 if (invoker.enabled) {
220 source_set(target_name) {
221 forward_variables_from(invoker, "*")
222 configs += skia_library_configs
223 }
224 } else {
225 # If not enabled, a phony empty target that swallows all otherwise unused variables.
226 source_set(target_name) {
227 forward_variables_from(invoker,
228 "*",
229 [
230 "sources",
231 "cflags",
232 ])
233 }
234 }
anmittala7eaf2e2016-08-17 13:57:26 -0700235}
236
mtklein422310d2016-08-16 18:28:43 -0700237is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700238
mtklein7d6fb2c2016-08-25 14:50:44 -0700239opts("none") {
240 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700241 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700242 cflags = []
243}
244
mtklein7d6fb2c2016-08-25 14:50:44 -0700245opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700246 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700247 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700248 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700249}
250
251opts("arm64") {
252 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700253 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700254 cflags = []
255}
256
257opts("crc32") {
258 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700259 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700260 cflags = [ "-march=armv8-a+crc" ]
261}
262
mtklein9b8583d2016-08-24 17:32:30 -0700263opts("sse2") {
264 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700265 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400266 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400267 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
268 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400269 cflags = [ "-msse2" ]
270 }
mtklein9b8583d2016-08-24 17:32:30 -0700271}
mtkleinc04ff472016-06-23 10:29:30 -0700272
mtklein9b8583d2016-08-24 17:32:30 -0700273opts("ssse3") {
274 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700275 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400276 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400277 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
278 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400279 cflags = [ "-mssse3" ]
280 }
mtklein9b8583d2016-08-24 17:32:30 -0700281}
mtkleinc04ff472016-06-23 10:29:30 -0700282
mtklein9b8583d2016-08-24 17:32:30 -0700283opts("sse41") {
284 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700285 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400286 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400287 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
288 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400289 cflags = [ "-msse4.1" ]
290 }
mtklein9b8583d2016-08-24 17:32:30 -0700291}
mtklein4e976072016-08-08 09:06:27 -0700292
mtklein9b8583d2016-08-24 17:32:30 -0700293opts("sse42") {
294 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700295 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400296 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400297 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
298 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400299 cflags = [ "-msse4.2" ]
300 }
mtklein9b8583d2016-08-24 17:32:30 -0700301}
302
303opts("avx") {
304 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700305 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400306 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000307 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400308 } else {
309 cflags = [ "-mavx" ]
310 }
mtkleinc04ff472016-06-23 10:29:30 -0700311}
312
Mike Klein1b9b7d52018-02-27 10:37:40 -0500313opts("hsw") {
314 enabled = is_x86
315 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400316 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500317 cflags = [ "/arch:AVX2" ]
318 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000319 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500320 }
321
322 # Oddly, clang-cl doesn't recognize this as a valid flag.
323 # If it ever does, it'd nice to move this up with -mavx2 and co.
324 if (is_clang && !is_win) {
325 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
326 # but nice to have, generating slightly better code for paths without explicit FMAs.
327 cflags += [ "-ffp-contract=fast" ]
328 }
329}
330
mtkleinc095df52016-08-24 12:23:52 -0700331# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700332template("optional") {
333 if (invoker.enabled) {
334 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700335 if (defined(invoker.public_defines)) {
336 defines = invoker.public_defines
337 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600338 if (defined(invoker.public_configs)) {
339 configs = invoker.public_configs
340 }
mtklein457b42a2016-08-23 13:56:37 -0700341 }
342 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700343 forward_variables_from(invoker,
344 "*",
345 [
346 "public_defines",
347 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700348 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700349 ])
mtklein457b42a2016-08-23 13:56:37 -0700350 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700351 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700352 if (defined(invoker.configs_to_remove)) {
353 configs -= invoker.configs_to_remove
354 }
mtklein457b42a2016-08-23 13:56:37 -0700355 }
356 } else {
mtklein457b42a2016-08-23 13:56:37 -0700357 source_set(target_name) {
358 forward_variables_from(invoker,
359 "*",
360 [
361 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400362 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700363 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700364 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700365 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700366 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700367 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700368 ])
mtkleincd01b032016-08-31 04:58:19 -0700369 if (defined(invoker.sources_when_disabled)) {
370 sources = invoker.sources_when_disabled
371 }
372 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700373 }
mtkleineb3c4252016-08-23 07:38:09 -0700374 }
mtklein457b42a2016-08-23 13:56:37 -0700375}
mtklein457b42a2016-08-23 13:56:37 -0700376
Mike Kleina04bb452017-02-09 12:24:07 -0500377optional("effects") {
378 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400379 deps = [
380 ":compile_processors",
381 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500382 sources =
383 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
384 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
385}
386
mtkleina45be612016-08-29 15:22:10 -0700387optional("fontmgr_android") {
388 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700389
390 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500391 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700392 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700393 ]
394 sources = [
395 "src/ports/SkFontMgr_android.cpp",
396 "src/ports/SkFontMgr_android_factory.cpp",
397 "src/ports/SkFontMgr_android_parser.cpp",
398 ]
399}
400
mtkleind2e39db2016-09-07 07:52:55 -0700401optional("fontmgr_custom") {
402 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
403
404 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500405 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700406 ]
407 sources = [
408 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500409 "src/ports/SkFontMgr_custom.h",
410 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700411 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500412 "src/ports/SkFontMgr_custom_embedded.cpp",
413 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700414 ]
415}
416
Hal Canaryff2742e2018-01-30 11:35:47 -0500417optional("fontmgr_empty") {
418 enabled = skia_enable_fontmgr_empty
419 sources = [
420 "src/ports/SkFontMgr_empty_factory.cpp",
421 ]
422}
423
mtklein3cc22182016-08-29 13:26:14 -0700424optional("fontmgr_fontconfig") {
425 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700426
427 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500428 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700429 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700430 ]
431 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700432 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700433 "src/ports/SkFontConfigInterface_direct.cpp",
434 "src/ports/SkFontConfigInterface_direct_factory.cpp",
435 "src/ports/SkFontMgr_FontConfigInterface.cpp",
436 "src/ports/SkFontMgr_fontconfig.cpp",
437 "src/ports/SkFontMgr_fontconfig_factory.cpp",
438 ]
439}
440
mtkleincdedd0e2016-09-12 15:15:44 -0700441optional("fontmgr_fuchsia") {
442 enabled = is_fuchsia && skia_use_freetype
443
444 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500445 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700446 ]
447 sources = [
448 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500449 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700450 "src/ports/SkFontMgr_custom_empty_factory.cpp",
451 ]
452}
453
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700454if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400455 executable("sksllex") {
456 sources = [
457 "src/sksl/lex/Main.cpp",
458 "src/sksl/lex/NFA.cpp",
459 "src/sksl/lex/RegexNode.cpp",
460 "src/sksl/lex/RegexParser.cpp",
461 ]
462 include_dirs = [ "src/sksl/lex" ]
463 }
464
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700465 action("run_sksllex") {
466 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400467 deps = [
468 ":sksllex(//gn/toolchain:$host_toolchain)",
469 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700470 sources = [
471 "src/sksl/lex/layout.lex",
472 "src/sksl/lex/sksl.lex",
473 ]
474
475 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
476 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
477 outputs = [
478 "$target_out_dir/" +
479 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
480 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
481 # confused due to the same file being named by two different paths
482 ]
483 sksllex_path = "$root_out_dir/"
484 sksllex_path += "sksllex"
485 if (host_os == "win") {
486 sksllex_path += ".exe"
487 }
488 args = [
489 rebase_path(sksllex_path),
490 rebase_path("bin/clang-format"),
491 rebase_path("src"),
492 ]
493 }
494} else {
495 group("run_sksllex") {
496 }
497}
498
499if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400500 executable("skslc") {
501 defines = [ "SKSL_STANDALONE" ]
502 sources = [
503 "src/sksl/SkSLMain.cpp",
504 ]
505 sources += skia_sksl_sources
506 include_dirs = [
507 "src/gpu",
508 "src/sksl",
509 ]
510 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500511 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400512 "//third_party/spirv-tools",
513 ]
514 }
515
516 skia_gpu_processor_outputs = []
517 foreach(src, skia_gpu_processor_sources) {
518 dir = get_path_info(src, "dir")
519 name = get_path_info(src, "name")
520
521 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
522 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
523 skia_gpu_processor_outputs += [
524 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
525 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
526 # confused due to the same file being named by two different paths
527 ]
528 }
529
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500530 action("create_sksl_enums") {
531 script = "gn/create_sksl_enums.py"
532 sources = [
533 "include/private/GrSharedEnums.h",
534 ]
535 outputs = [
536 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500537 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500538 ]
539 args = [
540 rebase_path(sources[0]),
541 rebase_path(outputs[0]),
542 ]
543 }
544
Ethan Nicholas762466e2017-06-29 10:03:38 -0400545 action("compile_processors") {
546 script = "gn/compile_processors.py"
547 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500548 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400549 ":skslc(//gn/toolchain:$host_toolchain)",
550 ]
551 sources = skia_gpu_processor_sources
552 outputs = skia_gpu_processor_outputs
553 skslc_path = "$root_out_dir/"
554 if (host_toolchain != default_toolchain_name) {
555 skslc_path += "$host_toolchain/"
556 }
557 skslc_path += "skslc"
558 if (host_os == "win") {
559 skslc_path += ".exe"
560 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400561 args = [
562 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400563 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400564 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400565 args += rebase_path(skia_gpu_processor_sources)
566 }
567} else {
568 skia_gpu_processor_outputs = []
569 group("compile_processors") {
570 }
571}
572
mtklein06c35c02016-09-20 12:28:12 -0700573optional("gpu") {
574 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400575 deps = [
576 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700577 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400578 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700579 if (skia_generate_workarounds) {
580 deps += [ ":workaround_list" ]
581 }
mtkleine9fb3d52016-09-20 15:11:46 -0700582 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600583 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400584 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700585
Brian Salomon3d6801e2017-12-11 10:06:31 -0500586 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700587
588 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500589 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700590 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400591 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700592 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400593 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400594
595 # this lib is required to link against AHardwareBuffer
596 if (defined(ndk_api) && ndk_api >= 26) {
597 libs += [ "android" ]
598 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400599 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500600 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400601 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700602 } else if (is_linux) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500603 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500604 libs += [
605 "GL",
606 "GLU",
607 ]
mtklein06c35c02016-09-20 12:28:12 -0700608 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500609 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800610 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500611 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400612 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500613 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400614 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700615 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500616 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700617 }
mtkleine9fb3d52016-09-20 15:11:46 -0700618
619 if (skia_use_vulkan) {
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400620 # TODO: We should make this deps be //third_party/vulkan and then update clients to have a
621 # //third_party/vulkan directory in their trees so they can set up the vulkan library however
622 # they want. For example this would allow us to remove the fuchsia specific vulkan code in our
623 # vulkan files.
624 public_deps += [ "third_party/vulkan" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700625 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700626 if (skia_enable_vulkan_debug_layers) {
627 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
628 }
mtkleine9fb3d52016-09-20 15:11:46 -0700629 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400630
Brian Salomon5f33a8c2018-02-26 14:32:39 -0500631 if (skia_use_legacy_gpu_pixel_ops) {
632 public_defines += [ "SK_LEGACY_GPU_PIXEL_OPS" ]
633 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400634 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400635 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400636 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
637 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400638
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400639 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400640 if (skia_use_metal) {
641 public_defines += [ "SK_METAL" ]
642 sources += skia_metal_sources
643 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400644 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400645 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500646
647 if (skia_enable_atlas_text) {
648 sources += skia_atlas_text_sources
649 }
mtklein06c35c02016-09-20 12:28:12 -0700650}
651
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400652optional("heif") {
653 enabled = skia_use_libheif
654 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
655
656 deps = []
657
658 sources = [
659 "src/codec/SkHeifCodec.cpp",
660 ]
661}
662
mtklein63213812016-08-24 09:55:56 -0700663optional("jpeg") {
664 enabled = skia_use_libjpeg_turbo
665 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
666
mtklein63213812016-08-24 09:55:56 -0700667 deps = [
668 "//third_party/libjpeg-turbo:libjpeg",
669 ]
670 sources = [
671 "src/codec/SkJpegCodec.cpp",
672 "src/codec/SkJpegDecoderMgr.cpp",
673 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700674 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400675 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700676 ]
677}
678
679optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500680 enabled = skia_use_zlib && skia_enable_pdf
681 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700682
mtklein63213812016-08-24 09:55:56 -0700683 deps = [
684 "//third_party/zlib",
685 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400686 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700687 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400688 }
brettwb9447282016-09-01 14:24:39 -0700689 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700690 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700691
692 if (skia_use_sfntly) {
693 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500694 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700695 }
696}
697
698optional("png") {
699 enabled = skia_use_libpng
700 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
701
mtklein63213812016-08-24 09:55:56 -0700702 deps = [
703 "//third_party/libpng",
704 ]
705 sources = [
706 "src/codec/SkIcoCodec.cpp",
707 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400708 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700709 ]
710}
711
scroggof84ad642016-10-31 09:02:57 -0700712optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400713 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700714 public_defines = [ "SK_CODEC_DECODES_RAW" ]
715
716 deps = [
717 "//third_party/dng_sdk",
718 "//third_party/libjpeg-turbo:libjpeg",
719 "//third_party/piex",
720 ]
721
722 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
723 # Skia.
724 configs_to_remove = [ "//gn:no_exceptions" ]
725
726 sources = [
727 "src/codec/SkRawAdapterCodec.cpp",
728 "src/codec/SkRawCodec.cpp",
729 ]
730}
731
Mike Klein852a8cb2018-05-15 10:46:58 -0400732import("third_party/skcms/skcms.gni")
733config("third_party_skcms_public") {
734 include_dirs = [ "third_party/skcms" ]
735}
736source_set("third_party_skcms") {
737 public_configs = [ ":third_party_skcms_public" ]
738
739 cflags = []
740 if (!is_win || is_clang) {
741 cflags += [
742 "-w",
743 "-std=c11",
744 ]
745 }
746
747 public = [
748 "third_party/skcms/skcms.h",
749 ]
750 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
751}
752
Mike Kleinfb333552018-01-25 12:49:37 -0500753optional("skcms") {
754 enabled = skia_use_skcms
755
Brian Osman094fba92018-03-26 17:05:48 -0400756 public_defines = [ "SK_USE_SKCMS" ]
Mike Kleinfb333552018-01-25 12:49:37 -0500757 deps = [
Mike Klein852a8cb2018-05-15 10:46:58 -0400758 ":third_party_skcms",
Mike Kleinfb333552018-01-25 12:49:37 -0500759 ]
760 sources = [
Brian Osman094fba92018-03-26 17:05:48 -0400761 "src/core/SkColorSpaceXform_skcms.cpp",
Mike Kleinfb333552018-01-25 12:49:37 -0500762 ]
763}
764
mtklein3cc22182016-08-29 13:26:14 -0700765optional("typeface_freetype") {
766 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700767
768 deps = [
769 "//third_party/freetype2",
770 ]
771 sources = [
772 "src/ports/SkFontHost_FreeType.cpp",
773 "src/ports/SkFontHost_FreeType_common.cpp",
774 ]
775}
776
mtklein457b42a2016-08-23 13:56:37 -0700777optional("webp") {
778 enabled = skia_use_libwebp
779 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
780
mtklein457b42a2016-08-23 13:56:37 -0700781 deps = [
782 "//third_party/libwebp",
783 ]
784 sources = [
785 "src/codec/SkWebpAdapterCodec.cpp",
786 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400787 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700788 ]
mtkleineb3c4252016-08-23 07:38:09 -0700789}
790
mtklein63213812016-08-24 09:55:56 -0700791optional("xml") {
792 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000793 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700794
mtklein63213812016-08-24 09:55:56 -0700795 deps = [
796 "//third_party/expat",
797 ]
798 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500799 "src/svg/SkSVGCanvas.cpp",
800 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700801 "src/xml/SkDOM.cpp",
802 "src/xml/SkXMLParser.cpp",
803 "src/xml/SkXMLWriter.cpp",
804 ]
805}
806
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700807if (skia_enable_gpu && skia_generate_workarounds) {
808 action("workaround_list") {
809 script = "tools/build_workaround_header.py"
810
811 inputs = [
812 "src/gpu/gpu_workaround_list.txt",
813 ]
814
815 # see comments in skia_compile_processors about out dir path shenanigans.
816 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700817 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700818
819 outputs = [
820 "$root_out_dir/$output_file",
821 ]
822 args = [
823 "--output-file",
824 "$output_file",
825 ]
826
827 foreach(file, inputs) {
828 args += [ rebase_path(file, root_build_dir) ]
829 }
830 }
831}
832
mtkleinc04ff472016-06-23 10:29:30 -0700833component("skia") {
834 public_configs = [ ":skia_public" ]
835 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700836
837 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700838 ":arm64",
839 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700840 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700841 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500842 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700843 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700844 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500845 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700846 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700847 ":fontmgr_fuchsia",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400848 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500849 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700850 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700851 ":none",
mtklein63213812016-08-24 09:55:56 -0700852 ":pdf",
853 ":png",
scroggof84ad642016-10-31 09:02:57 -0700854 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500855 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700856 ":sse2",
857 ":sse41",
858 ":sse42",
859 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700860 ":webp",
mtklein63213812016-08-24 09:55:56 -0700861 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700862 ]
863
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400864 # We need the public deps here for Vulkan. Our third_party/vulkan target sets some defines that
865 # need to get propagated up to the tools that depend on :skia and thus :gpu.
866 public_deps = [
867 ":gpu",
868 ]
869
Chinmay Garde43f115c2016-11-16 15:04:12 -0800870 # This file (and all GN files in Skia) are designed to work with an
871 # empty sources assignment filter; we handle all that explicitly.
872 # We clear the filter here for clients who may have set up a global filter.
873 set_sources_assignment_filter([])
874
mtkleinc04ff472016-06-23 10:29:30 -0700875 sources = []
brettwb9447282016-09-01 14:24:39 -0700876 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700877 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500878 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700879 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400880 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500881 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700882 "src/android/SkBitmapRegionCodec.cpp",
883 "src/android/SkBitmapRegionDecoder.cpp",
884 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400885 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700886 "src/codec/SkBmpCodec.cpp",
887 "src/codec/SkBmpMaskCodec.cpp",
888 "src/codec/SkBmpRLECodec.cpp",
889 "src/codec/SkBmpStandardCodec.cpp",
890 "src/codec/SkCodec.cpp",
891 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700892 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700893 "src/codec/SkMaskSwizzler.cpp",
894 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700895 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700896 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700897 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700898 "src/codec/SkSwizzler.cpp",
899 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700900 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700901 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700902 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700903 "src/ports/SkMemory_malloc.cpp",
904 "src/ports/SkOSFile_stdio.cpp",
905 "src/sfnt/SkOTTable_name.cpp",
906 "src/sfnt/SkOTUtils.cpp",
907 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700908 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700909 ]
brettwb9447282016-09-01 14:24:39 -0700910
mtklein7d6fb2c2016-08-25 14:50:44 -0700911 libs = []
912
mtkleinc04ff472016-06-23 10:29:30 -0700913 if (is_win) {
914 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400915 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700916 "src/ports/SkDebug_win.cpp",
917 "src/ports/SkFontHost_win.cpp",
918 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500919 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700920 "src/ports/SkImageEncoder_WIC.cpp",
921 "src/ports/SkImageGeneratorWIC.cpp",
922 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700923 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700924 "src/ports/SkScalerContext_win_dw.cpp",
925 "src/ports/SkTLS_win.cpp",
926 "src/ports/SkTypeface_win_dw.cpp",
927 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400928 libs += [
929 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500930 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400931 "Ole32.lib",
932 "OleAut32.lib",
933 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500934 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400935 ]
mtkleinc04ff472016-06-23 10:29:30 -0700936 } else {
937 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700938 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700939 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700940 "src/ports/SkTLS_pthread.cpp",
941 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400942 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700943 }
944
mtklein7d6fb2c2016-08-25 14:50:44 -0700945 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500946 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500947 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500948 deps += [ "//third_party/cpu-features" ]
949 }
mtklein06c35c02016-09-20 12:28:12 -0700950 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700951 libs += [
952 "EGL",
953 "GLESv2",
954 "log",
955 ]
956 }
957
mtkleinc04ff472016-06-23 10:29:30 -0700958 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700959 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400960 if (skia_use_egl) {
961 libs += [ "GLESv2" ]
962 }
mtkleinc04ff472016-06-23 10:29:30 -0700963 }
964
965 if (is_mac) {
966 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700967 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700968 "src/ports/SkFontHost_mac.cpp",
969 "src/ports/SkImageEncoder_CG.cpp",
970 "src/ports/SkImageGeneratorCG.cpp",
971 ]
mtklein09e61f72016-08-23 13:35:28 -0700972 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400973 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
974 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700975 "ApplicationServices.framework",
976 "OpenGL.framework",
977 ]
mtkleinc04ff472016-06-23 10:29:30 -0700978 }
abarth6fc8ff02016-07-15 15:15:15 -0700979
Mike Klein7d302882016-11-03 14:06:31 -0400980 if (is_ios) {
981 sources += [
982 "src/ports/SkDebug_stdio.cpp",
983 "src/ports/SkFontHost_mac.cpp",
984 "src/ports/SkImageEncoder_CG.cpp",
985 "src/ports/SkImageGeneratorCG.cpp",
986 ]
987 libs += [
988 "CoreFoundation.framework",
989 "CoreGraphics.framework",
990 "CoreText.framework",
991 "ImageIO.framework",
992 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400993
994 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
995 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400996 ]
997 }
998
abarth6fc8ff02016-07-15 15:15:15 -0700999 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001000 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001001 }
mtkleinc04ff472016-06-23 10:29:30 -07001002}
1003
mtkleinc095df52016-08-24 12:23:52 -07001004# Targets guarded by skia_enable_tools may use //third_party freely.
1005if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001006 # Used by gn_to_bp.py to list our public include dirs.
1007 source_set("public") {
1008 configs += [ ":skia_public" ]
1009 }
1010
Mike Kleinc36dedf2016-11-18 09:35:28 -05001011 config("skia.h_config") {
1012 include_dirs = [ "$target_gen_dir" ]
Greg Danielafb7ec72017-12-07 12:48:30 -05001013 if (skia_use_vulkan) {
1014 # So we can get the header which includes vulkan
1015 include_dirs += [ "tools/gpu/vk" ]
1016 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001017 }
1018 action("skia.h") {
1019 public_configs = [ ":skia.h_config" ]
1020 skia_h = "$target_gen_dir/skia.h"
1021 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -04001022 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +00001023 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001024 depfile = "$skia_h.deps"
1025 outputs = [
1026 skia_h,
1027 ]
1028 }
1029
1030 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001031 executable("fiddle") {
1032 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001033 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001034 "tools/fiddle/draw.cpp",
1035 "tools/fiddle/fiddle_main.cpp",
1036 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001037
1038 if (skia_use_egl) {
1039 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001040 } else {
1041 sources += [ "tools/fiddle/null_context.cpp" ]
1042 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001043 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001044 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001045 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001046 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001047 ":skia",
1048 ":skia.h",
1049 ]
1050 }
1051 }
1052
1053 if (skia_enable_gpu) {
1054 source_set("public_headers_warnings_check") {
1055 sources = [
1056 "tools/public_headers_warnings_check.cpp",
1057 ]
1058 configs -= [ "//gn:warnings_except_public_headers" ]
1059 deps = [
1060 ":skia",
1061 ":skia.h",
1062 ]
1063 }
1064 }
1065
mtkleinc095df52016-08-24 12:23:52 -07001066 template("test_lib") {
1067 config(target_name + "_config") {
1068 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001069 if (defined(invoker.public_defines)) {
1070 defines = invoker.public_defines
1071 }
mtklein25c81d42016-07-27 13:55:26 -07001072 }
mtkleinc095df52016-08-24 12:23:52 -07001073 source_set(target_name) {
1074 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1075 public_configs = [
1076 ":" + target_name + "_config",
1077 ":skia_private",
1078 ]
1079
1080 if (!defined(deps)) {
1081 deps = []
1082 }
1083 deps += [ ":skia" ]
1084 testonly = true
1085 }
mtklein25c81d42016-07-27 13:55:26 -07001086 }
mtklein25c81d42016-07-27 13:55:26 -07001087
Mike Kleine6682eb2017-01-05 10:54:57 -05001088 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001089 if (is_ios) {
1090 app_name = target_name
1091 gen_path = target_gen_dir
1092
1093 action("${app_name}_generate_info_plist") {
1094 script = "//gn/gen_plist_ios.py"
1095 outputs = [
1096 "$gen_path/${app_name}_Info.plist",
1097 ]
1098 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1099 }
1100
1101 bundle_data("${app_name}_bundle_info_plist") {
1102 public_deps = [
1103 ":${app_name}_generate_info_plist",
1104 ]
1105 sources = [
1106 "$gen_path/${app_name}_Info.plist",
1107 ]
1108 outputs = [
1109 "{{bundle_root_dir}}/Info.plist",
1110 ]
1111 }
1112
Jim Van Verth329c5a62017-11-29 11:42:33 -05001113 bundle_ios_data =
1114 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1115
1116 if (bundle_ios_data) {
1117 has_skps =
1118 "True" == exec_script("//gn/checkdir.py",
1119 [ rebase_path("skps", root_build_dir) ],
1120 "trim string")
1121 bundle_data("${app_name}_bundle_resources") {
1122 sources = [
1123 "resources",
1124 ]
1125 outputs = [
1126 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1127 "{{bundle_resources_dir}}/data/resources",
1128 ]
1129 }
1130
1131 if (has_skps) {
1132 bundle_data("${app_name}_bundle_skps") {
1133 sources = [
1134 "skps",
1135 ]
1136 outputs = [
1137 # Store in same folder as resources
1138 "{{bundle_resources_dir}}/data/skps",
1139 ]
1140 }
1141 }
1142 }
1143
Jim Van Verth443a9132017-11-28 09:45:26 -05001144 executable("${app_name}_generate_executable") {
1145 forward_variables_from(invoker,
1146 "*",
1147 [
1148 "output_name",
1149 "visibility",
1150 "is_shared_library",
1151 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001152 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001153 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001154 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1155 }
1156
1157 bundle_data("${app_name}_bundle_executable") {
1158 public_deps = [
1159 ":${app_name}_generate_executable",
1160 ]
1161 sources = [
1162 "$gen_path/$app_name",
1163 ]
1164 outputs = [
1165 "{{bundle_executable_dir}}/$app_name",
1166 ]
1167 testonly = true
1168 }
1169
1170 create_bundle("$app_name") {
1171 product_type = "com.apple.product-type.application"
1172 testonly = true
1173
1174 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1175 bundle_resources_dir = bundle_root_dir
1176 bundle_executable_dir = bundle_root_dir
1177 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1178
1179 deps = [
1180 ":${app_name}_bundle_executable",
1181 ":${app_name}_bundle_info_plist",
1182 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001183 if (bundle_ios_data) {
1184 deps += [ ":${app_name}_bundle_resources" ]
1185 if (has_skps) {
1186 deps += [ ":${app_name}_bundle_skps" ]
1187 }
1188 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001189
1190 # should only code sign when running on a device, not the simulator
1191 if (target_cpu != "x64") {
1192 code_signing_script = "//gn/codesign_ios.py"
1193 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1194 code_signing_outputs = [
1195 "$bundle_root_dir/_CodeSignature/CodeResources",
1196 "$bundle_root_dir/embedded.mobileprovision",
1197 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001198 code_signing_args = [
1199 rebase_path("$bundle_root_dir", root_build_dir),
1200 skia_ios_identity,
1201 skia_ios_profile,
1202 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001203 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001204 }
1205 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001206 # !is_ios
1207
1208 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1209 shared_library("lib" + target_name) {
1210 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1211 configs += [ ":skia_private" ]
1212 testonly = true
1213 }
1214 } else {
1215 _executable = target_name
1216 executable(_executable) {
1217 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1218 configs += [ ":skia_private" ]
1219 testonly = true
1220 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001221 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001222 if (is_android && skia_android_serial != "" && defined(_executable)) {
1223 action("push_" + target_name) {
1224 script = "gn/push_to_android.py"
1225 deps = [
1226 ":" + _executable,
1227 ]
1228 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1229 outputs = [
1230 _stamp,
1231 ]
1232 args = [
1233 rebase_path("$root_build_dir/$_executable"),
1234 skia_android_serial,
1235 rebase_path(_stamp),
1236 ]
1237 testonly = true
1238 }
Mike Klein7d921032017-01-05 12:20:41 -05001239 }
1240 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001241 }
1242
mtkleinc095df52016-08-24 12:23:52 -07001243 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001244 public_include_dirs = []
1245 if (skia_enable_gpu) {
1246 public_defines = []
1247 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001248
1249 deps = []
mtklein38925aa2016-09-21 10:11:25 -07001250 sources = [
1251 "tools/gpu/GrContextFactory.cpp",
1252 "tools/gpu/GrTest.cpp",
Brian Salomon58389b92018-03-07 13:01:25 -05001253 "tools/gpu/ProxyUtils.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001254 "tools/gpu/TestContext.cpp",
Brian Salomoncbcb0a12017-11-19 13:20:13 -05001255 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001256 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001257 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001258 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1259 "tools/gpu/gl/debug/GrBufferObj.cpp",
1260 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1261 "tools/gpu/gl/debug/GrProgramObj.cpp",
1262 "tools/gpu/gl/debug/GrShaderObj.cpp",
1263 "tools/gpu/gl/debug/GrTextureObj.cpp",
1264 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1265 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001266 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001267 ]
1268 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001269
Kevin Lubick4a24e102017-03-29 11:19:01 -04001270 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001271 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001272 } else if (is_ios) {
1273 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1274 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001275 } else if (is_linux) {
1276 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001277 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001278 } else if (is_mac) {
1279 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001280 } else if (is_win) {
1281 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1282 libs += [
1283 "Gdi32.lib",
1284 "OpenGL32.lib",
1285 ]
mtklein38925aa2016-09-21 10:11:25 -07001286 }
mtklein6ef69992016-09-14 06:12:09 -07001287
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001288 cflags_objcc = [ "-fobjc-arc" ]
1289
Mike Kleinc168a3a2016-11-14 14:53:13 +00001290 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001291 deps += [ "//third_party/angle2" ]
1292 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1293 }
mtkleind68f9b02016-09-23 13:18:41 -07001294 if (skia_use_vulkan) {
1295 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001296 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001297 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001298 if (skia_use_metal) {
1299 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1300 }
mtkleina627b5c2016-09-20 13:36:47 -07001301 }
mtklein25c81d42016-07-27 13:55:26 -07001302 }
mtklein25c81d42016-07-27 13:55:26 -07001303
mtkleinc095df52016-08-24 12:23:52 -07001304 test_lib("flags") {
1305 public_include_dirs = [ "tools/flags" ]
1306 sources = [
1307 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001308 ]
1309 }
1310 test_lib("common_flags") {
1311 public_include_dirs = [ "tools/flags" ]
1312 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001313 "tools/flags/SkCommonFlags.cpp",
1314 "tools/flags/SkCommonFlagsConfig.cpp",
1315 ]
1316 deps = [
mtklein046cb562016-09-16 10:23:12 -07001317 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001318 ":gpu_tool_utils",
1319 ]
1320 }
mtklein25c81d42016-07-27 13:55:26 -07001321
mtkleinc095df52016-08-24 12:23:52 -07001322 test_lib("tool_utils") {
1323 public_include_dirs = [
1324 "tools",
1325 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001326 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001327 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001328 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001329 ]
1330 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001331 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001332 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001333 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001334 "tools/ProcStats.cpp",
1335 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001336 "tools/UrlDataManager.cpp",
1337 "tools/debugger/SkDebugCanvas.cpp",
1338 "tools/debugger/SkDrawCommand.cpp",
1339 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001340 "tools/fonts/SkRandomScalerContext.cpp",
1341 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001342 "tools/fonts/SkTestFontMgr.h",
1343 "tools/fonts/SkTestSVGTypeface.cpp",
1344 "tools/fonts/SkTestSVGTypeface.h",
1345 "tools/fonts/SkTestTypeface.cpp",
1346 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001347 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001348 "tools/picture_utils.cpp",
1349 "tools/random_parse_path.cpp",
1350 "tools/sk_tool_utils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001351 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001352 "tools/trace/SkChromeTracingTracer.cpp",
1353 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001354 "tools/trace/SkDebugfTracer.cpp",
1355 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001356 "tools/trace/SkEventTracingPriv.cpp",
1357 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001358 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001359 libs = []
1360 if (is_ios) {
1361 sources += [ "tools/ios_utils.m" ]
1362 libs += [ "Foundation.framework" ]
1363 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001364 defines = []
1365 if (skia_tools_require_resources) {
1366 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1367 }
mtkleinc095df52016-08-24 12:23:52 -07001368 deps = [
mtklein046cb562016-09-16 10:23:12 -07001369 ":common_flags",
Ben Wagner97182cc2018-02-15 10:20:04 -05001370 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001371 ":flags",
1372 "//third_party/libpng",
1373 ]
1374 public_deps = [
1375 "//third_party/jsoncpp",
1376 ]
1377 }
mtklein25c81d42016-07-27 13:55:26 -07001378
Mike Klein6e744122016-10-27 12:21:40 -04001379 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001380 test_lib("gm") {
1381 public_include_dirs = [ "gm" ]
1382 sources = gm_sources
1383 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001384 ":experimental_sksg",
scroggo19b91532016-10-24 09:03:26 -07001385 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001386 ":gpu_tool_utils",
1387 ":skia",
1388 ":tool_utils",
1389 ]
1390 }
mtklein25c81d42016-07-27 13:55:26 -07001391
Mike Klein6e744122016-10-27 12:21:40 -04001392 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001393 test_lib("tests") {
1394 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001395 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001396 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001397 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001398 }
mtkleinc095df52016-08-24 12:23:52 -07001399 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001400 ":experimental_sksg",
Hal Canary0f666812018-03-22 15:21:12 -04001401 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001402 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001403 ":skia",
Mike Klein852a8cb2018-05-15 10:46:58 -04001404 ":third_party_skcms",
mtkleinc095df52016-08-24 12:23:52 -07001405 ":tool_utils",
1406 "//third_party/libpng",
1407 "//third_party/zlib",
1408 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001409 public_deps = [
1410 ":gpu_tool_utils", # Test.h #includes headers from this target.
1411 ]
mtkleinc095df52016-08-24 12:23:52 -07001412 }
mtklein2f3416d2016-08-02 16:02:05 -07001413
Mike Klein6e744122016-10-27 12:21:40 -04001414 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001415 test_lib("bench") {
1416 public_include_dirs = [ "bench" ]
1417 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001418 deps = [
1419 ":flags",
1420 ":gm",
1421 ":gpu_tool_utils",
1422 ":skia",
1423 ":tool_utils",
1424 ]
1425 }
mtklein2b6870c2016-07-28 14:17:33 -07001426
Florin Malita54f65c42018-01-16 17:04:30 -05001427 test_lib("experimental_skottie") {
Florin Malita87ccf332018-05-04 12:23:24 -04001428 public_include_dirs = []
Florin Malita87ccf332018-05-04 12:23:24 -04001429 if (skia_enable_skottie) {
1430 public_include_dirs += [ "experimental/skottie" ]
1431 public_defines = [ "SK_ENABLE_SKOTTIE" ]
1432 sources = [
1433 "experimental/skottie/Skottie.cpp",
1434 "experimental/skottie/SkottieAdapter.cpp",
1435 "experimental/skottie/SkottieAnimator.cpp",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001436 "experimental/skottie/SkottieJson.cpp",
Florin Malita87ccf332018-05-04 12:23:24 -04001437 "experimental/skottie/SkottieValue.cpp",
1438 ]
1439 deps = [
1440 ":experimental_sksg",
1441 ":skia",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001442 "//third_party/rapidjson",
Florin Malita87ccf332018-05-04 12:23:24 -04001443 ]
1444 }
Florin Malita094ccde2017-12-30 12:27:00 -05001445 }
1446
mtkleinc095df52016-08-24 12:23:52 -07001447 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001448 public_include_dirs = []
1449 if (skia_use_expat) {
1450 public_include_dirs += [ "experimental/svg/model" ]
1451 sources = [
1452 "experimental/svg/model/SkSVGAttribute.cpp",
1453 "experimental/svg/model/SkSVGAttributeParser.cpp",
1454 "experimental/svg/model/SkSVGCircle.cpp",
1455 "experimental/svg/model/SkSVGClipPath.cpp",
1456 "experimental/svg/model/SkSVGContainer.cpp",
1457 "experimental/svg/model/SkSVGDOM.cpp",
1458 "experimental/svg/model/SkSVGEllipse.cpp",
1459 "experimental/svg/model/SkSVGGradient.cpp",
1460 "experimental/svg/model/SkSVGLine.cpp",
1461 "experimental/svg/model/SkSVGLinearGradient.cpp",
1462 "experimental/svg/model/SkSVGNode.cpp",
1463 "experimental/svg/model/SkSVGPath.cpp",
1464 "experimental/svg/model/SkSVGPattern.cpp",
1465 "experimental/svg/model/SkSVGPoly.cpp",
1466 "experimental/svg/model/SkSVGRadialGradient.cpp",
1467 "experimental/svg/model/SkSVGRect.cpp",
1468 "experimental/svg/model/SkSVGRenderContext.cpp",
1469 "experimental/svg/model/SkSVGSVG.cpp",
1470 "experimental/svg/model/SkSVGShape.cpp",
1471 "experimental/svg/model/SkSVGStop.cpp",
1472 "experimental/svg/model/SkSVGTransformableNode.cpp",
1473 "experimental/svg/model/SkSVGUse.cpp",
1474 "experimental/svg/model/SkSVGValue.cpp",
1475 ]
1476 deps = [
1477 ":skia",
1478 ":xml",
1479 ]
1480 }
mtkleinc095df52016-08-24 12:23:52 -07001481 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001482
Florin Malita4aa44412017-12-19 12:21:02 -05001483 test_lib("experimental_sksg") {
1484 public_include_dirs = [
1485 "experimental/sksg",
1486 "experimental/sksg/effects",
1487 "experimental/sksg/geometry",
1488 "experimental/sksg/paint",
1489 ]
1490 sources = [
1491 "experimental/sksg/SkSGDraw.cpp",
1492 "experimental/sksg/SkSGEffectNode.cpp",
1493 "experimental/sksg/SkSGGeometryNode.cpp",
1494 "experimental/sksg/SkSGGroup.cpp",
Florin Malita49328072018-01-08 12:51:12 -05001495 "experimental/sksg/SkSGImage.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001496 "experimental/sksg/SkSGInvalidationController.cpp",
1497 "experimental/sksg/SkSGNode.cpp",
1498 "experimental/sksg/SkSGPaintNode.cpp",
1499 "experimental/sksg/SkSGRenderNode.cpp",
Florin Malita35efaa82018-01-22 12:57:06 -05001500 "experimental/sksg/SkSGScene.cpp",
Florin Malita38ea40e2018-01-29 16:31:14 -05001501 "experimental/sksg/effects/SkSGClipEffect.cpp",
Florin Malita5f9102f2018-01-10 13:36:22 -05001502 "experimental/sksg/effects/SkSGMaskEffect.cpp",
Florin Malitac0034172018-01-08 16:42:59 -05001503 "experimental/sksg/effects/SkSGOpacityEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001504 "experimental/sksg/effects/SkSGTransform.cpp",
Florin Malita16d0ad02018-01-19 15:07:29 -05001505 "experimental/sksg/geometry/SkSGGeometryTransform.cpp",
Florin Malitae6345d92018-01-03 23:37:54 -05001506 "experimental/sksg/geometry/SkSGMerge.cpp",
Florin Malita047ae272017-12-27 11:13:13 -05001507 "experimental/sksg/geometry/SkSGPath.cpp",
Florin Malita97b3d2b2018-02-20 11:26:15 -05001508 "experimental/sksg/geometry/SkSGPlane.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001509 "experimental/sksg/geometry/SkSGRect.cpp",
Florin Malita41dff6e2018-04-30 23:08:15 -04001510 "experimental/sksg/geometry/SkSGRoundEffect.cpp",
Florin Malita51012ce2018-01-31 17:06:59 -05001511 "experimental/sksg/geometry/SkSGText.cpp",
Florin Malita51b8c892018-01-07 08:54:24 -05001512 "experimental/sksg/geometry/SkSGTrimEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001513 "experimental/sksg/paint/SkSGColor.cpp",
Florin Malita6aaee592018-01-12 12:25:09 -05001514 "experimental/sksg/paint/SkSGGradient.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001515 ]
1516 deps = [
1517 ":skia",
1518 ]
1519 }
1520
Kevin Lubickebf648e2017-09-21 13:45:16 -04001521 if (target_cpu != "wasm") {
1522 test_lib("views") {
1523 public_include_dirs = [ "include/views" ]
1524 sources = [
1525 "src/views/SkEvent.cpp",
1526 "src/views/SkEventSink.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001527 "src/views/SkTouchGesture.cpp",
1528 "src/views/SkView.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001529 ]
Brian Osman34755e22016-12-05 09:46:02 -05001530 }
Brian Osman16adfa32016-10-18 14:42:44 -04001531 }
1532
Mike Klein38af9432016-11-11 11:39:44 -05001533 if (skia_use_lua) {
1534 test_lib("lua") {
1535 public_include_dirs = []
1536 sources = [
1537 "src/utils/SkLua.cpp",
1538 "src/utils/SkLuaCanvas.cpp",
1539 ]
1540 deps = [
Herb Derby1724db12018-05-22 12:01:50 -04001541 ":skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001542 "//third_party/lua",
1543 ]
1544 }
1545
Mike Kleine6682eb2017-01-05 10:54:57 -05001546 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001547 sources = [
1548 "tools/lua/lua_app.cpp",
1549 ]
1550 deps = [
1551 ":lua",
1552 ":skia",
1553 "//third_party/lua",
1554 ]
Mike Klein38af9432016-11-11 11:39:44 -05001555 }
1556
Mike Kleine6682eb2017-01-05 10:54:57 -05001557 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001558 sources = [
1559 "tools/lua/lua_pictures.cpp",
1560 ]
1561 deps = [
1562 ":flags",
1563 ":lua",
1564 ":skia",
1565 ":tool_utils",
1566 "//third_party/lua",
1567 ]
Mike Klein38af9432016-11-11 11:39:44 -05001568 }
1569 }
1570
Cary Clark8032b982017-07-28 11:04:54 -04001571 test_app("bookmaker") {
1572 sources = [
1573 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001574 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001575 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001576 "tools/bookmaker/fiddleParser.cpp",
1577 "tools/bookmaker/includeParser.cpp",
1578 "tools/bookmaker/includeWriter.cpp",
1579 "tools/bookmaker/mdOut.cpp",
1580 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001581 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001582 "tools/bookmaker/spellCheck.cpp",
1583 ]
1584 deps = [
1585 ":flags",
1586 ":skia",
1587 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001588 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001589 ]
1590 }
1591
Kevin Lubickebf648e2017-09-21 13:45:16 -04001592 if (target_cpu != "wasm") {
1593 import("gn/samples.gni")
1594 test_lib("samples") {
1595 public_include_dirs = [ "samplecode" ]
1596 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001597 sources = samples_sources
Kevin Lubickebf648e2017-09-21 13:45:16 -04001598 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001599 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001600 ":experimental_svg_model",
1601 ":flags",
1602 ":gm",
Mike Reed193d3a02018-02-08 15:45:51 -05001603 ":skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001604 ":tool_utils",
1605 ":views",
1606 ":xml",
1607 ]
Mike Klein38af9432016-11-11 11:39:44 -05001608
Kevin Lubickebf648e2017-09-21 13:45:16 -04001609 if (skia_use_lua) {
1610 sources += [ "samplecode/SampleLua.cpp" ]
1611 deps += [
1612 ":lua",
1613 "//third_party/lua",
1614 ]
1615 }
1616 }
1617 test_app("dm") {
1618 sources = [
1619 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001620 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001621 "dm/DMJsonWriter.cpp",
1622 "dm/DMSrcSink.cpp",
1623 ]
1624 include_dirs = [ "tests" ]
1625 deps = [
1626 ":common_flags",
Florin Malita54f65c42018-01-16 17:04:30 -05001627 ":experimental_skottie",
Florin Malita4aa44412017-12-19 12:21:02 -05001628 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001629 ":experimental_svg_model",
1630 ":flags",
1631 ":gm",
1632 ":gpu_tool_utils",
1633 ":skia",
1634 ":tests",
1635 ":tool_utils",
1636 "//third_party/jsoncpp",
1637 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001638 ]
1639 }
Brian Osman16adfa32016-10-18 14:42:44 -04001640 }
1641
Mike Kleina8a51ce2018-01-09 12:34:11 -05001642 if (!is_win) {
1643 test_app("remote_demo") {
1644 sources = [
1645 "tools/remote_demo.cpp",
1646 ]
1647 deps = [
1648 ":skia",
1649 ]
1650 }
1651 }
1652
Mike Kleine6682eb2017-01-05 10:54:57 -05001653 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001654 sources = [
1655 "bench/nanobench.cpp",
1656 ]
1657 deps = [
1658 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001659 ":common_flags",
Florin Malita4aa44412017-12-19 12:21:02 -05001660 ":experimental_sksg",
fmalita6519c212016-09-14 08:05:17 -07001661 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001662 ":flags",
1663 ":gm",
1664 ":gpu_tool_utils",
1665 ":skia",
1666 ":tool_utils",
1667 "//third_party/jsoncpp",
1668 ]
mtklein2b6870c2016-07-28 14:17:33 -07001669 }
halcanary19a97202016-08-03 15:08:04 -07001670
Ravi Mistry10d36c52017-01-31 09:49:18 -05001671 test_app("skpinfo") {
1672 sources = [
1673 "tools/skpinfo.cpp",
1674 ]
1675 deps = [
1676 ":flags",
1677 ":skia",
1678 ]
1679 }
1680
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001681 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001682 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001683 sources = [
1684 "tools/skpbench/skpbench.cpp",
1685 ]
1686 deps = [
1687 ":flags",
1688 ":gpu_tool_utils",
1689 ":skia",
1690 ":tool_utils",
1691 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001692 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001693 }
1694
Hal Canary96c57252018-02-09 11:43:05 -05001695 test_lib("skshaper") {
1696 public_include_dirs = [ "tools/shape" ]
1697 deps = [
1698 ":skia",
1699 ]
1700
Hal Canary8bb40832018-02-08 15:16:28 -05001701 if (target_cpu == "wasm") {
Hal Canary96c57252018-02-09 11:43:05 -05001702 sources = [
1703 "tools/shape/SkShaper_primitive.cpp",
1704 ]
1705 } else {
mtklein6f5df6a2016-08-29 16:01:10 -07001706 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001707 "tools/shape/SkShaper_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001708 ]
Hal Canary96c57252018-02-09 11:43:05 -05001709 deps += [
mtklein6f5df6a2016-08-29 16:01:10 -07001710 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001711 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001712 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001713 }
halcanary19a97202016-08-03 15:08:04 -07001714 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001715 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001716 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001717 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001718 ]
1719 deps = [
1720 ":skia",
Hal Canary96c57252018-02-09 11:43:05 -05001721 ":skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001722 ]
halcanary3eee9d92016-09-10 07:01:53 -07001723 }
mtklein046cb562016-09-16 10:23:12 -07001724
Matt Sarett9f1c4032017-05-17 10:06:32 -04001725 test_app("create_flutter_test_images") {
1726 sources = [
1727 "tools/create_flutter_test_images.cpp",
1728 ]
1729 deps = [
1730 ":skia",
1731 ":tool_utils",
1732 ]
1733 }
1734
Ben Wagner219f3622017-07-17 15:32:25 -04001735 test_app("create_test_font") {
1736 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001737 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001738 ]
1739 deps = [
1740 ":skia",
1741 ]
1742 assert_no_deps = [
1743 # tool_utils requires the output of this app.
1744 ":tool_utils",
1745 ]
1746 }
1747
Ben Wagner97182cc2018-02-15 10:20:04 -05001748 test_app("create_test_font_color") {
1749 sources = [
1750 "tools/fonts/create_test_font_color.cpp",
1751 ]
1752 deps = [
1753 ":flags",
1754 ":skia",
Florin Malitac659c2c2018-04-05 11:57:21 -04001755 ":tool_utils",
Ben Wagner97182cc2018-02-15 10:20:04 -05001756 ]
1757 }
1758
Mike Kleine6682eb2017-01-05 10:54:57 -05001759 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001760 sources = [
1761 "tools/get_images_from_skps.cpp",
1762 ]
1763 deps = [
1764 ":flags",
1765 ":skia",
1766 "//third_party/jsoncpp",
1767 ]
mtklein046cb562016-09-16 10:23:12 -07001768 }
mtkleinecbc5262016-09-22 11:51:24 -07001769
Kevin Lubickebf648e2017-09-21 13:45:16 -04001770 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001771 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001772 sources = [
1773 "tools/skiaserve/Request.cpp",
1774 "tools/skiaserve/Response.cpp",
1775 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001776 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1777 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1778 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1779 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1780 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1781 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1782 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1783 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1784 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001785 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1786 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001787 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1788 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1789 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1790 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1791 ]
1792 deps = [
1793 ":flags",
1794 ":gpu_tool_utils",
1795 ":skia",
1796 ":tool_utils",
1797 "//third_party/jsoncpp",
1798 "//third_party/libmicrohttpd",
1799 "//third_party/libpng",
1800 ]
Mike Klein7d302882016-11-03 14:06:31 -04001801 }
mtkleinecbc5262016-09-22 11:51:24 -07001802 }
kjlubick14f984b2016-10-03 11:49:45 -07001803
Mike Kleine6682eb2017-01-05 10:54:57 -05001804 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001805 include_dirs = [
1806 "tools",
1807 "tools/debugger",
1808 ]
kjlubick14f984b2016-10-03 11:49:45 -07001809 sources = [
Hal Canary24ac42b2017-02-14 13:35:14 -05001810 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001811 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001812 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001813 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001814 "fuzz/FuzzGradients.cpp",
1815 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001816 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001817 "fuzz/FuzzPathop.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001818 "fuzz/FuzzRegionOp.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001819 "fuzz/fuzz.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001820 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1821 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001822 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
1823 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001824 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1825 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001826 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001827 "tools/UrlDataManager.cpp",
1828 "tools/debugger/SkDebugCanvas.cpp",
1829 "tools/debugger/SkDrawCommand.cpp",
1830 "tools/debugger/SkJsonWriteBuffer.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001831 "tools/picture_utils.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001832 ]
1833 deps = [
Kevin Lubick9eeede22018-05-03 16:26:10 -04001834 ":experimental_skottie",
kjlubick14f984b2016-10-03 11:49:45 -07001835 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001836 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001837 ":skia",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001838 "//third_party/jsoncpp",
1839 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001840 ]
Florin Malita0b0d93d2018-05-04 15:01:03 -04001841
1842 if (skia_enable_skottie) {
1843 sources += [ "fuzz/oss_fuzz/FuzzSkottieJSON.cpp" ]
1844 }
kjlubick14f984b2016-10-03 11:49:45 -07001845 }
Mike Klein38312422016-10-05 15:41:01 -04001846
Mike Kleine6682eb2017-01-05 10:54:57 -05001847 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001848 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001849 rebase_path("tests/skia_test.cpp"),
1850 rebase_path("tests/Test.cpp"),
1851 ]
caryclark9feb6322016-10-25 08:58:26 -07001852 deps = [
1853 ":flags",
1854 ":gpu_tool_utils",
1855 ":skia",
1856 ":tool_utils",
1857 ]
caryclark9feb6322016-10-25 08:58:26 -07001858 }
1859
Mike Kleine6682eb2017-01-05 10:54:57 -05001860 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001861 sources = [
1862 "tools/DumpRecord.cpp",
1863 "tools/dump_record.cpp",
1864 ]
1865 deps = [
1866 ":flags",
1867 ":skia",
1868 ]
Mike Klein38312422016-10-05 15:41:01 -04001869 }
bungemanfe917272016-10-13 17:36:40 -04001870
Mike Kleine6682eb2017-01-05 10:54:57 -05001871 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001872 sources = [
1873 "tools/skdiff/skdiff.cpp",
1874 "tools/skdiff/skdiff_html.cpp",
1875 "tools/skdiff/skdiff_main.cpp",
1876 "tools/skdiff/skdiff_utils.cpp",
1877 ]
1878 deps = [
1879 ":skia",
1880 ":tool_utils",
1881 ]
bungemanfe917272016-10-13 17:36:40 -04001882 }
halcanarya73d76a2016-10-17 13:19:02 -07001883
Mike Kleine6682eb2017-01-05 10:54:57 -05001884 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001885 sources = [
1886 "tools/skp_parser.cpp",
1887 ]
1888 deps = [
1889 ":skia",
1890 ":tool_utils",
1891 "//third_party/jsoncpp",
1892 ]
halcanarya73d76a2016-10-17 13:19:02 -07001893 }
Brian Osman16adfa32016-10-18 14:42:44 -04001894
Hal Canaryd7b38452017-12-11 17:46:26 -05001895 if (!is_win && skia_enable_gpu) {
1896 test_lib("skqp_lib") {
1897 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001898 defines =
1899 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001900 if (skia_skqp_enable_driver_correctness_workarounds) {
1901 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1902 }
Hal Canary75427132017-10-11 16:00:31 -04001903 sources = [
1904 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001905 "tools/skqp/gm_knowledge.cpp",
1906 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001907 ]
1908 deps = [
1909 ":gm",
1910 ":gpu_tool_utils",
1911 ":skia",
1912 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001913 ":tool_utils",
1914 ]
1915 }
1916 test_app("skqp") {
1917 sources = [
1918 "tools/skqp/skqp.cpp",
1919 ]
1920 deps = [
1921 ":skia",
1922 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001923 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001924 "//third_party/googletest",
1925 ]
1926 }
1927 }
Hal Canary28f89382017-12-12 09:42:14 -05001928 if (is_android && skia_enable_gpu) {
1929 test_app("skqp_app") {
1930 is_shared_library = true
1931 sources = [
1932 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1933 ]
1934 deps = [
1935 ":skia",
1936 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001937 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001938 ]
1939 libs = [ "android" ]
1940 }
1941 }
Hal Canary75427132017-10-11 16:00:31 -04001942
Hal Canarya9de7602018-01-19 13:08:23 -05001943 test_app("list_gms") {
1944 sources = [
1945 "tools/list_gms.cpp",
1946 ]
1947 deps = [
1948 ":gm",
1949 ":skia",
1950 ]
1951 }
1952 test_app("list_gpu_unit_tests") {
1953 sources = [
1954 "dm/DMGpuTestProcs.cpp",
1955 "tools/list_gpu_unit_tests.cpp",
1956 ]
1957 deps = [
1958 ":skia",
1959 ":tests",
1960 ]
1961 }
1962
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001963 if (skia_enable_gpu) {
Brian Osmaneff04b52017-11-21 13:18:02 -05001964 test_lib("sk_app") {
1965 public_include_dirs = [ "tools/sk_app" ]
Brian Osman16adfa32016-10-18 14:42:44 -04001966 sources = [
Brian Osmaneff04b52017-11-21 13:18:02 -05001967 "tools/sk_app/CommandSet.cpp",
1968 "tools/sk_app/GLWindowContext.cpp",
1969 "tools/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001970 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001971 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001972
Jim Van Verth4e56a912016-10-21 10:58:52 -04001973 if (is_android) {
1974 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001975 "tools/sk_app/android/GLWindowContext_android.cpp",
1976 "tools/sk_app/android/RasterWindowContext_android.cpp",
1977 "tools/sk_app/android/Window_android.cpp",
1978 "tools/sk_app/android/main_android.cpp",
1979 "tools/sk_app/android/surface_glue_android.cpp",
Jim Van Verth4e56a912016-10-21 10:58:52 -04001980 ]
Brian Osman462334e2017-02-09 11:22:57 -05001981 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001982 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001983 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001984 "tools/sk_app/unix/GLWindowContext_unix.cpp",
1985 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
1986 "tools/sk_app/unix/Window_unix.cpp",
Brian Osmanfa916272017-12-01 09:18:20 -05001987 "tools/sk_app/unix/keysym2ucs.c",
Brian Osmaneff04b52017-11-21 13:18:02 -05001988 "tools/sk_app/unix/main_unix.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001989 ]
Brian Osmanfa916272017-12-01 09:18:20 -05001990 libs += [
1991 "GL",
1992 "X11",
1993 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001994 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001995 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001996 "tools/sk_app/win/GLWindowContext_win.cpp",
1997 "tools/sk_app/win/RasterWindowContext_win.cpp",
1998 "tools/sk_app/win/Window_win.cpp",
1999 "tools/sk_app/win/main_win.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002000 ]
Brian Salomon194db172017-08-17 14:37:06 -04002001 if (skia_use_angle) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002002 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002003 }
Mike Klein43c25262016-10-20 10:17:47 -04002004 } else if (is_mac) {
2005 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002006 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2007 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2008 "tools/sk_app/mac/Window_mac.cpp",
2009 "tools/sk_app/mac/main_mac.cpp",
Mike Klein43c25262016-10-20 10:17:47 -04002010 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002011 libs += [
2012 "QuartzCore.framework",
2013 "Cocoa.framework",
2014 "Foundation.framework",
2015 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002016 } else if (is_ios) {
2017 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002018 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2019 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2020 "tools/sk_app/ios/Window_ios.cpp",
2021 "tools/sk_app/ios/main_ios.cpp",
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002022 ]
Brian Osman16adfa32016-10-18 14:42:44 -04002023 }
2024
2025 if (skia_use_vulkan) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002026 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002027 if (is_android) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002028 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002029 } else if (is_linux) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002030 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
Brian Osman2dd96932016-10-18 15:33:53 -04002031 libs += [ "X11-xcb" ]
2032 } else if (is_win) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002033 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Brian Osman16adfa32016-10-18 14:42:44 -04002034 }
2035 }
2036
Brian Osman16adfa32016-10-18 14:42:44 -04002037 deps = [
Brian Osman16adfa32016-10-18 14:42:44 -04002038 ":gpu_tool_utils",
Brian Osman16adfa32016-10-18 14:42:44 -04002039 ":skia",
2040 ":tool_utils",
2041 ":views",
Brian Osman16adfa32016-10-18 14:42:44 -04002042 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002043 if (is_android) {
2044 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002045 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04002046 deps += [ "//third_party/libsdl" ]
2047 }
Brian Salomon194db172017-08-17 14:37:06 -04002048 if (skia_use_angle) {
2049 deps += [ "//third_party/angle2" ]
2050 }
Mike Kleina92c3832016-12-08 09:49:39 -05002051 }
Brian Osman16adfa32016-10-18 14:42:44 -04002052 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002053
Brian Osmaneff04b52017-11-21 13:18:02 -05002054 if (skia_enable_gpu) {
2055 test_app("viewer") {
2056 is_shared_library = is_android
Jim Van Verth329c5a62017-11-29 11:42:33 -05002057 if (is_ios) {
2058 bundle_ios_data = true
2059 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002060 sources = [
Chris Dalton2d18f412018-02-20 13:23:32 -07002061 "tools/viewer/BisectSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002062 "tools/viewer/GMSlide.cpp",
Brian Osmand67e5182017-12-08 16:46:09 -05002063 "tools/viewer/ImGuiLayer.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002064 "tools/viewer/ImageSlide.cpp",
2065 "tools/viewer/SKPSlide.cpp",
2066 "tools/viewer/SampleSlide.cpp",
Florin Malita76a076b2018-02-15 18:40:48 -05002067 "tools/viewer/SlideDir.cpp",
Brian Osman56a24812017-12-19 11:15:16 -05002068 "tools/viewer/StatsLayer.cpp",
Florin Malitac659c2c2018-04-05 11:57:21 -04002069 "tools/viewer/SvgSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002070 "tools/viewer/Viewer.cpp",
2071 ]
2072 libs = []
2073
2074 include_dirs = []
2075 deps = [
Florin Malitabcd07232018-01-31 11:08:58 -05002076 ":experimental_sksg",
Florin Malitac659c2c2018-04-05 11:57:21 -04002077 ":experimental_svg_model",
Brian Osmaneff04b52017-11-21 13:18:02 -05002078 ":flags",
2079 ":gm",
2080 ":gpu_tool_utils",
2081 ":samples",
2082 ":sk_app",
2083 ":skia",
2084 ":tool_utils",
2085 ":views",
2086 "//third_party/imgui",
2087 "//third_party/jsoncpp",
2088 ]
Florin Malita87ccf332018-05-04 12:23:24 -04002089
2090 if (skia_enable_skottie) {
2091 sources += [ "tools/viewer/SkottieSlide.cpp" ]
2092 deps += [ ":experimental_skottie" ]
2093 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002094 }
2095 }
2096
2097 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
2098 test_app("HelloWorld") {
2099 sources = [
2100 "example/HelloWorld.cpp",
2101 ]
2102 libs = []
2103
2104 include_dirs = []
2105 deps = [
2106 ":flags",
2107 ":gpu_tool_utils",
2108 ":sk_app",
2109 ":skia",
2110 ":tool_utils",
2111 ":views",
2112 ]
2113 }
2114 }
2115
Jim Van Verthecfed2b2017-08-30 14:02:50 -04002116 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002117 test_app("SkiaSDLExample") {
2118 sources = [
2119 "example/SkiaSDLExample.cpp",
2120 ]
2121 libs = []
2122 include_dirs = []
2123 deps = [
2124 ":gpu_tool_utils",
2125 ":skia",
2126 "//third_party/libsdl",
2127 ]
2128 }
2129 }
2130
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002131 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2132 action_foreach("generate_mocs") {
2133 script = "gn/call.py"
2134 sources = [
2135 "tools/mdbviz/MainWindow.h",
2136 ]
2137 outputs = [
2138 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2139 ]
2140 args = [
2141 "$skia_qt_path" + "/bin/moc",
2142 "{{source}}",
2143 "-o",
2144 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2145 ]
2146 }
2147 action_foreach("generate_resources") {
2148 script = "gn/call.py"
2149 sources = [
2150 "tools/mdbviz/resources.qrc",
2151 ]
2152 outputs = [
2153 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2154 ]
2155 args = [
2156 "$skia_qt_path" + "/bin/rcc",
2157 "{{source}}",
2158 "-o",
2159 "gen/mdbviz/{{source_name_part}}_res.cpp",
2160 ]
2161 }
2162 test_app("mdbviz") {
2163 if (is_win) {
2164 # on Windows we need to disable some exception handling warnings due to the Qt headers
2165 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2166 }
2167 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002168 "tools/UrlDataManager.cpp",
2169 "tools/debugger/SkDebugCanvas.cpp",
2170 "tools/debugger/SkDrawCommand.cpp",
2171 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002172 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002173 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002174 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002175 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002176
2177 # generated files
2178 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2179 "$target_gen_dir/mdbviz/resources_res.cpp",
2180 ]
2181 lib_dirs = [ "$skia_qt_path/lib" ]
2182 libs = [
2183 "Qt5Core.lib",
2184 "Qt5Gui.lib",
2185 "Qt5Widgets.lib",
2186 ]
2187 include_dirs = [
2188 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002189 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002190 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002191 "tools",
2192 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002193 ]
2194 deps = [
2195 ":generate_mocs",
2196 ":generate_resources",
2197 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002198 "//third_party/jsoncpp",
2199 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002200 ]
2201 }
2202 }
2203
Mike Kleine459afd2017-03-03 09:21:30 -05002204 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002205 copy("gdbserver") {
2206 sources = [
2207 "$ndk/$ndk_gdbserver",
2208 ]
2209 outputs = [
2210 "$root_out_dir/gdbserver",
2211 ]
2212 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002213 }
mtklein25c81d42016-07-27 13:55:26 -07002214}