blob: 1ebd6e6d731ef2951b0c57732c45fe5c0e033aa5 [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
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040042 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050043 skia_enable_tools = is_skia_dev_build
44 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Danielafb7ec72017-12-07 12:48:30 -050045 skia_vulkan_header = ""
Greg Daniel686bb212016-10-27 10:48:48 -040046 skia_vulkan_sdk = getenv("VULKAN_SDK")
Robert Phillipsa6d2d702017-09-01 12:17:03 -040047 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040048 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070049 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070050 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040051
Hal Canary4689b542018-01-31 11:54:14 -050052 skia_skqp_enable_driver_correctness_workarounds = false
Hal Canary2331c822018-02-01 14:06:13 -050053 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040054
55 skia_llvm_path = ""
56 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040057
58 skia_tools_require_resources = false
mtkleinc04ff472016-06-23 10:29:30 -070059}
Brian Salomon23d73ea2016-10-27 13:31:37 -040060declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040061 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040062 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050063 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Mike Klein10d665d2016-11-01 11:46:10 -040064
Brian Salomon5f33a8c2018-02-26 14:32:39 -050065 skia_use_legacy_gpu_pixel_ops = is_skia_dev_build && is_win # Arbitrary to keep old code path tested until deletion.
66
Mike Klein4d598a32016-10-31 13:44:49 -040067 if (is_android) {
68 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070069 } else if (is_fuchsia) {
70 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040071 } else {
72 skia_use_vulkan = skia_vulkan_sdk != ""
73 }
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}
Greg Danielec6ae522017-04-25 13:38:26 -040080declare_args() {
Greg Danielafb7ec72017-12-07 12:48:30 -050081 skia_tools_vulkan_header_dir = ""
Greg Danielec6ae522017-04-25 13:38:26 -040082 if (skia_use_vulkan) {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000083 # When buliding on Android we get the header via the NDK so no need for any extra path.
Greg Danielec6ae522017-04-25 13:38:26 -040084 if (is_fuchsia) {
Greg Danielafb7ec72017-12-07 12:48:30 -050085 skia_tools_vulkan_header_dir = "$fuchsia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040086 } else if (is_linux || is_win) {
Greg Danielafb7ec72017-12-07 12:48:30 -050087 skia_tools_vulkan_header_dir = "$skia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040088 }
Greg Danielec6ae522017-04-25 13:38:26 -040089 }
90}
Brian Salomon789e25e2016-09-30 13:41:03 -040091
Adam Barth54ef74a2017-10-13 10:59:38 -070092if (defined(skia_settings)) {
93 import(skia_settings)
94}
95
mtklein38925aa2016-09-21 10:11:25 -070096# Our tools require static linking (they use non-exported symbols).
97skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070098
mtkleina45be612016-08-29 15:22:10 -070099fontmgr_android_enabled = skia_use_expat && skia_use_freetype
100
mtklein1211e0c2016-07-26 13:55:45 -0700101skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -0700102 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -0700103 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -0700104 "include/codec",
105 "include/config",
106 "include/core",
107 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -0400108 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -0700109 "include/gpu",
110 "include/gpu/gl",
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500111 "include/atlastext",
mtklein1211e0c2016-07-26 13:55:45 -0700112 "include/pathops",
113 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -0700114 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700115 "include/utils",
116 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700117]
118
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000119if (skia_use_vulkan) {
120 skia_public_includes += [ "include/gpu/vk" ]
121}
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500122if (skia_enable_atlas_text) {
123 skia_public_includes += [ "include/atlastext" ]
124}
Greg Daniele5ddff52017-07-05 16:49:36 -0400125if (skia_use_metal) {
126 skia_public_includes += [ "include/gpu/mtl" ]
127}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000128
mtkleinc04ff472016-06-23 10:29:30 -0700129# Skia public API, generally provided by :skia.
130config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700131 include_dirs = skia_public_includes
Greg Danielafb7ec72017-12-07 12:48:30 -0500132 if (skia_tools_vulkan_header_dir != "") {
133 include_dirs += [ skia_tools_vulkan_header_dir ]
Greg Danielec6ae522017-04-25 13:38:26 -0400134 }
Mike Kleinae7e6712016-10-11 17:49:33 -0400135 defines = []
136 if (is_component_build) {
137 defines += [ "SKIA_DLL" ]
138 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400139 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700140 defines += [ "SK_SAMPLES_FOR_X" ]
141 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400142 if (skia_enable_flutter_defines) {
143 defines += flutter_defines
144 }
mtklein06c35c02016-09-20 12:28:12 -0700145 if (!skia_enable_gpu) {
146 defines += [ "SK_SUPPORT_GPU=0" ]
147 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500148 if (skia_enable_atlas_text) {
149 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
150 }
mtkleinc04ff472016-06-23 10:29:30 -0700151}
152
153# Skia internal APIs, used by Skia itself and a few test tools.
154config("skia_private") {
155 visibility = [ ":*" ]
156
157 include_dirs = [
158 "include/private",
159 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700160 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700161 "src/core",
162 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700163 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700164 "src/image",
165 "src/images",
166 "src/lazy",
167 "src/opts",
168 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700169 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700170 "src/ports",
171 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400172 "src/shaders",
173 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700174 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700175 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700176 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500177 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700178 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700179 ]
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400180 if (skia_llvm_path != "") {
181 include_dirs += [ "$skia_llvm_path/include" ]
182 }
mtklein150d1132016-08-01 06:56:40 -0700183
Mike Reeda9e241d2017-05-03 10:52:00 -0400184 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700185 if (is_android) {
186 defines += [
187 "SK_GAMMA_EXPONENT=1.4",
188 "SK_GAMMA_CONTRAST=0.0",
189 ]
190 }
mtklein88a7ac02016-09-14 11:16:49 -0700191 if (is_official_build || is_android) {
192 # TODO(bsalomon): it'd be nice to make Android normal.
193 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
194 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400195 libs = []
196 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500197 if (skia_enable_gpu) {
198 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500199 if (is_skia_dev_build && skia_use_vulkan) {
200 include_dirs += [ "tools/gpu/vk" ]
201 }
Brian Salomon03e05842017-02-23 12:23:47 -0500202 }
Brian Osman34755e22016-12-05 09:46:02 -0500203 if (skia_use_angle) {
204 defines += [ "SK_ANGLE" ]
205 }
Brian Osman3f375d02016-12-28 11:19:22 -0500206 if (skia_enable_discrete_gpu) {
207 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
208 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400209 if (!is_official_build) {
210 defines += [ "GR_TEST_UTILS=1" ]
211 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400212 if (skia_llvm_path != "") {
213 defines += [ "SK_LLVM_AVAILABLE" ]
214 include_dirs += [ "$skia_llvm_path/include" ]
215 libs += [ skia_llvm_lib ]
216 lib_dirs += [ "$skia_llvm_path/lib/" ]
217 }
mtkleinc04ff472016-06-23 10:29:30 -0700218}
219
220# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
221config("skia_library") {
222 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700223 defines = [ "SKIA_IMPLEMENTATION=1" ]
224}
225
226skia_library_configs = [
227 ":skia_public",
228 ":skia_private",
229 ":skia_library",
230]
231
mtklein9b8583d2016-08-24 17:32:30 -0700232# Use for CPU-specific Skia code that needs particular compiler flags.
233template("opts") {
234 if (invoker.enabled) {
235 source_set(target_name) {
236 forward_variables_from(invoker, "*")
237 configs += skia_library_configs
238 }
239 } else {
240 # If not enabled, a phony empty target that swallows all otherwise unused variables.
241 source_set(target_name) {
242 forward_variables_from(invoker,
243 "*",
244 [
245 "sources",
246 "cflags",
247 ])
248 }
249 }
anmittala7eaf2e2016-08-17 13:57:26 -0700250}
251
mtklein422310d2016-08-16 18:28:43 -0700252is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700253
mtklein7d6fb2c2016-08-25 14:50:44 -0700254opts("none") {
255 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700256 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700257 cflags = []
258}
259
mtklein7d6fb2c2016-08-25 14:50:44 -0700260opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700261 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700262 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700263 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700264}
265
266opts("arm64") {
267 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700268 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700269 cflags = []
270}
271
272opts("crc32") {
273 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700274 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700275 cflags = [ "-march=armv8-a+crc" ]
276}
277
mtklein9b8583d2016-08-24 17:32:30 -0700278opts("sse2") {
279 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700280 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400281 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400282 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
283 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400284 cflags = [ "-msse2" ]
285 }
mtklein9b8583d2016-08-24 17:32:30 -0700286}
mtkleinc04ff472016-06-23 10:29:30 -0700287
mtklein9b8583d2016-08-24 17:32:30 -0700288opts("ssse3") {
289 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700290 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400291 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400292 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
293 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400294 cflags = [ "-mssse3" ]
295 }
mtklein9b8583d2016-08-24 17:32:30 -0700296}
mtkleinc04ff472016-06-23 10:29:30 -0700297
mtklein9b8583d2016-08-24 17:32:30 -0700298opts("sse41") {
299 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700300 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400301 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400302 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
303 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400304 cflags = [ "-msse4.1" ]
305 }
mtklein9b8583d2016-08-24 17:32:30 -0700306}
mtklein4e976072016-08-08 09:06:27 -0700307
mtklein9b8583d2016-08-24 17:32:30 -0700308opts("sse42") {
309 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700310 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400311 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400312 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
313 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400314 cflags = [ "-msse4.2" ]
315 }
mtklein9b8583d2016-08-24 17:32:30 -0700316}
317
318opts("avx") {
319 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700320 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400321 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000322 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400323 } else {
324 cflags = [ "-mavx" ]
325 }
mtkleinc04ff472016-06-23 10:29:30 -0700326}
327
Mike Klein1b9b7d52018-02-27 10:37:40 -0500328opts("hsw") {
329 enabled = is_x86
330 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400331 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500332 cflags = [ "/arch:AVX2" ]
333 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000334 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500335 }
336
337 # Oddly, clang-cl doesn't recognize this as a valid flag.
338 # If it ever does, it'd nice to move this up with -mavx2 and co.
339 if (is_clang && !is_win) {
340 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
341 # but nice to have, generating slightly better code for paths without explicit FMAs.
342 cflags += [ "-ffp-contract=fast" ]
343 }
344}
345
mtkleinc095df52016-08-24 12:23:52 -0700346# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700347template("optional") {
348 if (invoker.enabled) {
349 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700350 if (defined(invoker.public_defines)) {
351 defines = invoker.public_defines
352 }
mtklein457b42a2016-08-23 13:56:37 -0700353 }
354 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700355 forward_variables_from(invoker,
356 "*",
357 [
358 "public_defines",
359 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700360 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700361 ])
mtklein457b42a2016-08-23 13:56:37 -0700362 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700363 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700364 if (defined(invoker.configs_to_remove)) {
365 configs -= invoker.configs_to_remove
366 }
mtklein457b42a2016-08-23 13:56:37 -0700367 }
368 } else {
mtklein457b42a2016-08-23 13:56:37 -0700369 source_set(target_name) {
370 forward_variables_from(invoker,
371 "*",
372 [
373 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700374 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700375 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700376 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700377 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700378 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700379 ])
mtkleincd01b032016-08-31 04:58:19 -0700380 if (defined(invoker.sources_when_disabled)) {
381 sources = invoker.sources_when_disabled
382 }
383 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700384 }
mtkleineb3c4252016-08-23 07:38:09 -0700385 }
mtklein457b42a2016-08-23 13:56:37 -0700386}
mtklein457b42a2016-08-23 13:56:37 -0700387
Mike Kleina04bb452017-02-09 12:24:07 -0500388optional("effects") {
389 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400390 deps = [
391 ":compile_processors",
392 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500393 sources =
394 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
395 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
396}
397
mtkleina45be612016-08-29 15:22:10 -0700398optional("fontmgr_android") {
399 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700400
401 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500402 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700403 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700404 ]
405 sources = [
406 "src/ports/SkFontMgr_android.cpp",
407 "src/ports/SkFontMgr_android_factory.cpp",
408 "src/ports/SkFontMgr_android_parser.cpp",
409 ]
410}
411
mtkleind2e39db2016-09-07 07:52:55 -0700412optional("fontmgr_custom") {
413 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
414
415 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500416 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700417 ]
418 sources = [
419 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500420 "src/ports/SkFontMgr_custom.h",
421 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700422 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500423 "src/ports/SkFontMgr_custom_embedded.cpp",
424 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700425 ]
426}
427
Hal Canaryff2742e2018-01-30 11:35:47 -0500428optional("fontmgr_empty") {
429 enabled = skia_enable_fontmgr_empty
430 sources = [
431 "src/ports/SkFontMgr_empty_factory.cpp",
432 ]
433}
434
mtklein3cc22182016-08-29 13:26:14 -0700435optional("fontmgr_fontconfig") {
436 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700437
438 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500439 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700440 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700441 ]
442 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700443 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700444 "src/ports/SkFontConfigInterface_direct.cpp",
445 "src/ports/SkFontConfigInterface_direct_factory.cpp",
446 "src/ports/SkFontMgr_FontConfigInterface.cpp",
447 "src/ports/SkFontMgr_fontconfig.cpp",
448 "src/ports/SkFontMgr_fontconfig_factory.cpp",
449 ]
450}
451
mtkleincdedd0e2016-09-12 15:15:44 -0700452optional("fontmgr_fuchsia") {
453 enabled = is_fuchsia && skia_use_freetype
454
455 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500456 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700457 ]
458 sources = [
459 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500460 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700461 "src/ports/SkFontMgr_custom_empty_factory.cpp",
462 ]
463}
464
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700465if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400466 executable("sksllex") {
467 sources = [
468 "src/sksl/lex/Main.cpp",
469 "src/sksl/lex/NFA.cpp",
470 "src/sksl/lex/RegexNode.cpp",
471 "src/sksl/lex/RegexParser.cpp",
472 ]
473 include_dirs = [ "src/sksl/lex" ]
474 }
475
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700476 action("run_sksllex") {
477 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400478 deps = [
479 ":sksllex(//gn/toolchain:$host_toolchain)",
480 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700481 sources = [
482 "src/sksl/lex/layout.lex",
483 "src/sksl/lex/sksl.lex",
484 ]
485
486 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
487 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
488 outputs = [
489 "$target_out_dir/" +
490 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
491 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
492 # confused due to the same file being named by two different paths
493 ]
494 sksllex_path = "$root_out_dir/"
495 sksllex_path += "sksllex"
496 if (host_os == "win") {
497 sksllex_path += ".exe"
498 }
499 args = [
500 rebase_path(sksllex_path),
501 rebase_path("bin/clang-format"),
502 rebase_path("src"),
503 ]
504 }
505} else {
506 group("run_sksllex") {
507 }
508}
509
510if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400511 executable("skslc") {
512 defines = [ "SKSL_STANDALONE" ]
513 sources = [
514 "src/sksl/SkSLMain.cpp",
515 ]
516 sources += skia_sksl_sources
517 include_dirs = [
518 "src/gpu",
519 "src/sksl",
520 ]
521 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500522 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400523 "//third_party/spirv-tools",
524 ]
525 }
526
527 skia_gpu_processor_outputs = []
528 foreach(src, skia_gpu_processor_sources) {
529 dir = get_path_info(src, "dir")
530 name = get_path_info(src, "name")
531
532 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
533 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
534 skia_gpu_processor_outputs += [
535 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
536 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
537 # confused due to the same file being named by two different paths
538 ]
539 }
540
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500541 action("create_sksl_enums") {
542 script = "gn/create_sksl_enums.py"
543 sources = [
544 "include/private/GrSharedEnums.h",
545 ]
546 outputs = [
547 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500548 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500549 ]
550 args = [
551 rebase_path(sources[0]),
552 rebase_path(outputs[0]),
553 ]
554 }
555
Ethan Nicholas762466e2017-06-29 10:03:38 -0400556 action("compile_processors") {
557 script = "gn/compile_processors.py"
558 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500559 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400560 ":skslc(//gn/toolchain:$host_toolchain)",
561 ]
562 sources = skia_gpu_processor_sources
563 outputs = skia_gpu_processor_outputs
564 skslc_path = "$root_out_dir/"
565 if (host_toolchain != default_toolchain_name) {
566 skslc_path += "$host_toolchain/"
567 }
568 skslc_path += "skslc"
569 if (host_os == "win") {
570 skslc_path += ".exe"
571 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400572 args = [
573 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400574 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400575 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400576 args += rebase_path(skia_gpu_processor_sources)
577 }
578} else {
579 skia_gpu_processor_outputs = []
580 group("compile_processors") {
581 }
582}
583
mtklein06c35c02016-09-20 12:28:12 -0700584optional("gpu") {
585 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400586 deps = [
587 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700588 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400589 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700590 if (skia_generate_workarounds) {
591 deps += [ ":workaround_list" ]
592 }
mtkleine9fb3d52016-09-20 15:11:46 -0700593 public_defines = []
594
Brian Salomon3d6801e2017-12-11 10:06:31 -0500595 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700596
597 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500598 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700599 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400600 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700601 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400602 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400603
604 # this lib is required to link against AHardwareBuffer
605 if (defined(ndk_api) && ndk_api >= 26) {
606 libs += [ "android" ]
607 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400608 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500609 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400610 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700611 } else if (is_linux) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500612 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500613 libs += [
614 "GL",
615 "GLU",
616 ]
mtklein06c35c02016-09-20 12:28:12 -0700617 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500618 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800619 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500620 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400621 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500622 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400623 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700624 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500625 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700626 }
mtkleine9fb3d52016-09-20 15:11:46 -0700627
628 if (skia_use_vulkan) {
629 public_defines += [ "SK_VULKAN" ]
630 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700631 if (skia_enable_vulkan_debug_layers) {
632 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
633 }
Greg Danielafb7ec72017-12-07 12:48:30 -0500634 if (skia_vulkan_header != "") {
635 public_defines += [ "SK_VULKAN_HEADER=\"$skia_vulkan_header\"" ]
636 } else {
637 if (is_skia_dev_build) {
638 public_defines += [ "SK_VULKAN_HEADER=\"GrVulkanDefines.h\"" ]
639 }
640 }
mtkleine9fb3d52016-09-20 15:11:46 -0700641 }
Brian Salomon5f33a8c2018-02-26 14:32:39 -0500642 if (skia_use_legacy_gpu_pixel_ops) {
643 public_defines += [ "SK_LEGACY_GPU_PIXEL_OPS" ]
644 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400645 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400646 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400647 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
648 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400649
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400650 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400651 if (skia_use_metal) {
652 public_defines += [ "SK_METAL" ]
653 sources += skia_metal_sources
654 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400655 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400656 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500657
658 if (skia_enable_atlas_text) {
659 sources += skia_atlas_text_sources
660 }
mtklein06c35c02016-09-20 12:28:12 -0700661}
662
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400663optional("heif") {
664 enabled = skia_use_libheif
665 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
666
667 deps = []
668
669 sources = [
670 "src/codec/SkHeifCodec.cpp",
671 ]
672}
673
mtklein63213812016-08-24 09:55:56 -0700674optional("jpeg") {
675 enabled = skia_use_libjpeg_turbo
676 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
677
mtklein63213812016-08-24 09:55:56 -0700678 deps = [
679 "//third_party/libjpeg-turbo:libjpeg",
680 ]
681 sources = [
682 "src/codec/SkJpegCodec.cpp",
683 "src/codec/SkJpegDecoderMgr.cpp",
684 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700685 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400686 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700687 ]
688}
689
690optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500691 enabled = skia_use_zlib && skia_enable_pdf
692 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700693
mtklein63213812016-08-24 09:55:56 -0700694 deps = [
695 "//third_party/zlib",
696 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400697 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700698 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400699 }
brettwb9447282016-09-01 14:24:39 -0700700 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700701 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700702
703 if (skia_use_sfntly) {
704 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500705 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700706 }
707}
708
709optional("png") {
710 enabled = skia_use_libpng
711 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
712
mtklein63213812016-08-24 09:55:56 -0700713 deps = [
714 "//third_party/libpng",
715 ]
716 sources = [
717 "src/codec/SkIcoCodec.cpp",
718 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400719 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700720 ]
721}
722
scroggof84ad642016-10-31 09:02:57 -0700723optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400724 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700725 public_defines = [ "SK_CODEC_DECODES_RAW" ]
726
727 deps = [
728 "//third_party/dng_sdk",
729 "//third_party/libjpeg-turbo:libjpeg",
730 "//third_party/piex",
731 ]
732
733 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
734 # Skia.
735 configs_to_remove = [ "//gn:no_exceptions" ]
736
737 sources = [
738 "src/codec/SkRawAdapterCodec.cpp",
739 "src/codec/SkRawCodec.cpp",
740 ]
741}
742
Mike Kleinfb333552018-01-25 12:49:37 -0500743optional("skcms") {
744 enabled = skia_use_skcms
745
Brian Osman094fba92018-03-26 17:05:48 -0400746 public_defines = [ "SK_USE_SKCMS" ]
Mike Kleinfb333552018-01-25 12:49:37 -0500747 deps = [
Brian Osman1b4faa72018-04-23 13:06:36 -0400748 "third_party/skcms",
Mike Kleinfb333552018-01-25 12:49:37 -0500749 ]
750 sources = [
Brian Osman094fba92018-03-26 17:05:48 -0400751 "src/core/SkColorSpaceXform_skcms.cpp",
Mike Kleinfb333552018-01-25 12:49:37 -0500752 ]
753}
754
mtklein3cc22182016-08-29 13:26:14 -0700755optional("typeface_freetype") {
756 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700757
758 deps = [
759 "//third_party/freetype2",
760 ]
761 sources = [
762 "src/ports/SkFontHost_FreeType.cpp",
763 "src/ports/SkFontHost_FreeType_common.cpp",
764 ]
765}
766
mtklein457b42a2016-08-23 13:56:37 -0700767optional("webp") {
768 enabled = skia_use_libwebp
769 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
770
mtklein457b42a2016-08-23 13:56:37 -0700771 deps = [
772 "//third_party/libwebp",
773 ]
774 sources = [
775 "src/codec/SkWebpAdapterCodec.cpp",
776 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400777 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700778 ]
mtkleineb3c4252016-08-23 07:38:09 -0700779}
780
mtklein63213812016-08-24 09:55:56 -0700781optional("xml") {
782 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000783 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700784
mtklein63213812016-08-24 09:55:56 -0700785 deps = [
786 "//third_party/expat",
787 ]
788 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500789 "src/svg/SkSVGCanvas.cpp",
790 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700791 "src/xml/SkDOM.cpp",
792 "src/xml/SkXMLParser.cpp",
793 "src/xml/SkXMLWriter.cpp",
794 ]
795}
796
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700797if (skia_enable_gpu && skia_generate_workarounds) {
798 action("workaround_list") {
799 script = "tools/build_workaround_header.py"
800
801 inputs = [
802 "src/gpu/gpu_workaround_list.txt",
803 ]
804
805 # see comments in skia_compile_processors about out dir path shenanigans.
806 output_file =
807 rebase_path("src/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
808
809 outputs = [
810 "$root_out_dir/$output_file",
811 ]
812 args = [
813 "--output-file",
814 "$output_file",
815 ]
816
817 foreach(file, inputs) {
818 args += [ rebase_path(file, root_build_dir) ]
819 }
820 }
821}
822
mtkleinc04ff472016-06-23 10:29:30 -0700823component("skia") {
824 public_configs = [ ":skia_public" ]
825 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700826
827 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700828 ":arm64",
829 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700830 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700831 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500832 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700833 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700834 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500835 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700836 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700837 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700838 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400839 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500840 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700841 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700842 ":none",
mtklein63213812016-08-24 09:55:56 -0700843 ":pdf",
844 ":png",
scroggof84ad642016-10-31 09:02:57 -0700845 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500846 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700847 ":sse2",
848 ":sse41",
849 ":sse42",
850 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700851 ":webp",
mtklein63213812016-08-24 09:55:56 -0700852 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700853 ]
854
Chinmay Garde43f115c2016-11-16 15:04:12 -0800855 # This file (and all GN files in Skia) are designed to work with an
856 # empty sources assignment filter; we handle all that explicitly.
857 # We clear the filter here for clients who may have set up a global filter.
858 set_sources_assignment_filter([])
859
mtkleinc04ff472016-06-23 10:29:30 -0700860 sources = []
brettwb9447282016-09-01 14:24:39 -0700861 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700862 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500863 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700864 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400865 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500866 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700867 "src/android/SkBitmapRegionCodec.cpp",
868 "src/android/SkBitmapRegionDecoder.cpp",
869 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400870 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700871 "src/codec/SkBmpCodec.cpp",
872 "src/codec/SkBmpMaskCodec.cpp",
873 "src/codec/SkBmpRLECodec.cpp",
874 "src/codec/SkBmpStandardCodec.cpp",
875 "src/codec/SkCodec.cpp",
876 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700877 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700878 "src/codec/SkMaskSwizzler.cpp",
879 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700880 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700881 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700882 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700883 "src/codec/SkSwizzler.cpp",
884 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700885 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700886 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700887 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700888 "src/ports/SkMemory_malloc.cpp",
889 "src/ports/SkOSFile_stdio.cpp",
890 "src/sfnt/SkOTTable_name.cpp",
891 "src/sfnt/SkOTUtils.cpp",
892 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700893 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700894 ]
brettwb9447282016-09-01 14:24:39 -0700895
mtklein7d6fb2c2016-08-25 14:50:44 -0700896 libs = []
897
mtkleinc04ff472016-06-23 10:29:30 -0700898 if (is_win) {
899 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400900 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700901 "src/ports/SkDebug_win.cpp",
902 "src/ports/SkFontHost_win.cpp",
903 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500904 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700905 "src/ports/SkImageEncoder_WIC.cpp",
906 "src/ports/SkImageGeneratorWIC.cpp",
907 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700908 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700909 "src/ports/SkScalerContext_win_dw.cpp",
910 "src/ports/SkTLS_win.cpp",
911 "src/ports/SkTypeface_win_dw.cpp",
912 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400913 libs += [
914 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500915 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400916 "Ole32.lib",
917 "OleAut32.lib",
918 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500919 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400920 ]
mtkleinc04ff472016-06-23 10:29:30 -0700921 } else {
922 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700923 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700924 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700925 "src/ports/SkTLS_pthread.cpp",
926 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400927 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700928 }
929
mtklein7d6fb2c2016-08-25 14:50:44 -0700930 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500931 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500932 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500933 deps += [ "//third_party/cpu-features" ]
934 }
mtklein06c35c02016-09-20 12:28:12 -0700935 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700936 libs += [
937 "EGL",
938 "GLESv2",
939 "log",
940 ]
941 }
942
mtkleinc04ff472016-06-23 10:29:30 -0700943 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700944 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400945 if (skia_use_egl) {
946 libs += [ "GLESv2" ]
947 }
mtkleinc04ff472016-06-23 10:29:30 -0700948 }
949
950 if (is_mac) {
951 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700952 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700953 "src/ports/SkFontHost_mac.cpp",
954 "src/ports/SkImageEncoder_CG.cpp",
955 "src/ports/SkImageGeneratorCG.cpp",
956 ]
mtklein09e61f72016-08-23 13:35:28 -0700957 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400958 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
959 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700960 "ApplicationServices.framework",
961 "OpenGL.framework",
962 ]
mtkleinc04ff472016-06-23 10:29:30 -0700963 }
abarth6fc8ff02016-07-15 15:15:15 -0700964
Mike Klein7d302882016-11-03 14:06:31 -0400965 if (is_ios) {
966 sources += [
967 "src/ports/SkDebug_stdio.cpp",
968 "src/ports/SkFontHost_mac.cpp",
969 "src/ports/SkImageEncoder_CG.cpp",
970 "src/ports/SkImageGeneratorCG.cpp",
971 ]
972 libs += [
973 "CoreFoundation.framework",
974 "CoreGraphics.framework",
975 "CoreText.framework",
976 "ImageIO.framework",
977 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400978
979 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
980 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400981 ]
982 }
983
abarth6fc8ff02016-07-15 15:15:15 -0700984 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700985 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700986 }
mtkleinc04ff472016-06-23 10:29:30 -0700987}
988
mtkleinc095df52016-08-24 12:23:52 -0700989# Targets guarded by skia_enable_tools may use //third_party freely.
990if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -0500991 # Used by gn_to_bp.py to list our public include dirs.
992 source_set("public") {
993 configs += [ ":skia_public" ]
994 }
995
Mike Kleinc36dedf2016-11-18 09:35:28 -0500996 config("skia.h_config") {
997 include_dirs = [ "$target_gen_dir" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500998 if (skia_use_vulkan) {
999 # So we can get the header which includes vulkan
1000 include_dirs += [ "tools/gpu/vk" ]
1001 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001002 }
1003 action("skia.h") {
1004 public_configs = [ ":skia.h_config" ]
1005 skia_h = "$target_gen_dir/skia.h"
1006 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -04001007 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +00001008 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001009 depfile = "$skia_h.deps"
1010 outputs = [
1011 skia_h,
1012 ]
1013 }
1014
1015 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001016 executable("fiddle") {
1017 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001018 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001019 "tools/fiddle/draw.cpp",
1020 "tools/fiddle/fiddle_main.cpp",
1021 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001022
1023 if (skia_use_egl) {
1024 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001025 } else {
1026 sources += [ "tools/fiddle/null_context.cpp" ]
1027 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001028 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001029 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001030 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001031 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001032 ":skia",
1033 ":skia.h",
1034 ]
1035 }
1036 }
1037
1038 if (skia_enable_gpu) {
1039 source_set("public_headers_warnings_check") {
1040 sources = [
1041 "tools/public_headers_warnings_check.cpp",
1042 ]
1043 configs -= [ "//gn:warnings_except_public_headers" ]
1044 deps = [
1045 ":skia",
1046 ":skia.h",
1047 ]
1048 }
1049 }
1050
mtkleinc095df52016-08-24 12:23:52 -07001051 template("test_lib") {
1052 config(target_name + "_config") {
1053 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001054 if (defined(invoker.public_defines)) {
1055 defines = invoker.public_defines
1056 }
mtklein25c81d42016-07-27 13:55:26 -07001057 }
mtkleinc095df52016-08-24 12:23:52 -07001058 source_set(target_name) {
1059 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1060 public_configs = [
1061 ":" + target_name + "_config",
1062 ":skia_private",
1063 ]
1064
1065 if (!defined(deps)) {
1066 deps = []
1067 }
1068 deps += [ ":skia" ]
1069 testonly = true
1070 }
mtklein25c81d42016-07-27 13:55:26 -07001071 }
mtklein25c81d42016-07-27 13:55:26 -07001072
Mike Kleine6682eb2017-01-05 10:54:57 -05001073 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001074 if (is_ios) {
1075 app_name = target_name
1076 gen_path = target_gen_dir
1077
1078 action("${app_name}_generate_info_plist") {
1079 script = "//gn/gen_plist_ios.py"
1080 outputs = [
1081 "$gen_path/${app_name}_Info.plist",
1082 ]
1083 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1084 }
1085
1086 bundle_data("${app_name}_bundle_info_plist") {
1087 public_deps = [
1088 ":${app_name}_generate_info_plist",
1089 ]
1090 sources = [
1091 "$gen_path/${app_name}_Info.plist",
1092 ]
1093 outputs = [
1094 "{{bundle_root_dir}}/Info.plist",
1095 ]
1096 }
1097
Jim Van Verth329c5a62017-11-29 11:42:33 -05001098 bundle_ios_data =
1099 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1100
1101 if (bundle_ios_data) {
1102 has_skps =
1103 "True" == exec_script("//gn/checkdir.py",
1104 [ rebase_path("skps", root_build_dir) ],
1105 "trim string")
1106 bundle_data("${app_name}_bundle_resources") {
1107 sources = [
1108 "resources",
1109 ]
1110 outputs = [
1111 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1112 "{{bundle_resources_dir}}/data/resources",
1113 ]
1114 }
1115
1116 if (has_skps) {
1117 bundle_data("${app_name}_bundle_skps") {
1118 sources = [
1119 "skps",
1120 ]
1121 outputs = [
1122 # Store in same folder as resources
1123 "{{bundle_resources_dir}}/data/skps",
1124 ]
1125 }
1126 }
1127 }
1128
Jim Van Verth443a9132017-11-28 09:45:26 -05001129 executable("${app_name}_generate_executable") {
1130 forward_variables_from(invoker,
1131 "*",
1132 [
1133 "output_name",
1134 "visibility",
1135 "is_shared_library",
1136 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001137 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001138 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001139 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1140 }
1141
1142 bundle_data("${app_name}_bundle_executable") {
1143 public_deps = [
1144 ":${app_name}_generate_executable",
1145 ]
1146 sources = [
1147 "$gen_path/$app_name",
1148 ]
1149 outputs = [
1150 "{{bundle_executable_dir}}/$app_name",
1151 ]
1152 testonly = true
1153 }
1154
1155 create_bundle("$app_name") {
1156 product_type = "com.apple.product-type.application"
1157 testonly = true
1158
1159 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1160 bundle_resources_dir = bundle_root_dir
1161 bundle_executable_dir = bundle_root_dir
1162 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1163
1164 deps = [
1165 ":${app_name}_bundle_executable",
1166 ":${app_name}_bundle_info_plist",
1167 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001168 if (bundle_ios_data) {
1169 deps += [ ":${app_name}_bundle_resources" ]
1170 if (has_skps) {
1171 deps += [ ":${app_name}_bundle_skps" ]
1172 }
1173 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001174
1175 # should only code sign when running on a device, not the simulator
1176 if (target_cpu != "x64") {
1177 code_signing_script = "//gn/codesign_ios.py"
1178 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1179 code_signing_outputs = [
1180 "$bundle_root_dir/_CodeSignature/CodeResources",
1181 "$bundle_root_dir/embedded.mobileprovision",
1182 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001183 code_signing_args = [
1184 rebase_path("$bundle_root_dir", root_build_dir),
1185 skia_ios_identity,
1186 skia_ios_profile,
1187 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001188 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001189 }
1190 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001191 # !is_ios
1192
1193 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1194 shared_library("lib" + target_name) {
1195 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1196 configs += [ ":skia_private" ]
1197 testonly = true
1198 }
1199 } else {
1200 _executable = target_name
1201 executable(_executable) {
1202 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1203 configs += [ ":skia_private" ]
1204 testonly = true
1205 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001206 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001207 if (is_android && skia_android_serial != "" && defined(_executable)) {
1208 action("push_" + target_name) {
1209 script = "gn/push_to_android.py"
1210 deps = [
1211 ":" + _executable,
1212 ]
1213 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1214 outputs = [
1215 _stamp,
1216 ]
1217 args = [
1218 rebase_path("$root_build_dir/$_executable"),
1219 skia_android_serial,
1220 rebase_path(_stamp),
1221 ]
1222 testonly = true
1223 }
Mike Klein7d921032017-01-05 12:20:41 -05001224 }
1225 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001226 }
1227
mtkleinc095df52016-08-24 12:23:52 -07001228 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001229 public_include_dirs = []
1230 if (skia_enable_gpu) {
1231 public_defines = []
1232 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001233
1234 deps = []
mtklein38925aa2016-09-21 10:11:25 -07001235 sources = [
1236 "tools/gpu/GrContextFactory.cpp",
1237 "tools/gpu/GrTest.cpp",
Brian Salomon58389b92018-03-07 13:01:25 -05001238 "tools/gpu/ProxyUtils.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001239 "tools/gpu/TestContext.cpp",
Brian Salomoncbcb0a12017-11-19 13:20:13 -05001240 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001241 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001242 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001243 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1244 "tools/gpu/gl/debug/GrBufferObj.cpp",
1245 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1246 "tools/gpu/gl/debug/GrProgramObj.cpp",
1247 "tools/gpu/gl/debug/GrShaderObj.cpp",
1248 "tools/gpu/gl/debug/GrTextureObj.cpp",
1249 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1250 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001251 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001252 ]
1253 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001254
Kevin Lubick4a24e102017-03-29 11:19:01 -04001255 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001256 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001257 } else if (is_ios) {
1258 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1259 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001260 } else if (is_linux) {
1261 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001262 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001263 } else if (is_mac) {
1264 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001265 } else if (is_win) {
1266 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1267 libs += [
1268 "Gdi32.lib",
1269 "OpenGL32.lib",
1270 ]
mtklein38925aa2016-09-21 10:11:25 -07001271 }
mtklein6ef69992016-09-14 06:12:09 -07001272
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001273 cflags_objcc = [ "-fobjc-arc" ]
1274
Mike Kleinc168a3a2016-11-14 14:53:13 +00001275 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001276 deps += [ "//third_party/angle2" ]
1277 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1278 }
mtkleind68f9b02016-09-23 13:18:41 -07001279 if (skia_use_vulkan) {
1280 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001281 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001282 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001283 if (skia_use_metal) {
1284 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1285 }
mtkleina627b5c2016-09-20 13:36:47 -07001286 }
mtklein25c81d42016-07-27 13:55:26 -07001287 }
mtklein25c81d42016-07-27 13:55:26 -07001288
mtkleinc095df52016-08-24 12:23:52 -07001289 test_lib("flags") {
1290 public_include_dirs = [ "tools/flags" ]
1291 sources = [
1292 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001293 ]
1294 }
1295 test_lib("common_flags") {
1296 public_include_dirs = [ "tools/flags" ]
1297 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001298 "tools/flags/SkCommonFlags.cpp",
1299 "tools/flags/SkCommonFlagsConfig.cpp",
1300 ]
1301 deps = [
mtklein046cb562016-09-16 10:23:12 -07001302 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001303 ":gpu_tool_utils",
1304 ]
1305 }
mtklein25c81d42016-07-27 13:55:26 -07001306
mtkleinc095df52016-08-24 12:23:52 -07001307 test_lib("tool_utils") {
1308 public_include_dirs = [
1309 "tools",
1310 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001311 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001312 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001313 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001314 ]
1315 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001316 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001317 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001318 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001319 "tools/ProcStats.cpp",
1320 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001321 "tools/UrlDataManager.cpp",
1322 "tools/debugger/SkDebugCanvas.cpp",
1323 "tools/debugger/SkDrawCommand.cpp",
1324 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001325 "tools/fonts/SkRandomScalerContext.cpp",
1326 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001327 "tools/fonts/SkTestFontMgr.h",
1328 "tools/fonts/SkTestSVGTypeface.cpp",
1329 "tools/fonts/SkTestSVGTypeface.h",
1330 "tools/fonts/SkTestTypeface.cpp",
1331 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001332 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001333 "tools/picture_utils.cpp",
1334 "tools/random_parse_path.cpp",
1335 "tools/sk_tool_utils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001336 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001337 "tools/trace/SkChromeTracingTracer.cpp",
1338 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001339 "tools/trace/SkDebugfTracer.cpp",
1340 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001341 "tools/trace/SkEventTracingPriv.cpp",
1342 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001343 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001344 libs = []
1345 if (is_ios) {
1346 sources += [ "tools/ios_utils.m" ]
1347 libs += [ "Foundation.framework" ]
1348 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001349 defines = []
1350 if (skia_tools_require_resources) {
1351 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1352 }
mtkleinc095df52016-08-24 12:23:52 -07001353 deps = [
mtklein046cb562016-09-16 10:23:12 -07001354 ":common_flags",
Ben Wagner97182cc2018-02-15 10:20:04 -05001355 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001356 ":flags",
1357 "//third_party/libpng",
1358 ]
1359 public_deps = [
1360 "//third_party/jsoncpp",
1361 ]
1362 }
mtklein25c81d42016-07-27 13:55:26 -07001363
Mike Klein6e744122016-10-27 12:21:40 -04001364 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001365 test_lib("gm") {
1366 public_include_dirs = [ "gm" ]
1367 sources = gm_sources
1368 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001369 ":experimental_sksg",
scroggo19b91532016-10-24 09:03:26 -07001370 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001371 ":gpu_tool_utils",
1372 ":skia",
1373 ":tool_utils",
1374 ]
1375 }
mtklein25c81d42016-07-27 13:55:26 -07001376
Mike Klein6e744122016-10-27 12:21:40 -04001377 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001378 test_lib("tests") {
1379 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001380 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001381 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001382 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001383 }
mtkleinc095df52016-08-24 12:23:52 -07001384 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001385 ":experimental_sksg",
Hal Canary0f666812018-03-22 15:21:12 -04001386 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001387 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001388 ":skia",
1389 ":tool_utils",
1390 "//third_party/libpng",
1391 "//third_party/zlib",
1392 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001393 public_deps = [
1394 ":gpu_tool_utils", # Test.h #includes headers from this target.
1395 ]
mtkleinc095df52016-08-24 12:23:52 -07001396 }
mtklein2f3416d2016-08-02 16:02:05 -07001397
Mike Klein6e744122016-10-27 12:21:40 -04001398 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001399 test_lib("bench") {
1400 public_include_dirs = [ "bench" ]
1401 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001402 deps = [
1403 ":flags",
1404 ":gm",
1405 ":gpu_tool_utils",
1406 ":skia",
1407 ":tool_utils",
1408 ]
1409 }
mtklein2b6870c2016-07-28 14:17:33 -07001410
Florin Malita54f65c42018-01-16 17:04:30 -05001411 test_lib("experimental_skottie") {
1412 public_include_dirs = [ "experimental/skottie" ]
Florin Malita094ccde2017-12-30 12:27:00 -05001413 include_dirs = [ "tools" ]
1414 sources = [
Florin Malita54f65c42018-01-16 17:04:30 -05001415 "experimental/skottie/Skottie.cpp",
Florin Malitaa6e30f72018-03-23 13:41:58 -04001416 "experimental/skottie/SkottieAdapter.cpp",
Florin Malita54f65c42018-01-16 17:04:30 -05001417 "experimental/skottie/SkottieAnimator.cpp",
Florin Malitacf8ed522018-01-25 15:27:33 -05001418 "experimental/skottie/SkottieParser.cpp",
Florin Malitaa6e30f72018-03-23 13:41:58 -04001419 "experimental/skottie/SkottieValue.cpp",
Florin Malita094ccde2017-12-30 12:27:00 -05001420 ]
1421 deps = [
1422 ":experimental_sksg",
1423 ":skia",
1424 "//third_party/jsoncpp",
1425 ]
1426 }
1427
mtkleinc095df52016-08-24 12:23:52 -07001428 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001429 public_include_dirs = []
1430 if (skia_use_expat) {
1431 public_include_dirs += [ "experimental/svg/model" ]
1432 sources = [
1433 "experimental/svg/model/SkSVGAttribute.cpp",
1434 "experimental/svg/model/SkSVGAttributeParser.cpp",
1435 "experimental/svg/model/SkSVGCircle.cpp",
1436 "experimental/svg/model/SkSVGClipPath.cpp",
1437 "experimental/svg/model/SkSVGContainer.cpp",
1438 "experimental/svg/model/SkSVGDOM.cpp",
1439 "experimental/svg/model/SkSVGEllipse.cpp",
1440 "experimental/svg/model/SkSVGGradient.cpp",
1441 "experimental/svg/model/SkSVGLine.cpp",
1442 "experimental/svg/model/SkSVGLinearGradient.cpp",
1443 "experimental/svg/model/SkSVGNode.cpp",
1444 "experimental/svg/model/SkSVGPath.cpp",
1445 "experimental/svg/model/SkSVGPattern.cpp",
1446 "experimental/svg/model/SkSVGPoly.cpp",
1447 "experimental/svg/model/SkSVGRadialGradient.cpp",
1448 "experimental/svg/model/SkSVGRect.cpp",
1449 "experimental/svg/model/SkSVGRenderContext.cpp",
1450 "experimental/svg/model/SkSVGSVG.cpp",
1451 "experimental/svg/model/SkSVGShape.cpp",
1452 "experimental/svg/model/SkSVGStop.cpp",
1453 "experimental/svg/model/SkSVGTransformableNode.cpp",
1454 "experimental/svg/model/SkSVGUse.cpp",
1455 "experimental/svg/model/SkSVGValue.cpp",
1456 ]
1457 deps = [
1458 ":skia",
1459 ":xml",
1460 ]
1461 }
mtkleinc095df52016-08-24 12:23:52 -07001462 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001463
Florin Malita4aa44412017-12-19 12:21:02 -05001464 test_lib("experimental_sksg") {
1465 public_include_dirs = [
1466 "experimental/sksg",
1467 "experimental/sksg/effects",
1468 "experimental/sksg/geometry",
1469 "experimental/sksg/paint",
1470 ]
1471 sources = [
1472 "experimental/sksg/SkSGDraw.cpp",
1473 "experimental/sksg/SkSGEffectNode.cpp",
1474 "experimental/sksg/SkSGGeometryNode.cpp",
1475 "experimental/sksg/SkSGGroup.cpp",
Florin Malita49328072018-01-08 12:51:12 -05001476 "experimental/sksg/SkSGImage.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001477 "experimental/sksg/SkSGInvalidationController.cpp",
1478 "experimental/sksg/SkSGNode.cpp",
1479 "experimental/sksg/SkSGPaintNode.cpp",
1480 "experimental/sksg/SkSGRenderNode.cpp",
Florin Malita35efaa82018-01-22 12:57:06 -05001481 "experimental/sksg/SkSGScene.cpp",
Florin Malita38ea40e2018-01-29 16:31:14 -05001482 "experimental/sksg/effects/SkSGClipEffect.cpp",
Florin Malita5f9102f2018-01-10 13:36:22 -05001483 "experimental/sksg/effects/SkSGMaskEffect.cpp",
Florin Malitac0034172018-01-08 16:42:59 -05001484 "experimental/sksg/effects/SkSGOpacityEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001485 "experimental/sksg/effects/SkSGTransform.cpp",
Florin Malita16d0ad02018-01-19 15:07:29 -05001486 "experimental/sksg/geometry/SkSGGeometryTransform.cpp",
Florin Malitae6345d92018-01-03 23:37:54 -05001487 "experimental/sksg/geometry/SkSGMerge.cpp",
Florin Malita047ae272017-12-27 11:13:13 -05001488 "experimental/sksg/geometry/SkSGPath.cpp",
Florin Malita97b3d2b2018-02-20 11:26:15 -05001489 "experimental/sksg/geometry/SkSGPlane.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001490 "experimental/sksg/geometry/SkSGRect.cpp",
Florin Malita51012ce2018-01-31 17:06:59 -05001491 "experimental/sksg/geometry/SkSGText.cpp",
Florin Malita51b8c892018-01-07 08:54:24 -05001492 "experimental/sksg/geometry/SkSGTrimEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001493 "experimental/sksg/paint/SkSGColor.cpp",
Florin Malita6aaee592018-01-12 12:25:09 -05001494 "experimental/sksg/paint/SkSGGradient.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001495 ]
1496 deps = [
1497 ":skia",
1498 ]
1499 }
1500
Kevin Lubickebf648e2017-09-21 13:45:16 -04001501 if (target_cpu != "wasm") {
1502 test_lib("views") {
1503 public_include_dirs = [ "include/views" ]
1504 sources = [
1505 "src/views/SkEvent.cpp",
1506 "src/views/SkEventSink.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001507 "src/views/SkTouchGesture.cpp",
1508 "src/views/SkView.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001509 ]
Brian Osman34755e22016-12-05 09:46:02 -05001510 }
Brian Osman16adfa32016-10-18 14:42:44 -04001511 }
1512
Mike Klein38af9432016-11-11 11:39:44 -05001513 if (skia_use_lua) {
1514 test_lib("lua") {
1515 public_include_dirs = []
1516 sources = [
1517 "src/utils/SkLua.cpp",
1518 "src/utils/SkLuaCanvas.cpp",
1519 ]
1520 deps = [
1521 "//third_party/lua",
1522 ]
1523 }
1524
Mike Kleine6682eb2017-01-05 10:54:57 -05001525 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001526 sources = [
1527 "tools/lua/lua_app.cpp",
1528 ]
1529 deps = [
1530 ":lua",
1531 ":skia",
1532 "//third_party/lua",
1533 ]
Mike Klein38af9432016-11-11 11:39:44 -05001534 }
1535
Mike Kleine6682eb2017-01-05 10:54:57 -05001536 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001537 sources = [
1538 "tools/lua/lua_pictures.cpp",
1539 ]
1540 deps = [
1541 ":flags",
1542 ":lua",
1543 ":skia",
1544 ":tool_utils",
1545 "//third_party/lua",
1546 ]
Mike Klein38af9432016-11-11 11:39:44 -05001547 }
1548 }
1549
Cary Clark8032b982017-07-28 11:04:54 -04001550 test_app("bookmaker") {
1551 sources = [
1552 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001553 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001554 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001555 "tools/bookmaker/fiddleParser.cpp",
1556 "tools/bookmaker/includeParser.cpp",
1557 "tools/bookmaker/includeWriter.cpp",
1558 "tools/bookmaker/mdOut.cpp",
1559 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001560 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001561 "tools/bookmaker/spellCheck.cpp",
1562 ]
1563 deps = [
1564 ":flags",
1565 ":skia",
1566 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001567 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001568 ]
1569 }
1570
Kevin Lubickebf648e2017-09-21 13:45:16 -04001571 if (target_cpu != "wasm") {
1572 import("gn/samples.gni")
1573 test_lib("samples") {
1574 public_include_dirs = [ "samplecode" ]
1575 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001576 sources = samples_sources
Kevin Lubickebf648e2017-09-21 13:45:16 -04001577 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001578 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001579 ":experimental_svg_model",
1580 ":flags",
1581 ":gm",
Mike Reed193d3a02018-02-08 15:45:51 -05001582 ":skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001583 ":tool_utils",
1584 ":views",
1585 ":xml",
1586 ]
Mike Klein38af9432016-11-11 11:39:44 -05001587
Kevin Lubickebf648e2017-09-21 13:45:16 -04001588 if (skia_use_lua) {
1589 sources += [ "samplecode/SampleLua.cpp" ]
1590 deps += [
1591 ":lua",
1592 "//third_party/lua",
1593 ]
1594 }
1595 }
1596 test_app("dm") {
1597 sources = [
1598 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001599 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001600 "dm/DMJsonWriter.cpp",
1601 "dm/DMSrcSink.cpp",
1602 ]
1603 include_dirs = [ "tests" ]
1604 deps = [
1605 ":common_flags",
Florin Malita54f65c42018-01-16 17:04:30 -05001606 ":experimental_skottie",
Florin Malita4aa44412017-12-19 12:21:02 -05001607 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001608 ":experimental_svg_model",
1609 ":flags",
1610 ":gm",
1611 ":gpu_tool_utils",
1612 ":skia",
1613 ":tests",
1614 ":tool_utils",
1615 "//third_party/jsoncpp",
1616 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001617 ]
1618 }
Brian Osman16adfa32016-10-18 14:42:44 -04001619 }
1620
Mike Kleina8a51ce2018-01-09 12:34:11 -05001621 if (!is_win) {
1622 test_app("remote_demo") {
1623 sources = [
1624 "tools/remote_demo.cpp",
1625 ]
1626 deps = [
1627 ":skia",
1628 ]
1629 }
1630 }
1631
Mike Kleine6682eb2017-01-05 10:54:57 -05001632 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001633 sources = [
1634 "bench/nanobench.cpp",
1635 ]
1636 deps = [
1637 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001638 ":common_flags",
Florin Malita4aa44412017-12-19 12:21:02 -05001639 ":experimental_sksg",
fmalita6519c212016-09-14 08:05:17 -07001640 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001641 ":flags",
1642 ":gm",
1643 ":gpu_tool_utils",
1644 ":skia",
1645 ":tool_utils",
1646 "//third_party/jsoncpp",
1647 ]
mtklein2b6870c2016-07-28 14:17:33 -07001648 }
halcanary19a97202016-08-03 15:08:04 -07001649
Ravi Mistry10d36c52017-01-31 09:49:18 -05001650 test_app("skpinfo") {
1651 sources = [
1652 "tools/skpinfo.cpp",
1653 ]
1654 deps = [
1655 ":flags",
1656 ":skia",
1657 ]
1658 }
1659
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001660 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001661 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001662 sources = [
1663 "tools/skpbench/skpbench.cpp",
1664 ]
1665 deps = [
1666 ":flags",
1667 ":gpu_tool_utils",
1668 ":skia",
1669 ":tool_utils",
1670 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001671 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001672 }
1673
Hal Canary96c57252018-02-09 11:43:05 -05001674 test_lib("skshaper") {
1675 public_include_dirs = [ "tools/shape" ]
1676 deps = [
1677 ":skia",
1678 ]
1679
Hal Canary8bb40832018-02-08 15:16:28 -05001680 if (target_cpu == "wasm") {
Hal Canary96c57252018-02-09 11:43:05 -05001681 sources = [
1682 "tools/shape/SkShaper_primitive.cpp",
1683 ]
1684 } else {
mtklein6f5df6a2016-08-29 16:01:10 -07001685 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001686 "tools/shape/SkShaper_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001687 ]
Hal Canary96c57252018-02-09 11:43:05 -05001688 deps += [
mtklein6f5df6a2016-08-29 16:01:10 -07001689 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001690 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001691 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001692 }
halcanary19a97202016-08-03 15:08:04 -07001693 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001694 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001695 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001696 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001697 ]
1698 deps = [
1699 ":skia",
Hal Canary96c57252018-02-09 11:43:05 -05001700 ":skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001701 ]
halcanary3eee9d92016-09-10 07:01:53 -07001702 }
mtklein046cb562016-09-16 10:23:12 -07001703
Matt Sarett9f1c4032017-05-17 10:06:32 -04001704 test_app("create_flutter_test_images") {
1705 sources = [
1706 "tools/create_flutter_test_images.cpp",
1707 ]
1708 deps = [
1709 ":skia",
1710 ":tool_utils",
1711 ]
1712 }
1713
Ben Wagner219f3622017-07-17 15:32:25 -04001714 test_app("create_test_font") {
1715 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001716 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001717 ]
1718 deps = [
1719 ":skia",
1720 ]
1721 assert_no_deps = [
1722 # tool_utils requires the output of this app.
1723 ":tool_utils",
1724 ]
1725 }
1726
Ben Wagner97182cc2018-02-15 10:20:04 -05001727 test_app("create_test_font_color") {
1728 sources = [
1729 "tools/fonts/create_test_font_color.cpp",
1730 ]
1731 deps = [
1732 ":flags",
1733 ":skia",
Florin Malitac659c2c2018-04-05 11:57:21 -04001734 ":tool_utils",
Ben Wagner97182cc2018-02-15 10:20:04 -05001735 ]
1736 }
1737
Mike Kleine6682eb2017-01-05 10:54:57 -05001738 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001739 sources = [
1740 "tools/get_images_from_skps.cpp",
1741 ]
1742 deps = [
1743 ":flags",
1744 ":skia",
1745 "//third_party/jsoncpp",
1746 ]
mtklein046cb562016-09-16 10:23:12 -07001747 }
mtkleinecbc5262016-09-22 11:51:24 -07001748
Mike Kleine6682eb2017-01-05 10:54:57 -05001749 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001750 sources = [
1751 "tools/colorspaceinfo.cpp",
1752 ]
1753 deps = [
1754 ":flags",
1755 ":skia",
1756 ":tool_utils",
1757 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001758 }
1759
Kevin Lubickebf648e2017-09-21 13:45:16 -04001760 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001761 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001762 sources = [
1763 "tools/skiaserve/Request.cpp",
1764 "tools/skiaserve/Response.cpp",
1765 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001766 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1767 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1768 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1769 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1770 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1771 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1772 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1773 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1774 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001775 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1776 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001777 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1778 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1779 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1780 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1781 ]
1782 deps = [
1783 ":flags",
1784 ":gpu_tool_utils",
1785 ":skia",
1786 ":tool_utils",
1787 "//third_party/jsoncpp",
1788 "//third_party/libmicrohttpd",
1789 "//third_party/libpng",
1790 ]
Mike Klein7d302882016-11-03 14:06:31 -04001791 }
mtkleinecbc5262016-09-22 11:51:24 -07001792 }
kjlubick14f984b2016-10-03 11:49:45 -07001793
Mike Kleine6682eb2017-01-05 10:54:57 -05001794 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001795 include_dirs = [
1796 "tools",
1797 "tools/debugger",
1798 ]
kjlubick14f984b2016-10-03 11:49:45 -07001799 sources = [
Hal Canary24ac42b2017-02-14 13:35:14 -05001800 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001801 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001802 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001803 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001804 "fuzz/FuzzGradients.cpp",
1805 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001806 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001807 "fuzz/FuzzPathop.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001808 "fuzz/FuzzRegionOp.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001809 "fuzz/fuzz.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001810 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1811 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001812 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
1813 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001814 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1815 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001816 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001817 "tools/UrlDataManager.cpp",
1818 "tools/debugger/SkDebugCanvas.cpp",
1819 "tools/debugger/SkDrawCommand.cpp",
1820 "tools/debugger/SkJsonWriteBuffer.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001821 "tools/picture_utils.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001822 ]
1823 deps = [
1824 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001825 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001826 ":skia",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001827 "//third_party/jsoncpp",
1828 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001829 ]
kjlubick14f984b2016-10-03 11:49:45 -07001830 }
Mike Klein38312422016-10-05 15:41:01 -04001831
Mike Kleine6682eb2017-01-05 10:54:57 -05001832 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001833 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001834 rebase_path("tests/skia_test.cpp"),
1835 rebase_path("tests/Test.cpp"),
1836 ]
caryclark9feb6322016-10-25 08:58:26 -07001837 deps = [
1838 ":flags",
1839 ":gpu_tool_utils",
1840 ":skia",
1841 ":tool_utils",
1842 ]
caryclark9feb6322016-10-25 08:58:26 -07001843 }
1844
Mike Kleine6682eb2017-01-05 10:54:57 -05001845 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001846 sources = [
1847 "tools/DumpRecord.cpp",
1848 "tools/dump_record.cpp",
1849 ]
1850 deps = [
1851 ":flags",
1852 ":skia",
1853 ]
Mike Klein38312422016-10-05 15:41:01 -04001854 }
bungemanfe917272016-10-13 17:36:40 -04001855
Mike Kleine6682eb2017-01-05 10:54:57 -05001856 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001857 sources = [
1858 "tools/skdiff/skdiff.cpp",
1859 "tools/skdiff/skdiff_html.cpp",
1860 "tools/skdiff/skdiff_main.cpp",
1861 "tools/skdiff/skdiff_utils.cpp",
1862 ]
1863 deps = [
1864 ":skia",
1865 ":tool_utils",
1866 ]
bungemanfe917272016-10-13 17:36:40 -04001867 }
halcanarya73d76a2016-10-17 13:19:02 -07001868
Mike Kleine6682eb2017-01-05 10:54:57 -05001869 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001870 sources = [
1871 "tools/skp_parser.cpp",
1872 ]
1873 deps = [
1874 ":skia",
1875 ":tool_utils",
1876 "//third_party/jsoncpp",
1877 ]
halcanarya73d76a2016-10-17 13:19:02 -07001878 }
Brian Osman16adfa32016-10-18 14:42:44 -04001879
Hal Canaryd7b38452017-12-11 17:46:26 -05001880 if (!is_win && skia_enable_gpu) {
1881 test_lib("skqp_lib") {
1882 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001883 defines =
1884 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001885 if (skia_skqp_enable_driver_correctness_workarounds) {
1886 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1887 }
Hal Canary75427132017-10-11 16:00:31 -04001888 sources = [
1889 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001890 "tools/skqp/gm_knowledge.cpp",
1891 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001892 ]
1893 deps = [
1894 ":gm",
1895 ":gpu_tool_utils",
1896 ":skia",
1897 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001898 ":tool_utils",
1899 ]
1900 }
1901 test_app("skqp") {
1902 sources = [
1903 "tools/skqp/skqp.cpp",
1904 ]
1905 deps = [
1906 ":skia",
1907 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001908 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001909 "//third_party/googletest",
1910 ]
1911 }
1912 }
Hal Canary28f89382017-12-12 09:42:14 -05001913 if (is_android && skia_enable_gpu) {
1914 test_app("skqp_app") {
1915 is_shared_library = true
1916 sources = [
1917 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1918 ]
1919 deps = [
1920 ":skia",
1921 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001922 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001923 ]
1924 libs = [ "android" ]
1925 }
1926 }
Hal Canary75427132017-10-11 16:00:31 -04001927
Hal Canarya9de7602018-01-19 13:08:23 -05001928 test_app("list_gms") {
1929 sources = [
1930 "tools/list_gms.cpp",
1931 ]
1932 deps = [
1933 ":gm",
1934 ":skia",
1935 ]
1936 }
1937 test_app("list_gpu_unit_tests") {
1938 sources = [
1939 "dm/DMGpuTestProcs.cpp",
1940 "tools/list_gpu_unit_tests.cpp",
1941 ]
1942 deps = [
1943 ":skia",
1944 ":tests",
1945 ]
1946 }
1947
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001948 if (skia_enable_gpu) {
Brian Osmaneff04b52017-11-21 13:18:02 -05001949 test_lib("sk_app") {
1950 public_include_dirs = [ "tools/sk_app" ]
Brian Osman16adfa32016-10-18 14:42:44 -04001951 sources = [
Brian Osmaneff04b52017-11-21 13:18:02 -05001952 "tools/sk_app/CommandSet.cpp",
1953 "tools/sk_app/GLWindowContext.cpp",
1954 "tools/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001955 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001956 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001957
Jim Van Verth4e56a912016-10-21 10:58:52 -04001958 if (is_android) {
1959 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001960 "tools/sk_app/android/GLWindowContext_android.cpp",
1961 "tools/sk_app/android/RasterWindowContext_android.cpp",
1962 "tools/sk_app/android/Window_android.cpp",
1963 "tools/sk_app/android/main_android.cpp",
1964 "tools/sk_app/android/surface_glue_android.cpp",
Jim Van Verth4e56a912016-10-21 10:58:52 -04001965 ]
Brian Osman462334e2017-02-09 11:22:57 -05001966 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001967 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001968 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001969 "tools/sk_app/unix/GLWindowContext_unix.cpp",
1970 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
1971 "tools/sk_app/unix/Window_unix.cpp",
Brian Osmanfa916272017-12-01 09:18:20 -05001972 "tools/sk_app/unix/keysym2ucs.c",
Brian Osmaneff04b52017-11-21 13:18:02 -05001973 "tools/sk_app/unix/main_unix.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001974 ]
Brian Osmanfa916272017-12-01 09:18:20 -05001975 libs += [
1976 "GL",
1977 "X11",
1978 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001979 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001980 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001981 "tools/sk_app/win/GLWindowContext_win.cpp",
1982 "tools/sk_app/win/RasterWindowContext_win.cpp",
1983 "tools/sk_app/win/Window_win.cpp",
1984 "tools/sk_app/win/main_win.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001985 ]
Brian Salomon194db172017-08-17 14:37:06 -04001986 if (skia_use_angle) {
Brian Osmaneff04b52017-11-21 13:18:02 -05001987 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04001988 }
Mike Klein43c25262016-10-20 10:17:47 -04001989 } else if (is_mac) {
1990 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001991 "tools/sk_app/mac/GLWindowContext_mac.cpp",
1992 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
1993 "tools/sk_app/mac/Window_mac.cpp",
1994 "tools/sk_app/mac/main_mac.cpp",
Mike Klein43c25262016-10-20 10:17:47 -04001995 ]
Brian Osmanfa916272017-12-01 09:18:20 -05001996 libs += [
1997 "QuartzCore.framework",
1998 "Cocoa.framework",
1999 "Foundation.framework",
2000 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002001 } else if (is_ios) {
2002 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002003 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2004 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2005 "tools/sk_app/ios/Window_ios.cpp",
2006 "tools/sk_app/ios/main_ios.cpp",
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002007 ]
Brian Osman16adfa32016-10-18 14:42:44 -04002008 }
2009
2010 if (skia_use_vulkan) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002011 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002012 if (is_android) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002013 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002014 } else if (is_linux) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002015 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
Brian Osman2dd96932016-10-18 15:33:53 -04002016 libs += [ "X11-xcb" ]
2017 } else if (is_win) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002018 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Brian Osman16adfa32016-10-18 14:42:44 -04002019 }
2020 }
2021
Brian Osman16adfa32016-10-18 14:42:44 -04002022 deps = [
Brian Osman16adfa32016-10-18 14:42:44 -04002023 ":gpu_tool_utils",
Brian Osman16adfa32016-10-18 14:42:44 -04002024 ":skia",
2025 ":tool_utils",
2026 ":views",
Brian Osman16adfa32016-10-18 14:42:44 -04002027 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002028 if (is_android) {
2029 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002030 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04002031 deps += [ "//third_party/libsdl" ]
2032 }
Brian Salomon194db172017-08-17 14:37:06 -04002033 if (skia_use_angle) {
2034 deps += [ "//third_party/angle2" ]
2035 }
Mike Kleina92c3832016-12-08 09:49:39 -05002036 }
Brian Osman16adfa32016-10-18 14:42:44 -04002037 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002038
Brian Osmaneff04b52017-11-21 13:18:02 -05002039 if (skia_enable_gpu) {
2040 test_app("viewer") {
2041 is_shared_library = is_android
Jim Van Verth329c5a62017-11-29 11:42:33 -05002042 if (is_ios) {
2043 bundle_ios_data = true
2044 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002045 sources = [
Chris Dalton2d18f412018-02-20 13:23:32 -07002046 "tools/viewer/BisectSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002047 "tools/viewer/GMSlide.cpp",
Brian Osmand67e5182017-12-08 16:46:09 -05002048 "tools/viewer/ImGuiLayer.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002049 "tools/viewer/ImageSlide.cpp",
2050 "tools/viewer/SKPSlide.cpp",
2051 "tools/viewer/SampleSlide.cpp",
Florin Malita54f65c42018-01-16 17:04:30 -05002052 "tools/viewer/SkottieSlide.cpp",
Florin Malita76a076b2018-02-15 18:40:48 -05002053 "tools/viewer/SlideDir.cpp",
Brian Osman56a24812017-12-19 11:15:16 -05002054 "tools/viewer/StatsLayer.cpp",
Florin Malitac659c2c2018-04-05 11:57:21 -04002055 "tools/viewer/SvgSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002056 "tools/viewer/Viewer.cpp",
2057 ]
2058 libs = []
2059
2060 include_dirs = []
2061 deps = [
Florin Malita54f65c42018-01-16 17:04:30 -05002062 ":experimental_skottie",
Florin Malitabcd07232018-01-31 11:08:58 -05002063 ":experimental_sksg",
Florin Malitac659c2c2018-04-05 11:57:21 -04002064 ":experimental_svg_model",
Brian Osmaneff04b52017-11-21 13:18:02 -05002065 ":flags",
2066 ":gm",
2067 ":gpu_tool_utils",
2068 ":samples",
2069 ":sk_app",
2070 ":skia",
2071 ":tool_utils",
2072 ":views",
2073 "//third_party/imgui",
2074 "//third_party/jsoncpp",
2075 ]
2076 }
2077 }
2078
2079 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
2080 test_app("HelloWorld") {
2081 sources = [
2082 "example/HelloWorld.cpp",
2083 ]
2084 libs = []
2085
2086 include_dirs = []
2087 deps = [
2088 ":flags",
2089 ":gpu_tool_utils",
2090 ":sk_app",
2091 ":skia",
2092 ":tool_utils",
2093 ":views",
2094 ]
2095 }
2096 }
2097
Jim Van Verthecfed2b2017-08-30 14:02:50 -04002098 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002099 test_app("SkiaSDLExample") {
2100 sources = [
2101 "example/SkiaSDLExample.cpp",
2102 ]
2103 libs = []
2104 include_dirs = []
2105 deps = [
2106 ":gpu_tool_utils",
2107 ":skia",
2108 "//third_party/libsdl",
2109 ]
2110 }
2111 }
2112
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002113 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2114 action_foreach("generate_mocs") {
2115 script = "gn/call.py"
2116 sources = [
2117 "tools/mdbviz/MainWindow.h",
2118 ]
2119 outputs = [
2120 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2121 ]
2122 args = [
2123 "$skia_qt_path" + "/bin/moc",
2124 "{{source}}",
2125 "-o",
2126 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2127 ]
2128 }
2129 action_foreach("generate_resources") {
2130 script = "gn/call.py"
2131 sources = [
2132 "tools/mdbviz/resources.qrc",
2133 ]
2134 outputs = [
2135 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2136 ]
2137 args = [
2138 "$skia_qt_path" + "/bin/rcc",
2139 "{{source}}",
2140 "-o",
2141 "gen/mdbviz/{{source_name_part}}_res.cpp",
2142 ]
2143 }
2144 test_app("mdbviz") {
2145 if (is_win) {
2146 # on Windows we need to disable some exception handling warnings due to the Qt headers
2147 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2148 }
2149 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002150 "tools/UrlDataManager.cpp",
2151 "tools/debugger/SkDebugCanvas.cpp",
2152 "tools/debugger/SkDrawCommand.cpp",
2153 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002154 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002155 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002156 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002157 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002158
2159 # generated files
2160 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2161 "$target_gen_dir/mdbviz/resources_res.cpp",
2162 ]
2163 lib_dirs = [ "$skia_qt_path/lib" ]
2164 libs = [
2165 "Qt5Core.lib",
2166 "Qt5Gui.lib",
2167 "Qt5Widgets.lib",
2168 ]
2169 include_dirs = [
2170 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002171 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002172 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002173 "tools",
2174 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002175 ]
2176 deps = [
2177 ":generate_mocs",
2178 ":generate_resources",
2179 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002180 "//third_party/jsoncpp",
2181 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002182 ]
2183 }
2184 }
2185
Mike Kleine459afd2017-03-03 09:21:30 -05002186 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002187 copy("gdbserver") {
2188 sources = [
2189 "$ndk/$ndk_gdbserver",
2190 ]
2191 outputs = [
2192 "$root_out_dir/gdbserver",
2193 ]
2194 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002195 }
mtklein25c81d42016-07-27 13:55:26 -07002196}