blob: 1f515667e50650c10175ae00f80e1d44bfd1120c [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
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500107if (skia_enable_atlas_text) {
108 skia_public_includes += [ "include/atlastext" ]
109}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000110
mtkleinc04ff472016-06-23 10:29:30 -0700111# Skia public API, generally provided by :skia.
112config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700113 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -0400114 defines = []
115 if (is_component_build) {
116 defines += [ "SKIA_DLL" ]
117 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400118 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700119 defines += [ "SK_SAMPLES_FOR_X" ]
120 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400121 if (skia_enable_flutter_defines) {
122 defines += flutter_defines
123 }
mtklein06c35c02016-09-20 12:28:12 -0700124 if (!skia_enable_gpu) {
125 defines += [ "SK_SUPPORT_GPU=0" ]
126 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500127 if (skia_enable_atlas_text) {
128 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
129 }
mtkleinc04ff472016-06-23 10:29:30 -0700130}
131
132# Skia internal APIs, used by Skia itself and a few test tools.
133config("skia_private") {
134 visibility = [ ":*" ]
135
136 include_dirs = [
137 "include/private",
138 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700139 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700140 "src/core",
141 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700142 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700143 "src/image",
144 "src/images",
145 "src/lazy",
146 "src/opts",
147 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700148 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700149 "src/ports",
150 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400151 "src/shaders",
152 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700153 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700154 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700155 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500156 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700157 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700158 ]
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400159 if (skia_llvm_path != "") {
160 include_dirs += [ "$skia_llvm_path/include" ]
161 }
mtklein150d1132016-08-01 06:56:40 -0700162
Mike Reeda9e241d2017-05-03 10:52:00 -0400163 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700164 if (is_android) {
165 defines += [
166 "SK_GAMMA_EXPONENT=1.4",
167 "SK_GAMMA_CONTRAST=0.0",
168 ]
169 }
mtklein88a7ac02016-09-14 11:16:49 -0700170 if (is_official_build || is_android) {
171 # TODO(bsalomon): it'd be nice to make Android normal.
172 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
173 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400174 libs = []
175 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500176 if (skia_enable_gpu) {
177 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500178 if (is_skia_dev_build && skia_use_vulkan) {
179 include_dirs += [ "tools/gpu/vk" ]
180 }
Brian Salomon03e05842017-02-23 12:23:47 -0500181 }
Brian Osman34755e22016-12-05 09:46:02 -0500182 if (skia_use_angle) {
183 defines += [ "SK_ANGLE" ]
184 }
Brian Osman3f375d02016-12-28 11:19:22 -0500185 if (skia_enable_discrete_gpu) {
186 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
187 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400188 if (!is_official_build) {
189 defines += [ "GR_TEST_UTILS=1" ]
190 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400191 if (skia_llvm_path != "") {
192 defines += [ "SK_LLVM_AVAILABLE" ]
193 include_dirs += [ "$skia_llvm_path/include" ]
194 libs += [ skia_llvm_lib ]
195 lib_dirs += [ "$skia_llvm_path/lib/" ]
196 }
mtkleinc04ff472016-06-23 10:29:30 -0700197}
198
199# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
200config("skia_library") {
201 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700202 defines = [ "SKIA_IMPLEMENTATION=1" ]
203}
204
205skia_library_configs = [
206 ":skia_public",
207 ":skia_private",
208 ":skia_library",
209]
210
mtklein9b8583d2016-08-24 17:32:30 -0700211# Use for CPU-specific Skia code that needs particular compiler flags.
212template("opts") {
213 if (invoker.enabled) {
214 source_set(target_name) {
215 forward_variables_from(invoker, "*")
216 configs += skia_library_configs
217 }
218 } else {
219 # If not enabled, a phony empty target that swallows all otherwise unused variables.
220 source_set(target_name) {
221 forward_variables_from(invoker,
222 "*",
223 [
224 "sources",
225 "cflags",
226 ])
227 }
228 }
anmittala7eaf2e2016-08-17 13:57:26 -0700229}
230
mtklein422310d2016-08-16 18:28:43 -0700231is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700232
mtklein7d6fb2c2016-08-25 14:50:44 -0700233opts("none") {
234 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700235 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700236 cflags = []
237}
238
mtklein7d6fb2c2016-08-25 14:50:44 -0700239opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700240 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700241 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700242 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700243}
244
245opts("arm64") {
246 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700247 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700248 cflags = []
249}
250
251opts("crc32") {
252 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700253 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700254 cflags = [ "-march=armv8-a+crc" ]
255}
256
mtklein9b8583d2016-08-24 17:32:30 -0700257opts("sse2") {
258 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700259 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400260 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400261 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
262 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400263 cflags = [ "-msse2" ]
264 }
mtklein9b8583d2016-08-24 17:32:30 -0700265}
mtkleinc04ff472016-06-23 10:29:30 -0700266
mtklein9b8583d2016-08-24 17:32:30 -0700267opts("ssse3") {
268 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700269 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400270 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400271 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
272 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400273 cflags = [ "-mssse3" ]
274 }
mtklein9b8583d2016-08-24 17:32:30 -0700275}
mtkleinc04ff472016-06-23 10:29:30 -0700276
mtklein9b8583d2016-08-24 17:32:30 -0700277opts("sse41") {
278 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700279 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400280 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400281 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
282 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400283 cflags = [ "-msse4.1" ]
284 }
mtklein9b8583d2016-08-24 17:32:30 -0700285}
mtklein4e976072016-08-08 09:06:27 -0700286
mtklein9b8583d2016-08-24 17:32:30 -0700287opts("sse42") {
288 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700289 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400290 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400291 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
292 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400293 cflags = [ "-msse4.2" ]
294 }
mtklein9b8583d2016-08-24 17:32:30 -0700295}
296
297opts("avx") {
298 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700299 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400300 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000301 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400302 } else {
303 cflags = [ "-mavx" ]
304 }
mtkleinc04ff472016-06-23 10:29:30 -0700305}
306
Mike Klein1b9b7d52018-02-27 10:37:40 -0500307opts("hsw") {
308 enabled = is_x86
309 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400310 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500311 cflags = [ "/arch:AVX2" ]
312 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000313 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500314 }
315
316 # Oddly, clang-cl doesn't recognize this as a valid flag.
317 # If it ever does, it'd nice to move this up with -mavx2 and co.
318 if (is_clang && !is_win) {
319 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
320 # but nice to have, generating slightly better code for paths without explicit FMAs.
321 cflags += [ "-ffp-contract=fast" ]
322 }
323}
324
mtkleinc095df52016-08-24 12:23:52 -0700325# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700326template("optional") {
327 if (invoker.enabled) {
328 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700329 if (defined(invoker.public_defines)) {
330 defines = invoker.public_defines
331 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600332 if (defined(invoker.public_configs)) {
333 configs = invoker.public_configs
334 }
mtklein457b42a2016-08-23 13:56:37 -0700335 }
336 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700337 forward_variables_from(invoker,
338 "*",
339 [
340 "public_defines",
341 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700342 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700343 ])
mtklein457b42a2016-08-23 13:56:37 -0700344 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700345 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700346 if (defined(invoker.configs_to_remove)) {
347 configs -= invoker.configs_to_remove
348 }
mtklein457b42a2016-08-23 13:56:37 -0700349 }
350 } else {
mtklein457b42a2016-08-23 13:56:37 -0700351 source_set(target_name) {
352 forward_variables_from(invoker,
353 "*",
354 [
355 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400356 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700357 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700358 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700359 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700360 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700361 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700362 ])
mtkleincd01b032016-08-31 04:58:19 -0700363 if (defined(invoker.sources_when_disabled)) {
364 sources = invoker.sources_when_disabled
365 }
366 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700367 }
mtkleineb3c4252016-08-23 07:38:09 -0700368 }
mtklein457b42a2016-08-23 13:56:37 -0700369}
mtklein457b42a2016-08-23 13:56:37 -0700370
Mike Kleina04bb452017-02-09 12:24:07 -0500371optional("effects") {
372 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400373 deps = [
374 ":compile_processors",
375 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500376 sources =
377 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
378 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
379}
380
mtkleina45be612016-08-29 15:22:10 -0700381optional("fontmgr_android") {
382 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700383
384 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500385 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700386 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700387 ]
388 sources = [
389 "src/ports/SkFontMgr_android.cpp",
390 "src/ports/SkFontMgr_android_factory.cpp",
391 "src/ports/SkFontMgr_android_parser.cpp",
392 ]
393}
394
mtkleind2e39db2016-09-07 07:52:55 -0700395optional("fontmgr_custom") {
396 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
397
398 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500399 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700400 ]
401 sources = [
402 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500403 "src/ports/SkFontMgr_custom.h",
404 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700405 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500406 "src/ports/SkFontMgr_custom_embedded.cpp",
407 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700408 ]
409}
410
Hal Canaryff2742e2018-01-30 11:35:47 -0500411optional("fontmgr_empty") {
412 enabled = skia_enable_fontmgr_empty
413 sources = [
414 "src/ports/SkFontMgr_empty_factory.cpp",
415 ]
416}
417
mtklein3cc22182016-08-29 13:26:14 -0700418optional("fontmgr_fontconfig") {
419 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700420
421 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500422 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700423 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700424 ]
425 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700426 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700427 "src/ports/SkFontConfigInterface_direct.cpp",
428 "src/ports/SkFontConfigInterface_direct_factory.cpp",
429 "src/ports/SkFontMgr_FontConfigInterface.cpp",
430 "src/ports/SkFontMgr_fontconfig.cpp",
431 "src/ports/SkFontMgr_fontconfig_factory.cpp",
432 ]
433}
434
mtkleincdedd0e2016-09-12 15:15:44 -0700435optional("fontmgr_fuchsia") {
436 enabled = is_fuchsia && skia_use_freetype
437
438 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500439 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700440 ]
441 sources = [
442 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500443 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700444 "src/ports/SkFontMgr_custom_empty_factory.cpp",
445 ]
446}
447
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700448if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400449 executable("sksllex") {
450 sources = [
451 "src/sksl/lex/Main.cpp",
452 "src/sksl/lex/NFA.cpp",
453 "src/sksl/lex/RegexNode.cpp",
454 "src/sksl/lex/RegexParser.cpp",
455 ]
456 include_dirs = [ "src/sksl/lex" ]
457 }
458
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700459 action("run_sksllex") {
460 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400461 deps = [
462 ":sksllex(//gn/toolchain:$host_toolchain)",
463 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700464 sources = [
465 "src/sksl/lex/layout.lex",
466 "src/sksl/lex/sksl.lex",
467 ]
468
469 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
470 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
471 outputs = [
472 "$target_out_dir/" +
473 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
474 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
475 # confused due to the same file being named by two different paths
476 ]
477 sksllex_path = "$root_out_dir/"
478 sksllex_path += "sksllex"
479 if (host_os == "win") {
480 sksllex_path += ".exe"
481 }
482 args = [
483 rebase_path(sksllex_path),
484 rebase_path("bin/clang-format"),
485 rebase_path("src"),
486 ]
487 }
488} else {
489 group("run_sksllex") {
490 }
491}
492
493if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400494 executable("skslc") {
495 defines = [ "SKSL_STANDALONE" ]
496 sources = [
497 "src/sksl/SkSLMain.cpp",
498 ]
499 sources += skia_sksl_sources
500 include_dirs = [
501 "src/gpu",
502 "src/sksl",
503 ]
504 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500505 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400506 "//third_party/spirv-tools",
507 ]
508 }
509
510 skia_gpu_processor_outputs = []
511 foreach(src, skia_gpu_processor_sources) {
512 dir = get_path_info(src, "dir")
513 name = get_path_info(src, "name")
514
515 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
516 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
517 skia_gpu_processor_outputs += [
518 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
519 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
520 # confused due to the same file being named by two different paths
521 ]
522 }
523
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500524 action("create_sksl_enums") {
525 script = "gn/create_sksl_enums.py"
526 sources = [
527 "include/private/GrSharedEnums.h",
528 ]
529 outputs = [
530 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500531 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500532 ]
533 args = [
534 rebase_path(sources[0]),
535 rebase_path(outputs[0]),
536 ]
537 }
538
Ethan Nicholas762466e2017-06-29 10:03:38 -0400539 action("compile_processors") {
540 script = "gn/compile_processors.py"
541 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500542 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400543 ":skslc(//gn/toolchain:$host_toolchain)",
544 ]
545 sources = skia_gpu_processor_sources
546 outputs = skia_gpu_processor_outputs
547 skslc_path = "$root_out_dir/"
548 if (host_toolchain != default_toolchain_name) {
549 skslc_path += "$host_toolchain/"
550 }
551 skslc_path += "skslc"
552 if (host_os == "win") {
553 skslc_path += ".exe"
554 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400555 args = [
556 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400557 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400558 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400559 args += rebase_path(skia_gpu_processor_sources)
560 }
561} else {
562 skia_gpu_processor_outputs = []
563 group("compile_processors") {
564 }
565}
566
mtklein06c35c02016-09-20 12:28:12 -0700567optional("gpu") {
568 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400569 deps = [
570 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700571 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400572 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700573 if (skia_generate_workarounds) {
574 deps += [ ":workaround_list" ]
575 }
mtkleine9fb3d52016-09-20 15:11:46 -0700576 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600577 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400578 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700579
Brian Salomon3d6801e2017-12-11 10:06:31 -0500580 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700581
582 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500583 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700584 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400585 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700586 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400587 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400588
589 # this lib is required to link against AHardwareBuffer
590 if (defined(ndk_api) && ndk_api >= 26) {
591 libs += [ "android" ]
592 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400593 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500594 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400595 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700596 } else if (is_linux) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500597 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500598 libs += [
599 "GL",
600 "GLU",
601 ]
mtklein06c35c02016-09-20 12:28:12 -0700602 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500603 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800604 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500605 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400606 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500607 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400608 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700609 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500610 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700611 }
mtkleine9fb3d52016-09-20 15:11:46 -0700612
613 if (skia_use_vulkan) {
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400614 # TODO: We should make this deps be //third_party/vulkan and then update clients to have a
615 # //third_party/vulkan directory in their trees so they can set up the vulkan library however
616 # they want. For example this would allow us to remove the fuchsia specific vulkan code in our
617 # vulkan files.
618 public_deps += [ "third_party/vulkan" ]
Greg Daniel26c0e4c2018-05-25 11:02:16 -0400619 deps += [ "third_party/vulkanmemoryallocator" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700620 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700621 if (skia_enable_vulkan_debug_layers) {
622 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
623 }
mtkleine9fb3d52016-09-20 15:11:46 -0700624 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400625
Brian Salomon5f33a8c2018-02-26 14:32:39 -0500626 if (skia_use_legacy_gpu_pixel_ops) {
627 public_defines += [ "SK_LEGACY_GPU_PIXEL_OPS" ]
628 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400629 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400630 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400631 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
632 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400633
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400634 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400635 if (skia_use_metal) {
636 public_defines += [ "SK_METAL" ]
637 sources += skia_metal_sources
638 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400639 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400640 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500641
642 if (skia_enable_atlas_text) {
643 sources += skia_atlas_text_sources
644 }
mtklein06c35c02016-09-20 12:28:12 -0700645}
646
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400647optional("heif") {
648 enabled = skia_use_libheif
649 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
650
651 deps = []
652
653 sources = [
654 "src/codec/SkHeifCodec.cpp",
655 ]
656}
657
mtklein63213812016-08-24 09:55:56 -0700658optional("jpeg") {
659 enabled = skia_use_libjpeg_turbo
660 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
661
mtklein63213812016-08-24 09:55:56 -0700662 deps = [
663 "//third_party/libjpeg-turbo:libjpeg",
664 ]
665 sources = [
666 "src/codec/SkJpegCodec.cpp",
667 "src/codec/SkJpegDecoderMgr.cpp",
668 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700669 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400670 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700671 ]
672}
673
674optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500675 enabled = skia_use_zlib && skia_enable_pdf
676 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700677
mtklein63213812016-08-24 09:55:56 -0700678 deps = [
679 "//third_party/zlib",
680 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400681 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700682 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400683 }
brettwb9447282016-09-01 14:24:39 -0700684 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700685 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700686
687 if (skia_use_sfntly) {
688 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500689 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700690 }
691}
692
693optional("png") {
694 enabled = skia_use_libpng
695 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
696
mtklein63213812016-08-24 09:55:56 -0700697 deps = [
698 "//third_party/libpng",
699 ]
700 sources = [
701 "src/codec/SkIcoCodec.cpp",
702 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400703 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700704 ]
705}
706
scroggof84ad642016-10-31 09:02:57 -0700707optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400708 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700709 public_defines = [ "SK_CODEC_DECODES_RAW" ]
710
711 deps = [
712 "//third_party/dng_sdk",
713 "//third_party/libjpeg-turbo:libjpeg",
714 "//third_party/piex",
715 ]
716
717 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
718 # Skia.
719 configs_to_remove = [ "//gn:no_exceptions" ]
720
721 sources = [
722 "src/codec/SkRawAdapterCodec.cpp",
723 "src/codec/SkRawCodec.cpp",
724 ]
725}
726
Mike Klein852a8cb2018-05-15 10:46:58 -0400727import("third_party/skcms/skcms.gni")
728config("third_party_skcms_public") {
729 include_dirs = [ "third_party/skcms" ]
730}
731source_set("third_party_skcms") {
732 public_configs = [ ":third_party_skcms_public" ]
733
734 cflags = []
735 if (!is_win || is_clang) {
736 cflags += [
737 "-w",
738 "-std=c11",
739 ]
740 }
741
742 public = [
743 "third_party/skcms/skcms.h",
744 ]
745 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
746}
747
Mike Kleinfb333552018-01-25 12:49:37 -0500748optional("skcms") {
749 enabled = skia_use_skcms
750
Brian Osman094fba92018-03-26 17:05:48 -0400751 public_defines = [ "SK_USE_SKCMS" ]
Mike Kleinfb333552018-01-25 12:49:37 -0500752 deps = [
Mike Klein852a8cb2018-05-15 10:46:58 -0400753 ":third_party_skcms",
Mike Kleinfb333552018-01-25 12:49:37 -0500754 ]
755 sources = [
Brian Osman094fba92018-03-26 17:05:48 -0400756 "src/core/SkColorSpaceXform_skcms.cpp",
Mike Kleinfb333552018-01-25 12:49:37 -0500757 ]
758}
759
mtklein3cc22182016-08-29 13:26:14 -0700760optional("typeface_freetype") {
761 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700762
763 deps = [
764 "//third_party/freetype2",
765 ]
766 sources = [
767 "src/ports/SkFontHost_FreeType.cpp",
768 "src/ports/SkFontHost_FreeType_common.cpp",
769 ]
770}
771
mtklein457b42a2016-08-23 13:56:37 -0700772optional("webp") {
773 enabled = skia_use_libwebp
774 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
775
mtklein457b42a2016-08-23 13:56:37 -0700776 deps = [
777 "//third_party/libwebp",
778 ]
779 sources = [
780 "src/codec/SkWebpAdapterCodec.cpp",
781 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400782 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700783 ]
mtkleineb3c4252016-08-23 07:38:09 -0700784}
785
mtklein63213812016-08-24 09:55:56 -0700786optional("xml") {
787 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000788 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700789
mtklein63213812016-08-24 09:55:56 -0700790 deps = [
791 "//third_party/expat",
792 ]
793 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500794 "src/svg/SkSVGCanvas.cpp",
795 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700796 "src/xml/SkDOM.cpp",
797 "src/xml/SkXMLParser.cpp",
798 "src/xml/SkXMLWriter.cpp",
799 ]
800}
801
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700802if (skia_enable_gpu && skia_generate_workarounds) {
803 action("workaround_list") {
804 script = "tools/build_workaround_header.py"
805
806 inputs = [
807 "src/gpu/gpu_workaround_list.txt",
808 ]
809
810 # see comments in skia_compile_processors about out dir path shenanigans.
811 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700812 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700813
814 outputs = [
815 "$root_out_dir/$output_file",
816 ]
817 args = [
818 "--output-file",
819 "$output_file",
820 ]
821
822 foreach(file, inputs) {
823 args += [ rebase_path(file, root_build_dir) ]
824 }
825 }
826}
827
mtkleinc04ff472016-06-23 10:29:30 -0700828component("skia") {
829 public_configs = [ ":skia_public" ]
830 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700831
832 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700833 ":arm64",
834 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700835 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700836 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500837 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700838 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700839 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500840 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700841 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700842 ":fontmgr_fuchsia",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400843 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500844 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700845 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700846 ":none",
mtklein63213812016-08-24 09:55:56 -0700847 ":pdf",
848 ":png",
scroggof84ad642016-10-31 09:02:57 -0700849 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500850 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700851 ":sse2",
852 ":sse41",
853 ":sse42",
854 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700855 ":webp",
mtklein63213812016-08-24 09:55:56 -0700856 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700857 ]
858
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400859 # We need the public deps here for Vulkan. Our third_party/vulkan target sets some defines that
860 # need to get propagated up to the tools that depend on :skia and thus :gpu.
861 public_deps = [
862 ":gpu",
863 ]
864
Chinmay Garde43f115c2016-11-16 15:04:12 -0800865 # This file (and all GN files in Skia) are designed to work with an
866 # empty sources assignment filter; we handle all that explicitly.
867 # We clear the filter here for clients who may have set up a global filter.
868 set_sources_assignment_filter([])
869
mtkleinc04ff472016-06-23 10:29:30 -0700870 sources = []
brettwb9447282016-09-01 14:24:39 -0700871 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700872 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500873 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700874 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400875 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500876 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700877 "src/android/SkBitmapRegionCodec.cpp",
878 "src/android/SkBitmapRegionDecoder.cpp",
879 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400880 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700881 "src/codec/SkBmpCodec.cpp",
882 "src/codec/SkBmpMaskCodec.cpp",
883 "src/codec/SkBmpRLECodec.cpp",
884 "src/codec/SkBmpStandardCodec.cpp",
885 "src/codec/SkCodec.cpp",
886 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700887 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700888 "src/codec/SkMaskSwizzler.cpp",
889 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700890 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700891 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700892 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700893 "src/codec/SkSwizzler.cpp",
894 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700895 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700896 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700897 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700898 "src/ports/SkMemory_malloc.cpp",
899 "src/ports/SkOSFile_stdio.cpp",
900 "src/sfnt/SkOTTable_name.cpp",
901 "src/sfnt/SkOTUtils.cpp",
902 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700903 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700904 ]
brettwb9447282016-09-01 14:24:39 -0700905
mtklein7d6fb2c2016-08-25 14:50:44 -0700906 libs = []
907
mtkleinc04ff472016-06-23 10:29:30 -0700908 if (is_win) {
909 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400910 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700911 "src/ports/SkDebug_win.cpp",
912 "src/ports/SkFontHost_win.cpp",
913 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500914 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700915 "src/ports/SkImageEncoder_WIC.cpp",
916 "src/ports/SkImageGeneratorWIC.cpp",
917 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700918 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700919 "src/ports/SkScalerContext_win_dw.cpp",
920 "src/ports/SkTLS_win.cpp",
921 "src/ports/SkTypeface_win_dw.cpp",
922 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400923 libs += [
924 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500925 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400926 "Ole32.lib",
927 "OleAut32.lib",
928 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500929 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400930 ]
mtkleinc04ff472016-06-23 10:29:30 -0700931 } else {
932 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700933 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700934 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700935 "src/ports/SkTLS_pthread.cpp",
936 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400937 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700938 }
939
mtklein7d6fb2c2016-08-25 14:50:44 -0700940 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500941 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500942 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500943 deps += [ "//third_party/cpu-features" ]
944 }
mtklein06c35c02016-09-20 12:28:12 -0700945 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700946 libs += [
947 "EGL",
948 "GLESv2",
949 "log",
950 ]
951 }
952
mtkleinc04ff472016-06-23 10:29:30 -0700953 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700954 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400955 if (skia_use_egl) {
956 libs += [ "GLESv2" ]
957 }
mtkleinc04ff472016-06-23 10:29:30 -0700958 }
959
960 if (is_mac) {
961 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700962 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700963 "src/ports/SkFontHost_mac.cpp",
964 "src/ports/SkImageEncoder_CG.cpp",
965 "src/ports/SkImageGeneratorCG.cpp",
966 ]
mtklein09e61f72016-08-23 13:35:28 -0700967 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400968 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
969 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700970 "ApplicationServices.framework",
971 "OpenGL.framework",
972 ]
mtkleinc04ff472016-06-23 10:29:30 -0700973 }
abarth6fc8ff02016-07-15 15:15:15 -0700974
Mike Klein7d302882016-11-03 14:06:31 -0400975 if (is_ios) {
976 sources += [
977 "src/ports/SkDebug_stdio.cpp",
978 "src/ports/SkFontHost_mac.cpp",
979 "src/ports/SkImageEncoder_CG.cpp",
980 "src/ports/SkImageGeneratorCG.cpp",
981 ]
982 libs += [
983 "CoreFoundation.framework",
984 "CoreGraphics.framework",
985 "CoreText.framework",
986 "ImageIO.framework",
987 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400988
989 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
990 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400991 ]
992 }
993
abarth6fc8ff02016-07-15 15:15:15 -0700994 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700995 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700996 }
mtkleinc04ff472016-06-23 10:29:30 -0700997}
998
mtkleinc095df52016-08-24 12:23:52 -0700999# Targets guarded by skia_enable_tools may use //third_party freely.
1000if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001001 # Used by gn_to_bp.py to list our public include dirs.
1002 source_set("public") {
1003 configs += [ ":skia_public" ]
1004 }
1005
Mike Kleinc36dedf2016-11-18 09:35:28 -05001006 config("skia.h_config") {
1007 include_dirs = [ "$target_gen_dir" ]
Greg Danielafb7ec72017-12-07 12:48:30 -05001008 if (skia_use_vulkan) {
1009 # So we can get the header which includes vulkan
1010 include_dirs += [ "tools/gpu/vk" ]
1011 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001012 }
1013 action("skia.h") {
1014 public_configs = [ ":skia.h_config" ]
1015 skia_h = "$target_gen_dir/skia.h"
1016 script = "gn/find_headers.py"
Mike Klein59da5482018-05-25 16:16:21 +00001017 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +00001018 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001019 depfile = "$skia_h.deps"
1020 outputs = [
1021 skia_h,
1022 ]
1023 }
1024
1025 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001026 executable("fiddle") {
1027 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001028 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001029 "tools/fiddle/draw.cpp",
1030 "tools/fiddle/fiddle_main.cpp",
1031 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001032
1033 if (skia_use_egl) {
1034 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001035 } else {
1036 sources += [ "tools/fiddle/null_context.cpp" ]
1037 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001038 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001039 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001040 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001041 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001042 ":skia",
1043 ":skia.h",
1044 ]
1045 }
1046 }
1047
1048 if (skia_enable_gpu) {
1049 source_set("public_headers_warnings_check") {
1050 sources = [
1051 "tools/public_headers_warnings_check.cpp",
1052 ]
1053 configs -= [ "//gn:warnings_except_public_headers" ]
1054 deps = [
1055 ":skia",
1056 ":skia.h",
1057 ]
1058 }
1059 }
1060
mtkleinc095df52016-08-24 12:23:52 -07001061 template("test_lib") {
1062 config(target_name + "_config") {
1063 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001064 if (defined(invoker.public_defines)) {
1065 defines = invoker.public_defines
1066 }
mtklein25c81d42016-07-27 13:55:26 -07001067 }
mtkleinc095df52016-08-24 12:23:52 -07001068 source_set(target_name) {
1069 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1070 public_configs = [
1071 ":" + target_name + "_config",
1072 ":skia_private",
1073 ]
1074
1075 if (!defined(deps)) {
1076 deps = []
1077 }
1078 deps += [ ":skia" ]
1079 testonly = true
1080 }
mtklein25c81d42016-07-27 13:55:26 -07001081 }
mtklein25c81d42016-07-27 13:55:26 -07001082
Mike Kleine6682eb2017-01-05 10:54:57 -05001083 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001084 if (is_ios) {
1085 app_name = target_name
1086 gen_path = target_gen_dir
1087
1088 action("${app_name}_generate_info_plist") {
1089 script = "//gn/gen_plist_ios.py"
1090 outputs = [
1091 "$gen_path/${app_name}_Info.plist",
1092 ]
1093 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1094 }
1095
1096 bundle_data("${app_name}_bundle_info_plist") {
1097 public_deps = [
1098 ":${app_name}_generate_info_plist",
1099 ]
1100 sources = [
1101 "$gen_path/${app_name}_Info.plist",
1102 ]
1103 outputs = [
1104 "{{bundle_root_dir}}/Info.plist",
1105 ]
1106 }
1107
Jim Van Verth329c5a62017-11-29 11:42:33 -05001108 bundle_ios_data =
1109 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1110
1111 if (bundle_ios_data) {
1112 has_skps =
1113 "True" == exec_script("//gn/checkdir.py",
1114 [ rebase_path("skps", root_build_dir) ],
1115 "trim string")
1116 bundle_data("${app_name}_bundle_resources") {
1117 sources = [
1118 "resources",
1119 ]
1120 outputs = [
1121 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1122 "{{bundle_resources_dir}}/data/resources",
1123 ]
1124 }
1125
1126 if (has_skps) {
1127 bundle_data("${app_name}_bundle_skps") {
1128 sources = [
1129 "skps",
1130 ]
1131 outputs = [
1132 # Store in same folder as resources
1133 "{{bundle_resources_dir}}/data/skps",
1134 ]
1135 }
1136 }
1137 }
1138
Jim Van Verth443a9132017-11-28 09:45:26 -05001139 executable("${app_name}_generate_executable") {
1140 forward_variables_from(invoker,
1141 "*",
1142 [
1143 "output_name",
1144 "visibility",
1145 "is_shared_library",
1146 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001147 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001148 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001149 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1150 }
1151
1152 bundle_data("${app_name}_bundle_executable") {
1153 public_deps = [
1154 ":${app_name}_generate_executable",
1155 ]
1156 sources = [
1157 "$gen_path/$app_name",
1158 ]
1159 outputs = [
1160 "{{bundle_executable_dir}}/$app_name",
1161 ]
1162 testonly = true
1163 }
1164
1165 create_bundle("$app_name") {
1166 product_type = "com.apple.product-type.application"
1167 testonly = true
1168
1169 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1170 bundle_resources_dir = bundle_root_dir
1171 bundle_executable_dir = bundle_root_dir
1172 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1173
1174 deps = [
1175 ":${app_name}_bundle_executable",
1176 ":${app_name}_bundle_info_plist",
1177 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001178 if (bundle_ios_data) {
1179 deps += [ ":${app_name}_bundle_resources" ]
1180 if (has_skps) {
1181 deps += [ ":${app_name}_bundle_skps" ]
1182 }
1183 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001184
1185 # should only code sign when running on a device, not the simulator
1186 if (target_cpu != "x64") {
1187 code_signing_script = "//gn/codesign_ios.py"
1188 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1189 code_signing_outputs = [
1190 "$bundle_root_dir/_CodeSignature/CodeResources",
1191 "$bundle_root_dir/embedded.mobileprovision",
1192 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001193 code_signing_args = [
1194 rebase_path("$bundle_root_dir", root_build_dir),
1195 skia_ios_identity,
1196 skia_ios_profile,
1197 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001198 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001199 }
1200 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001201 # !is_ios
1202
1203 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1204 shared_library("lib" + target_name) {
1205 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1206 configs += [ ":skia_private" ]
1207 testonly = true
1208 }
1209 } else {
1210 _executable = target_name
1211 executable(_executable) {
1212 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1213 configs += [ ":skia_private" ]
1214 testonly = true
1215 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001216 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001217 if (is_android && skia_android_serial != "" && defined(_executable)) {
1218 action("push_" + target_name) {
1219 script = "gn/push_to_android.py"
1220 deps = [
1221 ":" + _executable,
1222 ]
1223 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1224 outputs = [
1225 _stamp,
1226 ]
1227 args = [
1228 rebase_path("$root_build_dir/$_executable"),
1229 skia_android_serial,
1230 rebase_path(_stamp),
1231 ]
1232 testonly = true
1233 }
Mike Klein7d921032017-01-05 12:20:41 -05001234 }
1235 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001236 }
1237
mtkleinc095df52016-08-24 12:23:52 -07001238 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001239 public_include_dirs = []
1240 if (skia_enable_gpu) {
1241 public_defines = []
1242 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001243
1244 deps = []
mtklein38925aa2016-09-21 10:11:25 -07001245 sources = [
1246 "tools/gpu/GrContextFactory.cpp",
1247 "tools/gpu/GrTest.cpp",
Brian Salomon58389b92018-03-07 13:01:25 -05001248 "tools/gpu/ProxyUtils.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001249 "tools/gpu/TestContext.cpp",
Brian Salomoncbcb0a12017-11-19 13:20:13 -05001250 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001251 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001252 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001253 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1254 "tools/gpu/gl/debug/GrBufferObj.cpp",
1255 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1256 "tools/gpu/gl/debug/GrProgramObj.cpp",
1257 "tools/gpu/gl/debug/GrShaderObj.cpp",
1258 "tools/gpu/gl/debug/GrTextureObj.cpp",
1259 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1260 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001261 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001262 ]
1263 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001264
Kevin Lubick4a24e102017-03-29 11:19:01 -04001265 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001266 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001267 } else if (is_ios) {
1268 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1269 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001270 } else if (is_linux) {
1271 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001272 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001273 } else if (is_mac) {
1274 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001275 } else if (is_win) {
1276 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1277 libs += [
1278 "Gdi32.lib",
1279 "OpenGL32.lib",
1280 ]
mtklein38925aa2016-09-21 10:11:25 -07001281 }
mtklein6ef69992016-09-14 06:12:09 -07001282
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001283 cflags_objcc = [ "-fobjc-arc" ]
1284
Mike Kleinc168a3a2016-11-14 14:53:13 +00001285 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001286 deps += [ "//third_party/angle2" ]
1287 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1288 }
mtkleind68f9b02016-09-23 13:18:41 -07001289 if (skia_use_vulkan) {
1290 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001291 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001292 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001293 if (skia_use_metal) {
1294 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1295 }
mtkleina627b5c2016-09-20 13:36:47 -07001296 }
mtklein25c81d42016-07-27 13:55:26 -07001297 }
mtklein25c81d42016-07-27 13:55:26 -07001298
mtkleinc095df52016-08-24 12:23:52 -07001299 test_lib("flags") {
1300 public_include_dirs = [ "tools/flags" ]
1301 sources = [
1302 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001303 ]
1304 }
1305 test_lib("common_flags") {
1306 public_include_dirs = [ "tools/flags" ]
1307 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001308 "tools/flags/SkCommonFlags.cpp",
1309 "tools/flags/SkCommonFlagsConfig.cpp",
1310 ]
1311 deps = [
mtklein046cb562016-09-16 10:23:12 -07001312 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001313 ":gpu_tool_utils",
1314 ]
1315 }
mtklein25c81d42016-07-27 13:55:26 -07001316
mtkleinc095df52016-08-24 12:23:52 -07001317 test_lib("tool_utils") {
1318 public_include_dirs = [
1319 "tools",
1320 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001321 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001322 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001323 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001324 ]
1325 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001326 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001327 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001328 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001329 "tools/ProcStats.cpp",
1330 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001331 "tools/UrlDataManager.cpp",
1332 "tools/debugger/SkDebugCanvas.cpp",
1333 "tools/debugger/SkDrawCommand.cpp",
1334 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001335 "tools/fonts/SkRandomScalerContext.cpp",
1336 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001337 "tools/fonts/SkTestFontMgr.h",
1338 "tools/fonts/SkTestSVGTypeface.cpp",
1339 "tools/fonts/SkTestSVGTypeface.h",
1340 "tools/fonts/SkTestTypeface.cpp",
1341 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001342 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001343 "tools/picture_utils.cpp",
1344 "tools/random_parse_path.cpp",
1345 "tools/sk_tool_utils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001346 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001347 "tools/trace/SkChromeTracingTracer.cpp",
1348 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001349 "tools/trace/SkDebugfTracer.cpp",
1350 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001351 "tools/trace/SkEventTracingPriv.cpp",
1352 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001353 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001354 libs = []
1355 if (is_ios) {
1356 sources += [ "tools/ios_utils.m" ]
1357 libs += [ "Foundation.framework" ]
1358 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001359 defines = []
1360 if (skia_tools_require_resources) {
1361 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1362 }
mtkleinc095df52016-08-24 12:23:52 -07001363 deps = [
mtklein046cb562016-09-16 10:23:12 -07001364 ":common_flags",
Ben Wagner97182cc2018-02-15 10:20:04 -05001365 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001366 ":flags",
1367 "//third_party/libpng",
1368 ]
1369 public_deps = [
1370 "//third_party/jsoncpp",
1371 ]
1372 }
mtklein25c81d42016-07-27 13:55:26 -07001373
Mike Klein6e744122016-10-27 12:21:40 -04001374 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001375 test_lib("gm") {
1376 public_include_dirs = [ "gm" ]
1377 sources = gm_sources
1378 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001379 ":experimental_sksg",
scroggo19b91532016-10-24 09:03:26 -07001380 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001381 ":gpu_tool_utils",
1382 ":skia",
1383 ":tool_utils",
1384 ]
1385 }
mtklein25c81d42016-07-27 13:55:26 -07001386
Mike Klein6e744122016-10-27 12:21:40 -04001387 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001388 test_lib("tests") {
1389 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001390 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001391 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001392 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001393 }
mtkleinc095df52016-08-24 12:23:52 -07001394 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001395 ":experimental_sksg",
Hal Canary0f666812018-03-22 15:21:12 -04001396 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001397 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001398 ":skia",
Mike Klein852a8cb2018-05-15 10:46:58 -04001399 ":third_party_skcms",
mtkleinc095df52016-08-24 12:23:52 -07001400 ":tool_utils",
1401 "//third_party/libpng",
1402 "//third_party/zlib",
1403 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001404 public_deps = [
1405 ":gpu_tool_utils", # Test.h #includes headers from this target.
1406 ]
mtkleinc095df52016-08-24 12:23:52 -07001407 }
mtklein2f3416d2016-08-02 16:02:05 -07001408
Mike Klein6e744122016-10-27 12:21:40 -04001409 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001410 test_lib("bench") {
1411 public_include_dirs = [ "bench" ]
1412 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001413 deps = [
1414 ":flags",
1415 ":gm",
1416 ":gpu_tool_utils",
1417 ":skia",
1418 ":tool_utils",
1419 ]
1420 }
mtklein2b6870c2016-07-28 14:17:33 -07001421
Florin Malita54f65c42018-01-16 17:04:30 -05001422 test_lib("experimental_skottie") {
Florin Malita87ccf332018-05-04 12:23:24 -04001423 public_include_dirs = []
Florin Malita87ccf332018-05-04 12:23:24 -04001424 if (skia_enable_skottie) {
1425 public_include_dirs += [ "experimental/skottie" ]
1426 public_defines = [ "SK_ENABLE_SKOTTIE" ]
1427 sources = [
1428 "experimental/skottie/Skottie.cpp",
1429 "experimental/skottie/SkottieAdapter.cpp",
1430 "experimental/skottie/SkottieAnimator.cpp",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001431 "experimental/skottie/SkottieJson.cpp",
Florin Malita87ccf332018-05-04 12:23:24 -04001432 "experimental/skottie/SkottieValue.cpp",
1433 ]
1434 deps = [
1435 ":experimental_sksg",
1436 ":skia",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001437 "//third_party/rapidjson",
Florin Malita87ccf332018-05-04 12:23:24 -04001438 ]
1439 }
Florin Malita094ccde2017-12-30 12:27:00 -05001440 }
1441
mtkleinc095df52016-08-24 12:23:52 -07001442 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001443 public_include_dirs = []
1444 if (skia_use_expat) {
1445 public_include_dirs += [ "experimental/svg/model" ]
1446 sources = [
1447 "experimental/svg/model/SkSVGAttribute.cpp",
1448 "experimental/svg/model/SkSVGAttributeParser.cpp",
1449 "experimental/svg/model/SkSVGCircle.cpp",
1450 "experimental/svg/model/SkSVGClipPath.cpp",
1451 "experimental/svg/model/SkSVGContainer.cpp",
1452 "experimental/svg/model/SkSVGDOM.cpp",
1453 "experimental/svg/model/SkSVGEllipse.cpp",
1454 "experimental/svg/model/SkSVGGradient.cpp",
1455 "experimental/svg/model/SkSVGLine.cpp",
1456 "experimental/svg/model/SkSVGLinearGradient.cpp",
1457 "experimental/svg/model/SkSVGNode.cpp",
1458 "experimental/svg/model/SkSVGPath.cpp",
1459 "experimental/svg/model/SkSVGPattern.cpp",
1460 "experimental/svg/model/SkSVGPoly.cpp",
1461 "experimental/svg/model/SkSVGRadialGradient.cpp",
1462 "experimental/svg/model/SkSVGRect.cpp",
1463 "experimental/svg/model/SkSVGRenderContext.cpp",
1464 "experimental/svg/model/SkSVGSVG.cpp",
1465 "experimental/svg/model/SkSVGShape.cpp",
1466 "experimental/svg/model/SkSVGStop.cpp",
1467 "experimental/svg/model/SkSVGTransformableNode.cpp",
1468 "experimental/svg/model/SkSVGUse.cpp",
1469 "experimental/svg/model/SkSVGValue.cpp",
1470 ]
1471 deps = [
1472 ":skia",
1473 ":xml",
1474 ]
1475 }
mtkleinc095df52016-08-24 12:23:52 -07001476 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001477
Florin Malita4aa44412017-12-19 12:21:02 -05001478 test_lib("experimental_sksg") {
1479 public_include_dirs = [
1480 "experimental/sksg",
1481 "experimental/sksg/effects",
1482 "experimental/sksg/geometry",
1483 "experimental/sksg/paint",
1484 ]
1485 sources = [
1486 "experimental/sksg/SkSGDraw.cpp",
1487 "experimental/sksg/SkSGEffectNode.cpp",
1488 "experimental/sksg/SkSGGeometryNode.cpp",
1489 "experimental/sksg/SkSGGroup.cpp",
Florin Malita49328072018-01-08 12:51:12 -05001490 "experimental/sksg/SkSGImage.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001491 "experimental/sksg/SkSGInvalidationController.cpp",
1492 "experimental/sksg/SkSGNode.cpp",
1493 "experimental/sksg/SkSGPaintNode.cpp",
1494 "experimental/sksg/SkSGRenderNode.cpp",
Florin Malita35efaa82018-01-22 12:57:06 -05001495 "experimental/sksg/SkSGScene.cpp",
Florin Malita38ea40e2018-01-29 16:31:14 -05001496 "experimental/sksg/effects/SkSGClipEffect.cpp",
Florin Malita5f9102f2018-01-10 13:36:22 -05001497 "experimental/sksg/effects/SkSGMaskEffect.cpp",
Florin Malitac0034172018-01-08 16:42:59 -05001498 "experimental/sksg/effects/SkSGOpacityEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001499 "experimental/sksg/effects/SkSGTransform.cpp",
Florin Malita16d0ad02018-01-19 15:07:29 -05001500 "experimental/sksg/geometry/SkSGGeometryTransform.cpp",
Florin Malitae6345d92018-01-03 23:37:54 -05001501 "experimental/sksg/geometry/SkSGMerge.cpp",
Florin Malita047ae272017-12-27 11:13:13 -05001502 "experimental/sksg/geometry/SkSGPath.cpp",
Florin Malita97b3d2b2018-02-20 11:26:15 -05001503 "experimental/sksg/geometry/SkSGPlane.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001504 "experimental/sksg/geometry/SkSGRect.cpp",
Florin Malita41dff6e2018-04-30 23:08:15 -04001505 "experimental/sksg/geometry/SkSGRoundEffect.cpp",
Florin Malita51012ce2018-01-31 17:06:59 -05001506 "experimental/sksg/geometry/SkSGText.cpp",
Florin Malita51b8c892018-01-07 08:54:24 -05001507 "experimental/sksg/geometry/SkSGTrimEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001508 "experimental/sksg/paint/SkSGColor.cpp",
Florin Malita6aaee592018-01-12 12:25:09 -05001509 "experimental/sksg/paint/SkSGGradient.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001510 ]
1511 deps = [
1512 ":skia",
1513 ]
1514 }
1515
Kevin Lubickebf648e2017-09-21 13:45:16 -04001516 if (target_cpu != "wasm") {
1517 test_lib("views") {
1518 public_include_dirs = [ "include/views" ]
1519 sources = [
1520 "src/views/SkEvent.cpp",
1521 "src/views/SkEventSink.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001522 "src/views/SkTouchGesture.cpp",
1523 "src/views/SkView.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001524 ]
Brian Osman34755e22016-12-05 09:46:02 -05001525 }
Brian Osman16adfa32016-10-18 14:42:44 -04001526 }
1527
Mike Klein38af9432016-11-11 11:39:44 -05001528 if (skia_use_lua) {
1529 test_lib("lua") {
1530 public_include_dirs = []
1531 sources = [
1532 "src/utils/SkLua.cpp",
1533 "src/utils/SkLuaCanvas.cpp",
1534 ]
1535 deps = [
Herb Derby1724db12018-05-22 12:01:50 -04001536 ":skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001537 "//third_party/lua",
1538 ]
1539 }
1540
Mike Kleine6682eb2017-01-05 10:54:57 -05001541 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001542 sources = [
1543 "tools/lua/lua_app.cpp",
1544 ]
1545 deps = [
1546 ":lua",
1547 ":skia",
1548 "//third_party/lua",
1549 ]
Mike Klein38af9432016-11-11 11:39:44 -05001550 }
1551
Mike Kleine6682eb2017-01-05 10:54:57 -05001552 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001553 sources = [
1554 "tools/lua/lua_pictures.cpp",
1555 ]
1556 deps = [
1557 ":flags",
1558 ":lua",
1559 ":skia",
1560 ":tool_utils",
1561 "//third_party/lua",
1562 ]
Mike Klein38af9432016-11-11 11:39:44 -05001563 }
1564 }
1565
Cary Clark8032b982017-07-28 11:04:54 -04001566 test_app("bookmaker") {
1567 sources = [
1568 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001569 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001570 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001571 "tools/bookmaker/fiddleParser.cpp",
1572 "tools/bookmaker/includeParser.cpp",
1573 "tools/bookmaker/includeWriter.cpp",
1574 "tools/bookmaker/mdOut.cpp",
1575 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001576 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001577 "tools/bookmaker/spellCheck.cpp",
1578 ]
1579 deps = [
1580 ":flags",
1581 ":skia",
1582 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001583 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001584 ]
1585 }
1586
Kevin Lubickebf648e2017-09-21 13:45:16 -04001587 if (target_cpu != "wasm") {
1588 import("gn/samples.gni")
1589 test_lib("samples") {
1590 public_include_dirs = [ "samplecode" ]
1591 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001592 sources = samples_sources
Kevin Lubickebf648e2017-09-21 13:45:16 -04001593 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001594 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001595 ":experimental_svg_model",
1596 ":flags",
1597 ":gm",
Mike Reed193d3a02018-02-08 15:45:51 -05001598 ":skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001599 ":tool_utils",
1600 ":views",
1601 ":xml",
1602 ]
Mike Klein38af9432016-11-11 11:39:44 -05001603
Kevin Lubickebf648e2017-09-21 13:45:16 -04001604 if (skia_use_lua) {
1605 sources += [ "samplecode/SampleLua.cpp" ]
1606 deps += [
1607 ":lua",
1608 "//third_party/lua",
1609 ]
1610 }
1611 }
1612 test_app("dm") {
1613 sources = [
1614 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001615 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001616 "dm/DMJsonWriter.cpp",
1617 "dm/DMSrcSink.cpp",
1618 ]
1619 include_dirs = [ "tests" ]
1620 deps = [
1621 ":common_flags",
Florin Malita54f65c42018-01-16 17:04:30 -05001622 ":experimental_skottie",
Florin Malita4aa44412017-12-19 12:21:02 -05001623 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001624 ":experimental_svg_model",
1625 ":flags",
1626 ":gm",
1627 ":gpu_tool_utils",
1628 ":skia",
1629 ":tests",
Brian Osmanc494a702018-05-23 11:52:00 -04001630 ":third_party_skcms",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001631 ":tool_utils",
1632 "//third_party/jsoncpp",
1633 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001634 ]
1635 }
Brian Osman16adfa32016-10-18 14:42:44 -04001636 }
1637
Mike Kleina8a51ce2018-01-09 12:34:11 -05001638 if (!is_win) {
1639 test_app("remote_demo") {
1640 sources = [
1641 "tools/remote_demo.cpp",
1642 ]
1643 deps = [
1644 ":skia",
1645 ]
1646 }
1647 }
1648
Mike Kleine6682eb2017-01-05 10:54:57 -05001649 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001650 sources = [
1651 "bench/nanobench.cpp",
1652 ]
1653 deps = [
1654 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001655 ":common_flags",
Florin Malita4aa44412017-12-19 12:21:02 -05001656 ":experimental_sksg",
fmalita6519c212016-09-14 08:05:17 -07001657 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001658 ":flags",
1659 ":gm",
1660 ":gpu_tool_utils",
1661 ":skia",
1662 ":tool_utils",
1663 "//third_party/jsoncpp",
1664 ]
mtklein2b6870c2016-07-28 14:17:33 -07001665 }
halcanary19a97202016-08-03 15:08:04 -07001666
Ravi Mistry10d36c52017-01-31 09:49:18 -05001667 test_app("skpinfo") {
1668 sources = [
1669 "tools/skpinfo.cpp",
1670 ]
1671 deps = [
1672 ":flags",
1673 ":skia",
1674 ]
1675 }
1676
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001677 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001678 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001679 sources = [
1680 "tools/skpbench/skpbench.cpp",
1681 ]
1682 deps = [
1683 ":flags",
1684 ":gpu_tool_utils",
1685 ":skia",
1686 ":tool_utils",
1687 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001688 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001689 }
1690
Hal Canary96c57252018-02-09 11:43:05 -05001691 test_lib("skshaper") {
1692 public_include_dirs = [ "tools/shape" ]
1693 deps = [
1694 ":skia",
1695 ]
1696
Hal Canary8bb40832018-02-08 15:16:28 -05001697 if (target_cpu == "wasm") {
Hal Canary96c57252018-02-09 11:43:05 -05001698 sources = [
1699 "tools/shape/SkShaper_primitive.cpp",
1700 ]
1701 } else {
mtklein6f5df6a2016-08-29 16:01:10 -07001702 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001703 "tools/shape/SkShaper_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001704 ]
Hal Canary96c57252018-02-09 11:43:05 -05001705 deps += [
mtklein6f5df6a2016-08-29 16:01:10 -07001706 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001707 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001708 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001709 }
halcanary19a97202016-08-03 15:08:04 -07001710 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001711 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001712 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001713 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001714 ]
1715 deps = [
1716 ":skia",
Hal Canary96c57252018-02-09 11:43:05 -05001717 ":skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001718 ]
halcanary3eee9d92016-09-10 07:01:53 -07001719 }
mtklein046cb562016-09-16 10:23:12 -07001720
Matt Sarett9f1c4032017-05-17 10:06:32 -04001721 test_app("create_flutter_test_images") {
1722 sources = [
1723 "tools/create_flutter_test_images.cpp",
1724 ]
1725 deps = [
1726 ":skia",
1727 ":tool_utils",
1728 ]
1729 }
1730
Ben Wagner219f3622017-07-17 15:32:25 -04001731 test_app("create_test_font") {
1732 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001733 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001734 ]
1735 deps = [
1736 ":skia",
1737 ]
1738 assert_no_deps = [
1739 # tool_utils requires the output of this app.
1740 ":tool_utils",
1741 ]
1742 }
1743
Ben Wagner97182cc2018-02-15 10:20:04 -05001744 test_app("create_test_font_color") {
1745 sources = [
1746 "tools/fonts/create_test_font_color.cpp",
1747 ]
1748 deps = [
1749 ":flags",
1750 ":skia",
Florin Malitac659c2c2018-04-05 11:57:21 -04001751 ":tool_utils",
Ben Wagner97182cc2018-02-15 10:20:04 -05001752 ]
1753 }
1754
Mike Kleine6682eb2017-01-05 10:54:57 -05001755 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001756 sources = [
1757 "tools/get_images_from_skps.cpp",
1758 ]
1759 deps = [
1760 ":flags",
1761 ":skia",
1762 "//third_party/jsoncpp",
1763 ]
mtklein046cb562016-09-16 10:23:12 -07001764 }
mtkleinecbc5262016-09-22 11:51:24 -07001765
Kevin Lubickebf648e2017-09-21 13:45:16 -04001766 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001767 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001768 sources = [
1769 "tools/skiaserve/Request.cpp",
1770 "tools/skiaserve/Response.cpp",
1771 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001772 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1773 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1774 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1775 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1776 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1777 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1778 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1779 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1780 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001781 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1782 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001783 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1784 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1785 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1786 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1787 ]
1788 deps = [
1789 ":flags",
1790 ":gpu_tool_utils",
1791 ":skia",
1792 ":tool_utils",
1793 "//third_party/jsoncpp",
1794 "//third_party/libmicrohttpd",
1795 "//third_party/libpng",
1796 ]
Mike Klein7d302882016-11-03 14:06:31 -04001797 }
mtkleinecbc5262016-09-22 11:51:24 -07001798 }
kjlubick14f984b2016-10-03 11:49:45 -07001799
Mike Kleine6682eb2017-01-05 10:54:57 -05001800 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001801 include_dirs = [
1802 "tools",
1803 "tools/debugger",
1804 ]
kjlubick14f984b2016-10-03 11:49:45 -07001805 sources = [
Hal Canary24ac42b2017-02-14 13:35:14 -05001806 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001807 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001808 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001809 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001810 "fuzz/FuzzGradients.cpp",
1811 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001812 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001813 "fuzz/FuzzPathop.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001814 "fuzz/FuzzRegionOp.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001815 "fuzz/fuzz.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001816 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1817 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001818 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
1819 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001820 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1821 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001822 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001823 "tools/UrlDataManager.cpp",
1824 "tools/debugger/SkDebugCanvas.cpp",
1825 "tools/debugger/SkDrawCommand.cpp",
1826 "tools/debugger/SkJsonWriteBuffer.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001827 "tools/picture_utils.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001828 ]
1829 deps = [
Kevin Lubick9eeede22018-05-03 16:26:10 -04001830 ":experimental_skottie",
kjlubick14f984b2016-10-03 11:49:45 -07001831 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001832 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001833 ":skia",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001834 "//third_party/jsoncpp",
1835 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001836 ]
Florin Malita0b0d93d2018-05-04 15:01:03 -04001837
1838 if (skia_enable_skottie) {
1839 sources += [ "fuzz/oss_fuzz/FuzzSkottieJSON.cpp" ]
1840 }
kjlubick14f984b2016-10-03 11:49:45 -07001841 }
Mike Klein38312422016-10-05 15:41:01 -04001842
Mike Kleine6682eb2017-01-05 10:54:57 -05001843 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001844 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001845 rebase_path("tests/skia_test.cpp"),
1846 rebase_path("tests/Test.cpp"),
1847 ]
caryclark9feb6322016-10-25 08:58:26 -07001848 deps = [
1849 ":flags",
1850 ":gpu_tool_utils",
1851 ":skia",
1852 ":tool_utils",
1853 ]
caryclark9feb6322016-10-25 08:58:26 -07001854 }
1855
Mike Kleine6682eb2017-01-05 10:54:57 -05001856 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001857 sources = [
1858 "tools/DumpRecord.cpp",
1859 "tools/dump_record.cpp",
1860 ]
1861 deps = [
1862 ":flags",
1863 ":skia",
1864 ]
Mike Klein38312422016-10-05 15:41:01 -04001865 }
bungemanfe917272016-10-13 17:36:40 -04001866
Mike Kleine6682eb2017-01-05 10:54:57 -05001867 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001868 sources = [
1869 "tools/skdiff/skdiff.cpp",
1870 "tools/skdiff/skdiff_html.cpp",
1871 "tools/skdiff/skdiff_main.cpp",
1872 "tools/skdiff/skdiff_utils.cpp",
1873 ]
1874 deps = [
1875 ":skia",
1876 ":tool_utils",
1877 ]
bungemanfe917272016-10-13 17:36:40 -04001878 }
halcanarya73d76a2016-10-17 13:19:02 -07001879
Mike Kleine6682eb2017-01-05 10:54:57 -05001880 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001881 sources = [
1882 "tools/skp_parser.cpp",
1883 ]
1884 deps = [
1885 ":skia",
1886 ":tool_utils",
1887 "//third_party/jsoncpp",
1888 ]
halcanarya73d76a2016-10-17 13:19:02 -07001889 }
Brian Osman16adfa32016-10-18 14:42:44 -04001890
Hal Canaryd7b38452017-12-11 17:46:26 -05001891 if (!is_win && skia_enable_gpu) {
1892 test_lib("skqp_lib") {
1893 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001894 defines =
1895 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001896 if (skia_skqp_enable_driver_correctness_workarounds) {
1897 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1898 }
Hal Canary75427132017-10-11 16:00:31 -04001899 sources = [
1900 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001901 "tools/skqp/gm_knowledge.cpp",
1902 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001903 ]
1904 deps = [
1905 ":gm",
1906 ":gpu_tool_utils",
1907 ":skia",
1908 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001909 ":tool_utils",
1910 ]
1911 }
1912 test_app("skqp") {
1913 sources = [
1914 "tools/skqp/skqp.cpp",
1915 ]
1916 deps = [
1917 ":skia",
1918 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001919 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001920 "//third_party/googletest",
1921 ]
1922 }
1923 }
Hal Canary28f89382017-12-12 09:42:14 -05001924 if (is_android && skia_enable_gpu) {
1925 test_app("skqp_app") {
1926 is_shared_library = true
1927 sources = [
1928 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1929 ]
1930 deps = [
1931 ":skia",
1932 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001933 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001934 ]
1935 libs = [ "android" ]
1936 }
1937 }
Hal Canary75427132017-10-11 16:00:31 -04001938
Hal Canarya9de7602018-01-19 13:08:23 -05001939 test_app("list_gms") {
1940 sources = [
1941 "tools/list_gms.cpp",
1942 ]
1943 deps = [
1944 ":gm",
1945 ":skia",
1946 ]
1947 }
1948 test_app("list_gpu_unit_tests") {
1949 sources = [
1950 "dm/DMGpuTestProcs.cpp",
1951 "tools/list_gpu_unit_tests.cpp",
1952 ]
1953 deps = [
1954 ":skia",
1955 ":tests",
1956 ]
1957 }
1958
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001959 if (skia_enable_gpu) {
Brian Osmaneff04b52017-11-21 13:18:02 -05001960 test_lib("sk_app") {
1961 public_include_dirs = [ "tools/sk_app" ]
Brian Osman16adfa32016-10-18 14:42:44 -04001962 sources = [
Brian Osmaneff04b52017-11-21 13:18:02 -05001963 "tools/sk_app/CommandSet.cpp",
1964 "tools/sk_app/GLWindowContext.cpp",
1965 "tools/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001966 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001967 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001968
Jim Van Verth4e56a912016-10-21 10:58:52 -04001969 if (is_android) {
1970 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001971 "tools/sk_app/android/GLWindowContext_android.cpp",
1972 "tools/sk_app/android/RasterWindowContext_android.cpp",
1973 "tools/sk_app/android/Window_android.cpp",
1974 "tools/sk_app/android/main_android.cpp",
1975 "tools/sk_app/android/surface_glue_android.cpp",
Jim Van Verth4e56a912016-10-21 10:58:52 -04001976 ]
Brian Osman462334e2017-02-09 11:22:57 -05001977 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001978 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001979 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001980 "tools/sk_app/unix/GLWindowContext_unix.cpp",
1981 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
1982 "tools/sk_app/unix/Window_unix.cpp",
Brian Osmanfa916272017-12-01 09:18:20 -05001983 "tools/sk_app/unix/keysym2ucs.c",
Brian Osmaneff04b52017-11-21 13:18:02 -05001984 "tools/sk_app/unix/main_unix.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001985 ]
Brian Osmanfa916272017-12-01 09:18:20 -05001986 libs += [
1987 "GL",
1988 "X11",
1989 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001990 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001991 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001992 "tools/sk_app/win/GLWindowContext_win.cpp",
1993 "tools/sk_app/win/RasterWindowContext_win.cpp",
1994 "tools/sk_app/win/Window_win.cpp",
1995 "tools/sk_app/win/main_win.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001996 ]
Brian Salomon194db172017-08-17 14:37:06 -04001997 if (skia_use_angle) {
Brian Osmaneff04b52017-11-21 13:18:02 -05001998 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04001999 }
Mike Klein43c25262016-10-20 10:17:47 -04002000 } else if (is_mac) {
2001 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002002 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2003 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2004 "tools/sk_app/mac/Window_mac.cpp",
2005 "tools/sk_app/mac/main_mac.cpp",
Mike Klein43c25262016-10-20 10:17:47 -04002006 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002007 libs += [
2008 "QuartzCore.framework",
2009 "Cocoa.framework",
2010 "Foundation.framework",
2011 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002012 } else if (is_ios) {
2013 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002014 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2015 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2016 "tools/sk_app/ios/Window_ios.cpp",
2017 "tools/sk_app/ios/main_ios.cpp",
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002018 ]
Brian Osman16adfa32016-10-18 14:42:44 -04002019 }
2020
2021 if (skia_use_vulkan) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002022 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002023 if (is_android) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002024 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002025 } else if (is_linux) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002026 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
Brian Osman2dd96932016-10-18 15:33:53 -04002027 libs += [ "X11-xcb" ]
2028 } else if (is_win) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002029 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Brian Osman16adfa32016-10-18 14:42:44 -04002030 }
2031 }
2032
Brian Osman16adfa32016-10-18 14:42:44 -04002033 deps = [
Brian Osman16adfa32016-10-18 14:42:44 -04002034 ":gpu_tool_utils",
Brian Osman16adfa32016-10-18 14:42:44 -04002035 ":skia",
2036 ":tool_utils",
2037 ":views",
Brian Osman16adfa32016-10-18 14:42:44 -04002038 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002039 if (is_android) {
2040 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002041 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04002042 deps += [ "//third_party/libsdl" ]
2043 }
Brian Salomon194db172017-08-17 14:37:06 -04002044 if (skia_use_angle) {
2045 deps += [ "//third_party/angle2" ]
2046 }
Mike Kleina92c3832016-12-08 09:49:39 -05002047 }
Brian Osman16adfa32016-10-18 14:42:44 -04002048 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002049
Brian Osmaneff04b52017-11-21 13:18:02 -05002050 if (skia_enable_gpu) {
2051 test_app("viewer") {
2052 is_shared_library = is_android
Jim Van Verth329c5a62017-11-29 11:42:33 -05002053 if (is_ios) {
2054 bundle_ios_data = true
2055 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002056 sources = [
Chris Dalton2d18f412018-02-20 13:23:32 -07002057 "tools/viewer/BisectSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002058 "tools/viewer/GMSlide.cpp",
Brian Osmand67e5182017-12-08 16:46:09 -05002059 "tools/viewer/ImGuiLayer.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002060 "tools/viewer/ImageSlide.cpp",
2061 "tools/viewer/SKPSlide.cpp",
2062 "tools/viewer/SampleSlide.cpp",
Florin Malita76a076b2018-02-15 18:40:48 -05002063 "tools/viewer/SlideDir.cpp",
Brian Osman56a24812017-12-19 11:15:16 -05002064 "tools/viewer/StatsLayer.cpp",
Florin Malitac659c2c2018-04-05 11:57:21 -04002065 "tools/viewer/SvgSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002066 "tools/viewer/Viewer.cpp",
2067 ]
2068 libs = []
2069
2070 include_dirs = []
2071 deps = [
Florin Malitabcd07232018-01-31 11:08:58 -05002072 ":experimental_sksg",
Florin Malitac659c2c2018-04-05 11:57:21 -04002073 ":experimental_svg_model",
Brian Osmaneff04b52017-11-21 13:18:02 -05002074 ":flags",
2075 ":gm",
2076 ":gpu_tool_utils",
2077 ":samples",
2078 ":sk_app",
2079 ":skia",
2080 ":tool_utils",
2081 ":views",
2082 "//third_party/imgui",
2083 "//third_party/jsoncpp",
2084 ]
Florin Malita87ccf332018-05-04 12:23:24 -04002085
2086 if (skia_enable_skottie) {
2087 sources += [ "tools/viewer/SkottieSlide.cpp" ]
2088 deps += [ ":experimental_skottie" ]
2089 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002090 }
2091 }
2092
2093 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
2094 test_app("HelloWorld") {
2095 sources = [
2096 "example/HelloWorld.cpp",
2097 ]
2098 libs = []
2099
2100 include_dirs = []
2101 deps = [
2102 ":flags",
2103 ":gpu_tool_utils",
2104 ":sk_app",
2105 ":skia",
2106 ":tool_utils",
2107 ":views",
2108 ]
2109 }
2110 }
2111
Jim Van Verthecfed2b2017-08-30 14:02:50 -04002112 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002113 test_app("SkiaSDLExample") {
2114 sources = [
2115 "example/SkiaSDLExample.cpp",
2116 ]
2117 libs = []
2118 include_dirs = []
2119 deps = [
2120 ":gpu_tool_utils",
2121 ":skia",
2122 "//third_party/libsdl",
2123 ]
2124 }
2125 }
2126
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002127 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2128 action_foreach("generate_mocs") {
2129 script = "gn/call.py"
2130 sources = [
2131 "tools/mdbviz/MainWindow.h",
2132 ]
2133 outputs = [
2134 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2135 ]
2136 args = [
2137 "$skia_qt_path" + "/bin/moc",
2138 "{{source}}",
2139 "-o",
2140 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2141 ]
2142 }
2143 action_foreach("generate_resources") {
2144 script = "gn/call.py"
2145 sources = [
2146 "tools/mdbviz/resources.qrc",
2147 ]
2148 outputs = [
2149 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2150 ]
2151 args = [
2152 "$skia_qt_path" + "/bin/rcc",
2153 "{{source}}",
2154 "-o",
2155 "gen/mdbviz/{{source_name_part}}_res.cpp",
2156 ]
2157 }
2158 test_app("mdbviz") {
2159 if (is_win) {
2160 # on Windows we need to disable some exception handling warnings due to the Qt headers
2161 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2162 }
2163 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002164 "tools/UrlDataManager.cpp",
2165 "tools/debugger/SkDebugCanvas.cpp",
2166 "tools/debugger/SkDrawCommand.cpp",
2167 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002168 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002169 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002170 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002171 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002172
2173 # generated files
2174 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2175 "$target_gen_dir/mdbviz/resources_res.cpp",
2176 ]
2177 lib_dirs = [ "$skia_qt_path/lib" ]
2178 libs = [
2179 "Qt5Core.lib",
2180 "Qt5Gui.lib",
2181 "Qt5Widgets.lib",
2182 ]
2183 include_dirs = [
2184 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002185 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002186 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002187 "tools",
2188 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002189 ]
2190 deps = [
2191 ":generate_mocs",
2192 ":generate_resources",
2193 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002194 "//third_party/jsoncpp",
2195 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002196 ]
2197 }
2198 }
2199
Mike Kleine459afd2017-03-03 09:21:30 -05002200 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002201 copy("gdbserver") {
2202 sources = [
2203 "$ndk/$ndk_gdbserver",
2204 ]
2205 outputs = [
2206 "$root_out_dir/gdbserver",
2207 ]
2208 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002209 }
mtklein25c81d42016-07-27 13:55:26 -07002210}