blob: 5488ed86d1ebffa34ba3d96ee486fbdf2c6d1b11 [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}
Greg Daniele5ddff52017-07-05 16:49:36 -0400110if (skia_use_metal) {
111 skia_public_includes += [ "include/gpu/mtl" ]
112}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000113
mtkleinc04ff472016-06-23 10:29:30 -0700114# Skia public API, generally provided by :skia.
115config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700116 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -0400117 defines = []
118 if (is_component_build) {
119 defines += [ "SKIA_DLL" ]
120 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400121 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700122 defines += [ "SK_SAMPLES_FOR_X" ]
123 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400124 if (skia_enable_flutter_defines) {
125 defines += flutter_defines
126 }
mtklein06c35c02016-09-20 12:28:12 -0700127 if (!skia_enable_gpu) {
128 defines += [ "SK_SUPPORT_GPU=0" ]
129 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500130 if (skia_enable_atlas_text) {
131 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
132 }
mtkleinc04ff472016-06-23 10:29:30 -0700133}
134
135# Skia internal APIs, used by Skia itself and a few test tools.
136config("skia_private") {
137 visibility = [ ":*" ]
138
139 include_dirs = [
140 "include/private",
141 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700142 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700143 "src/core",
144 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700145 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700146 "src/image",
147 "src/images",
148 "src/lazy",
149 "src/opts",
150 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700151 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700152 "src/ports",
153 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400154 "src/shaders",
155 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700156 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700157 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700158 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500159 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700160 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700161 ]
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400162 if (skia_llvm_path != "") {
163 include_dirs += [ "$skia_llvm_path/include" ]
164 }
mtklein150d1132016-08-01 06:56:40 -0700165
Mike Reeda9e241d2017-05-03 10:52:00 -0400166 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700167 if (is_android) {
168 defines += [
169 "SK_GAMMA_EXPONENT=1.4",
170 "SK_GAMMA_CONTRAST=0.0",
171 ]
172 }
mtklein88a7ac02016-09-14 11:16:49 -0700173 if (is_official_build || is_android) {
174 # TODO(bsalomon): it'd be nice to make Android normal.
175 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
176 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400177 libs = []
178 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500179 if (skia_enable_gpu) {
180 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500181 if (is_skia_dev_build && skia_use_vulkan) {
182 include_dirs += [ "tools/gpu/vk" ]
183 }
Brian Salomon03e05842017-02-23 12:23:47 -0500184 }
Brian Osman34755e22016-12-05 09:46:02 -0500185 if (skia_use_angle) {
186 defines += [ "SK_ANGLE" ]
187 }
Brian Osman3f375d02016-12-28 11:19:22 -0500188 if (skia_enable_discrete_gpu) {
189 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
190 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400191 if (!is_official_build) {
192 defines += [ "GR_TEST_UTILS=1" ]
193 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400194 if (skia_llvm_path != "") {
195 defines += [ "SK_LLVM_AVAILABLE" ]
196 include_dirs += [ "$skia_llvm_path/include" ]
197 libs += [ skia_llvm_lib ]
198 lib_dirs += [ "$skia_llvm_path/lib/" ]
199 }
mtkleinc04ff472016-06-23 10:29:30 -0700200}
201
202# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
203config("skia_library") {
204 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700205 defines = [ "SKIA_IMPLEMENTATION=1" ]
206}
207
208skia_library_configs = [
209 ":skia_public",
210 ":skia_private",
211 ":skia_library",
212]
213
mtklein9b8583d2016-08-24 17:32:30 -0700214# Use for CPU-specific Skia code that needs particular compiler flags.
215template("opts") {
216 if (invoker.enabled) {
217 source_set(target_name) {
218 forward_variables_from(invoker, "*")
219 configs += skia_library_configs
220 }
221 } else {
222 # If not enabled, a phony empty target that swallows all otherwise unused variables.
223 source_set(target_name) {
224 forward_variables_from(invoker,
225 "*",
226 [
227 "sources",
228 "cflags",
229 ])
230 }
231 }
anmittala7eaf2e2016-08-17 13:57:26 -0700232}
233
mtklein422310d2016-08-16 18:28:43 -0700234is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700235
mtklein7d6fb2c2016-08-25 14:50:44 -0700236opts("none") {
237 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700238 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700239 cflags = []
240}
241
mtklein7d6fb2c2016-08-25 14:50:44 -0700242opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700243 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700244 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700245 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700246}
247
248opts("arm64") {
249 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700250 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700251 cflags = []
252}
253
254opts("crc32") {
255 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700256 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700257 cflags = [ "-march=armv8-a+crc" ]
258}
259
mtklein9b8583d2016-08-24 17:32:30 -0700260opts("sse2") {
261 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700262 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400263 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400264 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
265 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400266 cflags = [ "-msse2" ]
267 }
mtklein9b8583d2016-08-24 17:32:30 -0700268}
mtkleinc04ff472016-06-23 10:29:30 -0700269
mtklein9b8583d2016-08-24 17:32:30 -0700270opts("ssse3") {
271 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700272 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400273 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400274 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
275 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400276 cflags = [ "-mssse3" ]
277 }
mtklein9b8583d2016-08-24 17:32:30 -0700278}
mtkleinc04ff472016-06-23 10:29:30 -0700279
mtklein9b8583d2016-08-24 17:32:30 -0700280opts("sse41") {
281 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700282 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400283 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400284 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
285 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400286 cflags = [ "-msse4.1" ]
287 }
mtklein9b8583d2016-08-24 17:32:30 -0700288}
mtklein4e976072016-08-08 09:06:27 -0700289
mtklein9b8583d2016-08-24 17:32:30 -0700290opts("sse42") {
291 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700292 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400293 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400294 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
295 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400296 cflags = [ "-msse4.2" ]
297 }
mtklein9b8583d2016-08-24 17:32:30 -0700298}
299
300opts("avx") {
301 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700302 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400303 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000304 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400305 } else {
306 cflags = [ "-mavx" ]
307 }
mtkleinc04ff472016-06-23 10:29:30 -0700308}
309
Mike Klein1b9b7d52018-02-27 10:37:40 -0500310opts("hsw") {
311 enabled = is_x86
312 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400313 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500314 cflags = [ "/arch:AVX2" ]
315 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000316 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500317 }
318
319 # Oddly, clang-cl doesn't recognize this as a valid flag.
320 # If it ever does, it'd nice to move this up with -mavx2 and co.
321 if (is_clang && !is_win) {
322 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
323 # but nice to have, generating slightly better code for paths without explicit FMAs.
324 cflags += [ "-ffp-contract=fast" ]
325 }
326}
327
mtkleinc095df52016-08-24 12:23:52 -0700328# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700329template("optional") {
330 if (invoker.enabled) {
331 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700332 if (defined(invoker.public_defines)) {
333 defines = invoker.public_defines
334 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600335 if (defined(invoker.public_configs)) {
336 configs = invoker.public_configs
337 }
mtklein457b42a2016-08-23 13:56:37 -0700338 }
339 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700340 forward_variables_from(invoker,
341 "*",
342 [
343 "public_defines",
344 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700345 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700346 ])
mtklein457b42a2016-08-23 13:56:37 -0700347 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700348 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700349 if (defined(invoker.configs_to_remove)) {
350 configs -= invoker.configs_to_remove
351 }
mtklein457b42a2016-08-23 13:56:37 -0700352 }
353 } else {
mtklein457b42a2016-08-23 13:56:37 -0700354 source_set(target_name) {
355 forward_variables_from(invoker,
356 "*",
357 [
358 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400359 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700360 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700361 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700362 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700363 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700364 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700365 ])
mtkleincd01b032016-08-31 04:58:19 -0700366 if (defined(invoker.sources_when_disabled)) {
367 sources = invoker.sources_when_disabled
368 }
369 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700370 }
mtkleineb3c4252016-08-23 07:38:09 -0700371 }
mtklein457b42a2016-08-23 13:56:37 -0700372}
mtklein457b42a2016-08-23 13:56:37 -0700373
Mike Kleina04bb452017-02-09 12:24:07 -0500374optional("effects") {
375 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400376 deps = [
377 ":compile_processors",
378 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500379 sources =
380 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
381 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
382}
383
mtkleina45be612016-08-29 15:22:10 -0700384optional("fontmgr_android") {
385 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700386
387 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500388 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700389 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700390 ]
391 sources = [
392 "src/ports/SkFontMgr_android.cpp",
393 "src/ports/SkFontMgr_android_factory.cpp",
394 "src/ports/SkFontMgr_android_parser.cpp",
395 ]
396}
397
mtkleind2e39db2016-09-07 07:52:55 -0700398optional("fontmgr_custom") {
399 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
400
401 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500402 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700403 ]
404 sources = [
405 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500406 "src/ports/SkFontMgr_custom.h",
407 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700408 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500409 "src/ports/SkFontMgr_custom_embedded.cpp",
410 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700411 ]
412}
413
Hal Canaryff2742e2018-01-30 11:35:47 -0500414optional("fontmgr_empty") {
415 enabled = skia_enable_fontmgr_empty
416 sources = [
417 "src/ports/SkFontMgr_empty_factory.cpp",
418 ]
419}
420
mtklein3cc22182016-08-29 13:26:14 -0700421optional("fontmgr_fontconfig") {
422 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700423
424 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500425 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700426 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700427 ]
428 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700429 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700430 "src/ports/SkFontConfigInterface_direct.cpp",
431 "src/ports/SkFontConfigInterface_direct_factory.cpp",
432 "src/ports/SkFontMgr_FontConfigInterface.cpp",
433 "src/ports/SkFontMgr_fontconfig.cpp",
434 "src/ports/SkFontMgr_fontconfig_factory.cpp",
435 ]
436}
437
mtkleincdedd0e2016-09-12 15:15:44 -0700438optional("fontmgr_fuchsia") {
439 enabled = is_fuchsia && skia_use_freetype
440
441 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500442 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700443 ]
444 sources = [
445 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500446 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700447 "src/ports/SkFontMgr_custom_empty_factory.cpp",
448 ]
449}
450
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700451if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400452 executable("sksllex") {
453 sources = [
454 "src/sksl/lex/Main.cpp",
455 "src/sksl/lex/NFA.cpp",
456 "src/sksl/lex/RegexNode.cpp",
457 "src/sksl/lex/RegexParser.cpp",
458 ]
459 include_dirs = [ "src/sksl/lex" ]
460 }
461
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700462 action("run_sksllex") {
463 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400464 deps = [
465 ":sksllex(//gn/toolchain:$host_toolchain)",
466 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700467 sources = [
468 "src/sksl/lex/layout.lex",
469 "src/sksl/lex/sksl.lex",
470 ]
471
472 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
473 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
474 outputs = [
475 "$target_out_dir/" +
476 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
477 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
478 # confused due to the same file being named by two different paths
479 ]
480 sksllex_path = "$root_out_dir/"
481 sksllex_path += "sksllex"
482 if (host_os == "win") {
483 sksllex_path += ".exe"
484 }
485 args = [
486 rebase_path(sksllex_path),
487 rebase_path("bin/clang-format"),
488 rebase_path("src"),
489 ]
490 }
491} else {
492 group("run_sksllex") {
493 }
494}
495
496if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400497 executable("skslc") {
498 defines = [ "SKSL_STANDALONE" ]
499 sources = [
500 "src/sksl/SkSLMain.cpp",
501 ]
502 sources += skia_sksl_sources
503 include_dirs = [
504 "src/gpu",
505 "src/sksl",
506 ]
507 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500508 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400509 "//third_party/spirv-tools",
510 ]
511 }
512
513 skia_gpu_processor_outputs = []
514 foreach(src, skia_gpu_processor_sources) {
515 dir = get_path_info(src, "dir")
516 name = get_path_info(src, "name")
517
518 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
519 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
520 skia_gpu_processor_outputs += [
521 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
522 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
523 # confused due to the same file being named by two different paths
524 ]
525 }
526
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500527 action("create_sksl_enums") {
528 script = "gn/create_sksl_enums.py"
529 sources = [
530 "include/private/GrSharedEnums.h",
531 ]
532 outputs = [
533 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500534 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500535 ]
536 args = [
537 rebase_path(sources[0]),
538 rebase_path(outputs[0]),
539 ]
540 }
541
Ethan Nicholas762466e2017-06-29 10:03:38 -0400542 action("compile_processors") {
543 script = "gn/compile_processors.py"
544 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500545 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400546 ":skslc(//gn/toolchain:$host_toolchain)",
547 ]
548 sources = skia_gpu_processor_sources
549 outputs = skia_gpu_processor_outputs
550 skslc_path = "$root_out_dir/"
551 if (host_toolchain != default_toolchain_name) {
552 skslc_path += "$host_toolchain/"
553 }
554 skslc_path += "skslc"
555 if (host_os == "win") {
556 skslc_path += ".exe"
557 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400558 args = [
559 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400560 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400561 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400562 args += rebase_path(skia_gpu_processor_sources)
563 }
564} else {
565 skia_gpu_processor_outputs = []
566 group("compile_processors") {
567 }
568}
569
mtklein06c35c02016-09-20 12:28:12 -0700570optional("gpu") {
571 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400572 deps = [
573 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700574 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400575 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700576 if (skia_generate_workarounds) {
577 deps += [ ":workaround_list" ]
578 }
mtkleine9fb3d52016-09-20 15:11:46 -0700579 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600580 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400581 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700582
Brian Salomon3d6801e2017-12-11 10:06:31 -0500583 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700584
585 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500586 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700587 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400588 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700589 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400590 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400591
592 # this lib is required to link against AHardwareBuffer
593 if (defined(ndk_api) && ndk_api >= 26) {
594 libs += [ "android" ]
595 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400596 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500597 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400598 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700599 } else if (is_linux) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500600 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500601 libs += [
602 "GL",
603 "GLU",
604 ]
mtklein06c35c02016-09-20 12:28:12 -0700605 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500606 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800607 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500608 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400609 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500610 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400611 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700612 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500613 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700614 }
mtkleine9fb3d52016-09-20 15:11:46 -0700615
616 if (skia_use_vulkan) {
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400617 # TODO: We should make this deps be //third_party/vulkan and then update clients to have a
618 # //third_party/vulkan directory in their trees so they can set up the vulkan library however
619 # they want. For example this would allow us to remove the fuchsia specific vulkan code in our
620 # vulkan files.
621 public_deps += [ "third_party/vulkan" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700622 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700623 if (skia_enable_vulkan_debug_layers) {
624 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
625 }
mtkleine9fb3d52016-09-20 15:11:46 -0700626 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400627
Brian Salomon5f33a8c2018-02-26 14:32:39 -0500628 if (skia_use_legacy_gpu_pixel_ops) {
629 public_defines += [ "SK_LEGACY_GPU_PIXEL_OPS" ]
630 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400631 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400632 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400633 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
634 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400635
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400636 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400637 if (skia_use_metal) {
638 public_defines += [ "SK_METAL" ]
639 sources += skia_metal_sources
640 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400641 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400642 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500643
644 if (skia_enable_atlas_text) {
645 sources += skia_atlas_text_sources
646 }
mtklein06c35c02016-09-20 12:28:12 -0700647}
648
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400649optional("heif") {
650 enabled = skia_use_libheif
651 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
652
653 deps = []
654
655 sources = [
656 "src/codec/SkHeifCodec.cpp",
657 ]
658}
659
mtklein63213812016-08-24 09:55:56 -0700660optional("jpeg") {
661 enabled = skia_use_libjpeg_turbo
662 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
663
mtklein63213812016-08-24 09:55:56 -0700664 deps = [
665 "//third_party/libjpeg-turbo:libjpeg",
666 ]
667 sources = [
668 "src/codec/SkJpegCodec.cpp",
669 "src/codec/SkJpegDecoderMgr.cpp",
670 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700671 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400672 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700673 ]
674}
675
676optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500677 enabled = skia_use_zlib && skia_enable_pdf
678 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700679
mtklein63213812016-08-24 09:55:56 -0700680 deps = [
681 "//third_party/zlib",
682 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400683 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700684 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400685 }
brettwb9447282016-09-01 14:24:39 -0700686 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700687 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700688
689 if (skia_use_sfntly) {
690 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500691 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700692 }
693}
694
695optional("png") {
696 enabled = skia_use_libpng
697 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
698
mtklein63213812016-08-24 09:55:56 -0700699 deps = [
700 "//third_party/libpng",
701 ]
702 sources = [
703 "src/codec/SkIcoCodec.cpp",
704 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400705 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700706 ]
707}
708
scroggof84ad642016-10-31 09:02:57 -0700709optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400710 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700711 public_defines = [ "SK_CODEC_DECODES_RAW" ]
712
713 deps = [
714 "//third_party/dng_sdk",
715 "//third_party/libjpeg-turbo:libjpeg",
716 "//third_party/piex",
717 ]
718
719 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
720 # Skia.
721 configs_to_remove = [ "//gn:no_exceptions" ]
722
723 sources = [
724 "src/codec/SkRawAdapterCodec.cpp",
725 "src/codec/SkRawCodec.cpp",
726 ]
727}
728
Mike Klein852a8cb2018-05-15 10:46:58 -0400729import("third_party/skcms/skcms.gni")
730config("third_party_skcms_public") {
731 include_dirs = [ "third_party/skcms" ]
732}
733source_set("third_party_skcms") {
734 public_configs = [ ":third_party_skcms_public" ]
735
736 cflags = []
737 if (!is_win || is_clang) {
738 cflags += [
739 "-w",
740 "-std=c11",
741 ]
742 }
743
744 public = [
745 "third_party/skcms/skcms.h",
746 ]
747 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
748}
749
Mike Kleinfb333552018-01-25 12:49:37 -0500750optional("skcms") {
751 enabled = skia_use_skcms
752
Brian Osman094fba92018-03-26 17:05:48 -0400753 public_defines = [ "SK_USE_SKCMS" ]
Mike Kleinfb333552018-01-25 12:49:37 -0500754 deps = [
Mike Klein852a8cb2018-05-15 10:46:58 -0400755 ":third_party_skcms",
Mike Kleinfb333552018-01-25 12:49:37 -0500756 ]
757 sources = [
Brian Osman094fba92018-03-26 17:05:48 -0400758 "src/core/SkColorSpaceXform_skcms.cpp",
Mike Kleinfb333552018-01-25 12:49:37 -0500759 ]
760}
761
mtklein3cc22182016-08-29 13:26:14 -0700762optional("typeface_freetype") {
763 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700764
765 deps = [
766 "//third_party/freetype2",
767 ]
768 sources = [
769 "src/ports/SkFontHost_FreeType.cpp",
770 "src/ports/SkFontHost_FreeType_common.cpp",
771 ]
772}
773
mtklein457b42a2016-08-23 13:56:37 -0700774optional("webp") {
775 enabled = skia_use_libwebp
776 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
777
mtklein457b42a2016-08-23 13:56:37 -0700778 deps = [
779 "//third_party/libwebp",
780 ]
781 sources = [
782 "src/codec/SkWebpAdapterCodec.cpp",
783 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400784 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700785 ]
mtkleineb3c4252016-08-23 07:38:09 -0700786}
787
mtklein63213812016-08-24 09:55:56 -0700788optional("xml") {
789 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000790 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700791
mtklein63213812016-08-24 09:55:56 -0700792 deps = [
793 "//third_party/expat",
794 ]
795 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500796 "src/svg/SkSVGCanvas.cpp",
797 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700798 "src/xml/SkDOM.cpp",
799 "src/xml/SkXMLParser.cpp",
800 "src/xml/SkXMLWriter.cpp",
801 ]
802}
803
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700804if (skia_enable_gpu && skia_generate_workarounds) {
805 action("workaround_list") {
806 script = "tools/build_workaround_header.py"
807
808 inputs = [
809 "src/gpu/gpu_workaround_list.txt",
810 ]
811
812 # see comments in skia_compile_processors about out dir path shenanigans.
813 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700814 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700815
816 outputs = [
817 "$root_out_dir/$output_file",
818 ]
819 args = [
820 "--output-file",
821 "$output_file",
822 ]
823
824 foreach(file, inputs) {
825 args += [ rebase_path(file, root_build_dir) ]
826 }
827 }
828}
829
mtkleinc04ff472016-06-23 10:29:30 -0700830component("skia") {
831 public_configs = [ ":skia_public" ]
832 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700833
834 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700835 ":arm64",
836 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700837 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700838 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500839 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700840 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700841 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500842 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700843 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700844 ":fontmgr_fuchsia",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400845 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500846 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700847 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700848 ":none",
mtklein63213812016-08-24 09:55:56 -0700849 ":pdf",
850 ":png",
scroggof84ad642016-10-31 09:02:57 -0700851 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500852 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700853 ":sse2",
854 ":sse41",
855 ":sse42",
856 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700857 ":webp",
mtklein63213812016-08-24 09:55:56 -0700858 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700859 ]
860
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400861 # We need the public deps here for Vulkan. Our third_party/vulkan target sets some defines that
862 # need to get propagated up to the tools that depend on :skia and thus :gpu.
863 public_deps = [
864 ":gpu",
865 ]
866
Chinmay Garde43f115c2016-11-16 15:04:12 -0800867 # This file (and all GN files in Skia) are designed to work with an
868 # empty sources assignment filter; we handle all that explicitly.
869 # We clear the filter here for clients who may have set up a global filter.
870 set_sources_assignment_filter([])
871
mtkleinc04ff472016-06-23 10:29:30 -0700872 sources = []
brettwb9447282016-09-01 14:24:39 -0700873 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700874 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500875 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700876 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400877 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500878 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700879 "src/android/SkBitmapRegionCodec.cpp",
880 "src/android/SkBitmapRegionDecoder.cpp",
881 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400882 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700883 "src/codec/SkBmpCodec.cpp",
884 "src/codec/SkBmpMaskCodec.cpp",
885 "src/codec/SkBmpRLECodec.cpp",
886 "src/codec/SkBmpStandardCodec.cpp",
887 "src/codec/SkCodec.cpp",
888 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700889 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700890 "src/codec/SkMaskSwizzler.cpp",
891 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700892 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700893 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700894 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700895 "src/codec/SkSwizzler.cpp",
896 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700897 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700898 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700899 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700900 "src/ports/SkMemory_malloc.cpp",
901 "src/ports/SkOSFile_stdio.cpp",
902 "src/sfnt/SkOTTable_name.cpp",
903 "src/sfnt/SkOTUtils.cpp",
904 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700905 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700906 ]
brettwb9447282016-09-01 14:24:39 -0700907
mtklein7d6fb2c2016-08-25 14:50:44 -0700908 libs = []
909
mtkleinc04ff472016-06-23 10:29:30 -0700910 if (is_win) {
911 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400912 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700913 "src/ports/SkDebug_win.cpp",
914 "src/ports/SkFontHost_win.cpp",
915 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500916 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700917 "src/ports/SkImageEncoder_WIC.cpp",
918 "src/ports/SkImageGeneratorWIC.cpp",
919 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700920 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700921 "src/ports/SkScalerContext_win_dw.cpp",
922 "src/ports/SkTLS_win.cpp",
923 "src/ports/SkTypeface_win_dw.cpp",
924 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400925 libs += [
926 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500927 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400928 "Ole32.lib",
929 "OleAut32.lib",
930 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500931 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400932 ]
mtkleinc04ff472016-06-23 10:29:30 -0700933 } else {
934 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700935 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700936 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700937 "src/ports/SkTLS_pthread.cpp",
938 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400939 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700940 }
941
mtklein7d6fb2c2016-08-25 14:50:44 -0700942 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500943 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500944 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500945 deps += [ "//third_party/cpu-features" ]
946 }
mtklein06c35c02016-09-20 12:28:12 -0700947 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700948 libs += [
949 "EGL",
950 "GLESv2",
951 "log",
952 ]
953 }
954
mtkleinc04ff472016-06-23 10:29:30 -0700955 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700956 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400957 if (skia_use_egl) {
958 libs += [ "GLESv2" ]
959 }
mtkleinc04ff472016-06-23 10:29:30 -0700960 }
961
962 if (is_mac) {
963 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700964 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700965 "src/ports/SkFontHost_mac.cpp",
966 "src/ports/SkImageEncoder_CG.cpp",
967 "src/ports/SkImageGeneratorCG.cpp",
968 ]
mtklein09e61f72016-08-23 13:35:28 -0700969 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400970 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
971 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700972 "ApplicationServices.framework",
973 "OpenGL.framework",
974 ]
mtkleinc04ff472016-06-23 10:29:30 -0700975 }
abarth6fc8ff02016-07-15 15:15:15 -0700976
Mike Klein7d302882016-11-03 14:06:31 -0400977 if (is_ios) {
978 sources += [
979 "src/ports/SkDebug_stdio.cpp",
980 "src/ports/SkFontHost_mac.cpp",
981 "src/ports/SkImageEncoder_CG.cpp",
982 "src/ports/SkImageGeneratorCG.cpp",
983 ]
984 libs += [
985 "CoreFoundation.framework",
986 "CoreGraphics.framework",
987 "CoreText.framework",
988 "ImageIO.framework",
989 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400990
991 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
992 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400993 ]
994 }
995
abarth6fc8ff02016-07-15 15:15:15 -0700996 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700997 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700998 }
mtkleinc04ff472016-06-23 10:29:30 -0700999}
1000
mtkleinc095df52016-08-24 12:23:52 -07001001# Targets guarded by skia_enable_tools may use //third_party freely.
1002if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001003 # Used by gn_to_bp.py to list our public include dirs.
1004 source_set("public") {
1005 configs += [ ":skia_public" ]
1006 }
1007
Mike Kleinc36dedf2016-11-18 09:35:28 -05001008 config("skia.h_config") {
1009 include_dirs = [ "$target_gen_dir" ]
Greg Danielafb7ec72017-12-07 12:48:30 -05001010 if (skia_use_vulkan) {
1011 # So we can get the header which includes vulkan
1012 include_dirs += [ "tools/gpu/vk" ]
1013 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001014 }
1015 action("skia.h") {
1016 public_configs = [ ":skia.h_config" ]
1017 skia_h = "$target_gen_dir/skia.h"
1018 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -04001019 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +00001020 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001021 depfile = "$skia_h.deps"
1022 outputs = [
1023 skia_h,
1024 ]
1025 }
1026
1027 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001028 executable("fiddle") {
1029 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001030 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001031 "tools/fiddle/draw.cpp",
1032 "tools/fiddle/fiddle_main.cpp",
1033 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001034
1035 if (skia_use_egl) {
1036 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001037 } else {
1038 sources += [ "tools/fiddle/null_context.cpp" ]
1039 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001040 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001041 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001042 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001043 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001044 ":skia",
1045 ":skia.h",
1046 ]
1047 }
1048 }
1049
1050 if (skia_enable_gpu) {
1051 source_set("public_headers_warnings_check") {
1052 sources = [
1053 "tools/public_headers_warnings_check.cpp",
1054 ]
1055 configs -= [ "//gn:warnings_except_public_headers" ]
1056 deps = [
1057 ":skia",
1058 ":skia.h",
1059 ]
1060 }
1061 }
1062
mtkleinc095df52016-08-24 12:23:52 -07001063 template("test_lib") {
1064 config(target_name + "_config") {
1065 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001066 if (defined(invoker.public_defines)) {
1067 defines = invoker.public_defines
1068 }
mtklein25c81d42016-07-27 13:55:26 -07001069 }
mtkleinc095df52016-08-24 12:23:52 -07001070 source_set(target_name) {
1071 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1072 public_configs = [
1073 ":" + target_name + "_config",
1074 ":skia_private",
1075 ]
1076
1077 if (!defined(deps)) {
1078 deps = []
1079 }
1080 deps += [ ":skia" ]
1081 testonly = true
1082 }
mtklein25c81d42016-07-27 13:55:26 -07001083 }
mtklein25c81d42016-07-27 13:55:26 -07001084
Mike Kleine6682eb2017-01-05 10:54:57 -05001085 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001086 if (is_ios) {
1087 app_name = target_name
1088 gen_path = target_gen_dir
1089
1090 action("${app_name}_generate_info_plist") {
1091 script = "//gn/gen_plist_ios.py"
1092 outputs = [
1093 "$gen_path/${app_name}_Info.plist",
1094 ]
1095 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1096 }
1097
1098 bundle_data("${app_name}_bundle_info_plist") {
1099 public_deps = [
1100 ":${app_name}_generate_info_plist",
1101 ]
1102 sources = [
1103 "$gen_path/${app_name}_Info.plist",
1104 ]
1105 outputs = [
1106 "{{bundle_root_dir}}/Info.plist",
1107 ]
1108 }
1109
Jim Van Verth329c5a62017-11-29 11:42:33 -05001110 bundle_ios_data =
1111 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1112
1113 if (bundle_ios_data) {
1114 has_skps =
1115 "True" == exec_script("//gn/checkdir.py",
1116 [ rebase_path("skps", root_build_dir) ],
1117 "trim string")
1118 bundle_data("${app_name}_bundle_resources") {
1119 sources = [
1120 "resources",
1121 ]
1122 outputs = [
1123 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1124 "{{bundle_resources_dir}}/data/resources",
1125 ]
1126 }
1127
1128 if (has_skps) {
1129 bundle_data("${app_name}_bundle_skps") {
1130 sources = [
1131 "skps",
1132 ]
1133 outputs = [
1134 # Store in same folder as resources
1135 "{{bundle_resources_dir}}/data/skps",
1136 ]
1137 }
1138 }
1139 }
1140
Jim Van Verth443a9132017-11-28 09:45:26 -05001141 executable("${app_name}_generate_executable") {
1142 forward_variables_from(invoker,
1143 "*",
1144 [
1145 "output_name",
1146 "visibility",
1147 "is_shared_library",
1148 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001149 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001150 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001151 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1152 }
1153
1154 bundle_data("${app_name}_bundle_executable") {
1155 public_deps = [
1156 ":${app_name}_generate_executable",
1157 ]
1158 sources = [
1159 "$gen_path/$app_name",
1160 ]
1161 outputs = [
1162 "{{bundle_executable_dir}}/$app_name",
1163 ]
1164 testonly = true
1165 }
1166
1167 create_bundle("$app_name") {
1168 product_type = "com.apple.product-type.application"
1169 testonly = true
1170
1171 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1172 bundle_resources_dir = bundle_root_dir
1173 bundle_executable_dir = bundle_root_dir
1174 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1175
1176 deps = [
1177 ":${app_name}_bundle_executable",
1178 ":${app_name}_bundle_info_plist",
1179 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001180 if (bundle_ios_data) {
1181 deps += [ ":${app_name}_bundle_resources" ]
1182 if (has_skps) {
1183 deps += [ ":${app_name}_bundle_skps" ]
1184 }
1185 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001186
1187 # should only code sign when running on a device, not the simulator
1188 if (target_cpu != "x64") {
1189 code_signing_script = "//gn/codesign_ios.py"
1190 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1191 code_signing_outputs = [
1192 "$bundle_root_dir/_CodeSignature/CodeResources",
1193 "$bundle_root_dir/embedded.mobileprovision",
1194 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001195 code_signing_args = [
1196 rebase_path("$bundle_root_dir", root_build_dir),
1197 skia_ios_identity,
1198 skia_ios_profile,
1199 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001200 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001201 }
1202 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001203 # !is_ios
1204
1205 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1206 shared_library("lib" + target_name) {
1207 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1208 configs += [ ":skia_private" ]
1209 testonly = true
1210 }
1211 } else {
1212 _executable = target_name
1213 executable(_executable) {
1214 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1215 configs += [ ":skia_private" ]
1216 testonly = true
1217 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001218 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001219 if (is_android && skia_android_serial != "" && defined(_executable)) {
1220 action("push_" + target_name) {
1221 script = "gn/push_to_android.py"
1222 deps = [
1223 ":" + _executable,
1224 ]
1225 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1226 outputs = [
1227 _stamp,
1228 ]
1229 args = [
1230 rebase_path("$root_build_dir/$_executable"),
1231 skia_android_serial,
1232 rebase_path(_stamp),
1233 ]
1234 testonly = true
1235 }
Mike Klein7d921032017-01-05 12:20:41 -05001236 }
1237 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001238 }
1239
mtkleinc095df52016-08-24 12:23:52 -07001240 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001241 public_include_dirs = []
1242 if (skia_enable_gpu) {
1243 public_defines = []
1244 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001245
1246 deps = []
mtklein38925aa2016-09-21 10:11:25 -07001247 sources = [
1248 "tools/gpu/GrContextFactory.cpp",
1249 "tools/gpu/GrTest.cpp",
Brian Salomon58389b92018-03-07 13:01:25 -05001250 "tools/gpu/ProxyUtils.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001251 "tools/gpu/TestContext.cpp",
Brian Salomoncbcb0a12017-11-19 13:20:13 -05001252 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001253 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001254 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001255 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1256 "tools/gpu/gl/debug/GrBufferObj.cpp",
1257 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1258 "tools/gpu/gl/debug/GrProgramObj.cpp",
1259 "tools/gpu/gl/debug/GrShaderObj.cpp",
1260 "tools/gpu/gl/debug/GrTextureObj.cpp",
1261 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1262 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001263 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001264 ]
1265 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001266
Kevin Lubick4a24e102017-03-29 11:19:01 -04001267 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001268 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001269 } else if (is_ios) {
1270 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1271 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001272 } else if (is_linux) {
1273 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001274 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001275 } else if (is_mac) {
1276 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001277 } else if (is_win) {
1278 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1279 libs += [
1280 "Gdi32.lib",
1281 "OpenGL32.lib",
1282 ]
mtklein38925aa2016-09-21 10:11:25 -07001283 }
mtklein6ef69992016-09-14 06:12:09 -07001284
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001285 cflags_objcc = [ "-fobjc-arc" ]
1286
Mike Kleinc168a3a2016-11-14 14:53:13 +00001287 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001288 deps += [ "//third_party/angle2" ]
1289 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1290 }
mtkleind68f9b02016-09-23 13:18:41 -07001291 if (skia_use_vulkan) {
1292 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001293 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001294 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001295 if (skia_use_metal) {
1296 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1297 }
mtkleina627b5c2016-09-20 13:36:47 -07001298 }
mtklein25c81d42016-07-27 13:55:26 -07001299 }
mtklein25c81d42016-07-27 13:55:26 -07001300
mtkleinc095df52016-08-24 12:23:52 -07001301 test_lib("flags") {
1302 public_include_dirs = [ "tools/flags" ]
1303 sources = [
1304 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001305 ]
1306 }
1307 test_lib("common_flags") {
1308 public_include_dirs = [ "tools/flags" ]
1309 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001310 "tools/flags/SkCommonFlags.cpp",
1311 "tools/flags/SkCommonFlagsConfig.cpp",
1312 ]
1313 deps = [
mtklein046cb562016-09-16 10:23:12 -07001314 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001315 ":gpu_tool_utils",
1316 ]
1317 }
mtklein25c81d42016-07-27 13:55:26 -07001318
mtkleinc095df52016-08-24 12:23:52 -07001319 test_lib("tool_utils") {
1320 public_include_dirs = [
1321 "tools",
1322 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001323 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001324 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001325 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001326 ]
1327 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001328 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001329 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001330 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001331 "tools/ProcStats.cpp",
1332 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001333 "tools/UrlDataManager.cpp",
1334 "tools/debugger/SkDebugCanvas.cpp",
1335 "tools/debugger/SkDrawCommand.cpp",
1336 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001337 "tools/fonts/SkRandomScalerContext.cpp",
1338 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001339 "tools/fonts/SkTestFontMgr.h",
1340 "tools/fonts/SkTestSVGTypeface.cpp",
1341 "tools/fonts/SkTestSVGTypeface.h",
1342 "tools/fonts/SkTestTypeface.cpp",
1343 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001344 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001345 "tools/picture_utils.cpp",
1346 "tools/random_parse_path.cpp",
1347 "tools/sk_tool_utils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001348 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001349 "tools/trace/SkChromeTracingTracer.cpp",
1350 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001351 "tools/trace/SkDebugfTracer.cpp",
1352 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001353 "tools/trace/SkEventTracingPriv.cpp",
1354 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001355 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001356 libs = []
1357 if (is_ios) {
1358 sources += [ "tools/ios_utils.m" ]
1359 libs += [ "Foundation.framework" ]
1360 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001361 defines = []
1362 if (skia_tools_require_resources) {
1363 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1364 }
mtkleinc095df52016-08-24 12:23:52 -07001365 deps = [
mtklein046cb562016-09-16 10:23:12 -07001366 ":common_flags",
Ben Wagner97182cc2018-02-15 10:20:04 -05001367 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001368 ":flags",
1369 "//third_party/libpng",
1370 ]
1371 public_deps = [
1372 "//third_party/jsoncpp",
1373 ]
1374 }
mtklein25c81d42016-07-27 13:55:26 -07001375
Mike Klein6e744122016-10-27 12:21:40 -04001376 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001377 test_lib("gm") {
1378 public_include_dirs = [ "gm" ]
1379 sources = gm_sources
1380 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001381 ":experimental_sksg",
scroggo19b91532016-10-24 09:03:26 -07001382 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001383 ":gpu_tool_utils",
1384 ":skia",
1385 ":tool_utils",
1386 ]
1387 }
mtklein25c81d42016-07-27 13:55:26 -07001388
Mike Klein6e744122016-10-27 12:21:40 -04001389 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001390 test_lib("tests") {
1391 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001392 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001393 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001394 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001395 }
mtkleinc095df52016-08-24 12:23:52 -07001396 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001397 ":experimental_sksg",
Hal Canary0f666812018-03-22 15:21:12 -04001398 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001399 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001400 ":skia",
Mike Klein852a8cb2018-05-15 10:46:58 -04001401 ":third_party_skcms",
mtkleinc095df52016-08-24 12:23:52 -07001402 ":tool_utils",
1403 "//third_party/libpng",
1404 "//third_party/zlib",
1405 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001406 public_deps = [
1407 ":gpu_tool_utils", # Test.h #includes headers from this target.
1408 ]
mtkleinc095df52016-08-24 12:23:52 -07001409 }
mtklein2f3416d2016-08-02 16:02:05 -07001410
Mike Klein6e744122016-10-27 12:21:40 -04001411 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001412 test_lib("bench") {
1413 public_include_dirs = [ "bench" ]
1414 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001415 deps = [
1416 ":flags",
1417 ":gm",
1418 ":gpu_tool_utils",
1419 ":skia",
1420 ":tool_utils",
1421 ]
1422 }
mtklein2b6870c2016-07-28 14:17:33 -07001423
Florin Malita54f65c42018-01-16 17:04:30 -05001424 test_lib("experimental_skottie") {
Florin Malita87ccf332018-05-04 12:23:24 -04001425 public_include_dirs = []
Florin Malita87ccf332018-05-04 12:23:24 -04001426 if (skia_enable_skottie) {
1427 public_include_dirs += [ "experimental/skottie" ]
1428 public_defines = [ "SK_ENABLE_SKOTTIE" ]
1429 sources = [
1430 "experimental/skottie/Skottie.cpp",
1431 "experimental/skottie/SkottieAdapter.cpp",
1432 "experimental/skottie/SkottieAnimator.cpp",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001433 "experimental/skottie/SkottieJson.cpp",
Florin Malita87ccf332018-05-04 12:23:24 -04001434 "experimental/skottie/SkottieValue.cpp",
1435 ]
1436 deps = [
1437 ":experimental_sksg",
1438 ":skia",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001439 "//third_party/rapidjson",
Florin Malita87ccf332018-05-04 12:23:24 -04001440 ]
1441 }
Florin Malita094ccde2017-12-30 12:27:00 -05001442 }
1443
mtkleinc095df52016-08-24 12:23:52 -07001444 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001445 public_include_dirs = []
1446 if (skia_use_expat) {
1447 public_include_dirs += [ "experimental/svg/model" ]
1448 sources = [
1449 "experimental/svg/model/SkSVGAttribute.cpp",
1450 "experimental/svg/model/SkSVGAttributeParser.cpp",
1451 "experimental/svg/model/SkSVGCircle.cpp",
1452 "experimental/svg/model/SkSVGClipPath.cpp",
1453 "experimental/svg/model/SkSVGContainer.cpp",
1454 "experimental/svg/model/SkSVGDOM.cpp",
1455 "experimental/svg/model/SkSVGEllipse.cpp",
1456 "experimental/svg/model/SkSVGGradient.cpp",
1457 "experimental/svg/model/SkSVGLine.cpp",
1458 "experimental/svg/model/SkSVGLinearGradient.cpp",
1459 "experimental/svg/model/SkSVGNode.cpp",
1460 "experimental/svg/model/SkSVGPath.cpp",
1461 "experimental/svg/model/SkSVGPattern.cpp",
1462 "experimental/svg/model/SkSVGPoly.cpp",
1463 "experimental/svg/model/SkSVGRadialGradient.cpp",
1464 "experimental/svg/model/SkSVGRect.cpp",
1465 "experimental/svg/model/SkSVGRenderContext.cpp",
1466 "experimental/svg/model/SkSVGSVG.cpp",
1467 "experimental/svg/model/SkSVGShape.cpp",
1468 "experimental/svg/model/SkSVGStop.cpp",
1469 "experimental/svg/model/SkSVGTransformableNode.cpp",
1470 "experimental/svg/model/SkSVGUse.cpp",
1471 "experimental/svg/model/SkSVGValue.cpp",
1472 ]
1473 deps = [
1474 ":skia",
1475 ":xml",
1476 ]
1477 }
mtkleinc095df52016-08-24 12:23:52 -07001478 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001479
Florin Malita4aa44412017-12-19 12:21:02 -05001480 test_lib("experimental_sksg") {
1481 public_include_dirs = [
1482 "experimental/sksg",
1483 "experimental/sksg/effects",
1484 "experimental/sksg/geometry",
1485 "experimental/sksg/paint",
1486 ]
1487 sources = [
1488 "experimental/sksg/SkSGDraw.cpp",
1489 "experimental/sksg/SkSGEffectNode.cpp",
1490 "experimental/sksg/SkSGGeometryNode.cpp",
1491 "experimental/sksg/SkSGGroup.cpp",
Florin Malita49328072018-01-08 12:51:12 -05001492 "experimental/sksg/SkSGImage.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001493 "experimental/sksg/SkSGInvalidationController.cpp",
1494 "experimental/sksg/SkSGNode.cpp",
1495 "experimental/sksg/SkSGPaintNode.cpp",
1496 "experimental/sksg/SkSGRenderNode.cpp",
Florin Malita35efaa82018-01-22 12:57:06 -05001497 "experimental/sksg/SkSGScene.cpp",
Florin Malita38ea40e2018-01-29 16:31:14 -05001498 "experimental/sksg/effects/SkSGClipEffect.cpp",
Florin Malita5f9102f2018-01-10 13:36:22 -05001499 "experimental/sksg/effects/SkSGMaskEffect.cpp",
Florin Malitac0034172018-01-08 16:42:59 -05001500 "experimental/sksg/effects/SkSGOpacityEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001501 "experimental/sksg/effects/SkSGTransform.cpp",
Florin Malita16d0ad02018-01-19 15:07:29 -05001502 "experimental/sksg/geometry/SkSGGeometryTransform.cpp",
Florin Malitae6345d92018-01-03 23:37:54 -05001503 "experimental/sksg/geometry/SkSGMerge.cpp",
Florin Malita047ae272017-12-27 11:13:13 -05001504 "experimental/sksg/geometry/SkSGPath.cpp",
Florin Malita97b3d2b2018-02-20 11:26:15 -05001505 "experimental/sksg/geometry/SkSGPlane.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001506 "experimental/sksg/geometry/SkSGRect.cpp",
Florin Malita41dff6e2018-04-30 23:08:15 -04001507 "experimental/sksg/geometry/SkSGRoundEffect.cpp",
Florin Malita51012ce2018-01-31 17:06:59 -05001508 "experimental/sksg/geometry/SkSGText.cpp",
Florin Malita51b8c892018-01-07 08:54:24 -05001509 "experimental/sksg/geometry/SkSGTrimEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001510 "experimental/sksg/paint/SkSGColor.cpp",
Florin Malita6aaee592018-01-12 12:25:09 -05001511 "experimental/sksg/paint/SkSGGradient.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001512 ]
1513 deps = [
1514 ":skia",
1515 ]
1516 }
1517
Kevin Lubickebf648e2017-09-21 13:45:16 -04001518 if (target_cpu != "wasm") {
1519 test_lib("views") {
1520 public_include_dirs = [ "include/views" ]
1521 sources = [
1522 "src/views/SkEvent.cpp",
1523 "src/views/SkEventSink.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001524 "src/views/SkTouchGesture.cpp",
1525 "src/views/SkView.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001526 ]
Brian Osman34755e22016-12-05 09:46:02 -05001527 }
Brian Osman16adfa32016-10-18 14:42:44 -04001528 }
1529
Mike Klein38af9432016-11-11 11:39:44 -05001530 if (skia_use_lua) {
1531 test_lib("lua") {
1532 public_include_dirs = []
1533 sources = [
1534 "src/utils/SkLua.cpp",
1535 "src/utils/SkLuaCanvas.cpp",
1536 ]
1537 deps = [
Herb Derby1724db12018-05-22 12:01:50 -04001538 ":skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001539 "//third_party/lua",
1540 ]
1541 }
1542
Mike Kleine6682eb2017-01-05 10:54:57 -05001543 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001544 sources = [
1545 "tools/lua/lua_app.cpp",
1546 ]
1547 deps = [
1548 ":lua",
1549 ":skia",
1550 "//third_party/lua",
1551 ]
Mike Klein38af9432016-11-11 11:39:44 -05001552 }
1553
Mike Kleine6682eb2017-01-05 10:54:57 -05001554 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001555 sources = [
1556 "tools/lua/lua_pictures.cpp",
1557 ]
1558 deps = [
1559 ":flags",
1560 ":lua",
1561 ":skia",
1562 ":tool_utils",
1563 "//third_party/lua",
1564 ]
Mike Klein38af9432016-11-11 11:39:44 -05001565 }
1566 }
1567
Cary Clark8032b982017-07-28 11:04:54 -04001568 test_app("bookmaker") {
1569 sources = [
1570 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001571 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001572 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001573 "tools/bookmaker/fiddleParser.cpp",
1574 "tools/bookmaker/includeParser.cpp",
1575 "tools/bookmaker/includeWriter.cpp",
1576 "tools/bookmaker/mdOut.cpp",
1577 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001578 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001579 "tools/bookmaker/spellCheck.cpp",
1580 ]
1581 deps = [
1582 ":flags",
1583 ":skia",
1584 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001585 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001586 ]
1587 }
1588
Kevin Lubickebf648e2017-09-21 13:45:16 -04001589 if (target_cpu != "wasm") {
1590 import("gn/samples.gni")
1591 test_lib("samples") {
1592 public_include_dirs = [ "samplecode" ]
1593 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001594 sources = samples_sources
Kevin Lubickebf648e2017-09-21 13:45:16 -04001595 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001596 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001597 ":experimental_svg_model",
1598 ":flags",
1599 ":gm",
Mike Reed193d3a02018-02-08 15:45:51 -05001600 ":skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001601 ":tool_utils",
1602 ":views",
1603 ":xml",
1604 ]
Mike Klein38af9432016-11-11 11:39:44 -05001605
Kevin Lubickebf648e2017-09-21 13:45:16 -04001606 if (skia_use_lua) {
1607 sources += [ "samplecode/SampleLua.cpp" ]
1608 deps += [
1609 ":lua",
1610 "//third_party/lua",
1611 ]
1612 }
1613 }
1614 test_app("dm") {
1615 sources = [
1616 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001617 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001618 "dm/DMJsonWriter.cpp",
1619 "dm/DMSrcSink.cpp",
1620 ]
1621 include_dirs = [ "tests" ]
1622 deps = [
1623 ":common_flags",
Florin Malita54f65c42018-01-16 17:04:30 -05001624 ":experimental_skottie",
Florin Malita4aa44412017-12-19 12:21:02 -05001625 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001626 ":experimental_svg_model",
1627 ":flags",
1628 ":gm",
1629 ":gpu_tool_utils",
1630 ":skia",
1631 ":tests",
Brian Osmanc494a702018-05-23 11:52:00 -04001632 ":third_party_skcms",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001633 ":tool_utils",
1634 "//third_party/jsoncpp",
1635 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001636 ]
1637 }
Brian Osman16adfa32016-10-18 14:42:44 -04001638 }
1639
Mike Kleina8a51ce2018-01-09 12:34:11 -05001640 if (!is_win) {
1641 test_app("remote_demo") {
1642 sources = [
1643 "tools/remote_demo.cpp",
1644 ]
1645 deps = [
1646 ":skia",
1647 ]
1648 }
1649 }
1650
Mike Kleine6682eb2017-01-05 10:54:57 -05001651 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001652 sources = [
1653 "bench/nanobench.cpp",
1654 ]
1655 deps = [
1656 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001657 ":common_flags",
Florin Malita4aa44412017-12-19 12:21:02 -05001658 ":experimental_sksg",
fmalita6519c212016-09-14 08:05:17 -07001659 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001660 ":flags",
1661 ":gm",
1662 ":gpu_tool_utils",
1663 ":skia",
1664 ":tool_utils",
1665 "//third_party/jsoncpp",
1666 ]
mtklein2b6870c2016-07-28 14:17:33 -07001667 }
halcanary19a97202016-08-03 15:08:04 -07001668
Ravi Mistry10d36c52017-01-31 09:49:18 -05001669 test_app("skpinfo") {
1670 sources = [
1671 "tools/skpinfo.cpp",
1672 ]
1673 deps = [
1674 ":flags",
1675 ":skia",
1676 ]
1677 }
1678
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001679 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001680 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001681 sources = [
1682 "tools/skpbench/skpbench.cpp",
1683 ]
1684 deps = [
1685 ":flags",
1686 ":gpu_tool_utils",
1687 ":skia",
1688 ":tool_utils",
1689 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001690 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001691 }
1692
Hal Canary96c57252018-02-09 11:43:05 -05001693 test_lib("skshaper") {
1694 public_include_dirs = [ "tools/shape" ]
1695 deps = [
1696 ":skia",
1697 ]
1698
Hal Canary8bb40832018-02-08 15:16:28 -05001699 if (target_cpu == "wasm") {
Hal Canary96c57252018-02-09 11:43:05 -05001700 sources = [
1701 "tools/shape/SkShaper_primitive.cpp",
1702 ]
1703 } else {
mtklein6f5df6a2016-08-29 16:01:10 -07001704 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001705 "tools/shape/SkShaper_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001706 ]
Hal Canary96c57252018-02-09 11:43:05 -05001707 deps += [
mtklein6f5df6a2016-08-29 16:01:10 -07001708 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001709 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001710 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001711 }
halcanary19a97202016-08-03 15:08:04 -07001712 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001713 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001714 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001715 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001716 ]
1717 deps = [
1718 ":skia",
Hal Canary96c57252018-02-09 11:43:05 -05001719 ":skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001720 ]
halcanary3eee9d92016-09-10 07:01:53 -07001721 }
mtklein046cb562016-09-16 10:23:12 -07001722
Matt Sarett9f1c4032017-05-17 10:06:32 -04001723 test_app("create_flutter_test_images") {
1724 sources = [
1725 "tools/create_flutter_test_images.cpp",
1726 ]
1727 deps = [
1728 ":skia",
1729 ":tool_utils",
1730 ]
1731 }
1732
Ben Wagner219f3622017-07-17 15:32:25 -04001733 test_app("create_test_font") {
1734 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001735 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001736 ]
1737 deps = [
1738 ":skia",
1739 ]
1740 assert_no_deps = [
1741 # tool_utils requires the output of this app.
1742 ":tool_utils",
1743 ]
1744 }
1745
Ben Wagner97182cc2018-02-15 10:20:04 -05001746 test_app("create_test_font_color") {
1747 sources = [
1748 "tools/fonts/create_test_font_color.cpp",
1749 ]
1750 deps = [
1751 ":flags",
1752 ":skia",
Florin Malitac659c2c2018-04-05 11:57:21 -04001753 ":tool_utils",
Ben Wagner97182cc2018-02-15 10:20:04 -05001754 ]
1755 }
1756
Mike Kleine6682eb2017-01-05 10:54:57 -05001757 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001758 sources = [
1759 "tools/get_images_from_skps.cpp",
1760 ]
1761 deps = [
1762 ":flags",
1763 ":skia",
1764 "//third_party/jsoncpp",
1765 ]
mtklein046cb562016-09-16 10:23:12 -07001766 }
mtkleinecbc5262016-09-22 11:51:24 -07001767
Kevin Lubickebf648e2017-09-21 13:45:16 -04001768 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001769 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001770 sources = [
1771 "tools/skiaserve/Request.cpp",
1772 "tools/skiaserve/Response.cpp",
1773 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001774 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1775 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1776 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1777 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1778 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1779 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1780 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1781 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1782 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001783 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1784 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001785 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1786 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1787 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1788 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1789 ]
1790 deps = [
1791 ":flags",
1792 ":gpu_tool_utils",
1793 ":skia",
1794 ":tool_utils",
1795 "//third_party/jsoncpp",
1796 "//third_party/libmicrohttpd",
1797 "//third_party/libpng",
1798 ]
Mike Klein7d302882016-11-03 14:06:31 -04001799 }
mtkleinecbc5262016-09-22 11:51:24 -07001800 }
kjlubick14f984b2016-10-03 11:49:45 -07001801
Mike Kleine6682eb2017-01-05 10:54:57 -05001802 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001803 include_dirs = [
1804 "tools",
1805 "tools/debugger",
1806 ]
kjlubick14f984b2016-10-03 11:49:45 -07001807 sources = [
Hal Canary24ac42b2017-02-14 13:35:14 -05001808 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001809 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001810 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001811 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001812 "fuzz/FuzzGradients.cpp",
1813 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001814 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001815 "fuzz/FuzzPathop.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001816 "fuzz/FuzzRegionOp.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001817 "fuzz/fuzz.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001818 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1819 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001820 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
1821 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001822 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1823 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001824 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001825 "tools/UrlDataManager.cpp",
1826 "tools/debugger/SkDebugCanvas.cpp",
1827 "tools/debugger/SkDrawCommand.cpp",
1828 "tools/debugger/SkJsonWriteBuffer.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001829 "tools/picture_utils.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001830 ]
1831 deps = [
Kevin Lubick9eeede22018-05-03 16:26:10 -04001832 ":experimental_skottie",
kjlubick14f984b2016-10-03 11:49:45 -07001833 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001834 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001835 ":skia",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001836 "//third_party/jsoncpp",
1837 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001838 ]
Florin Malita0b0d93d2018-05-04 15:01:03 -04001839
1840 if (skia_enable_skottie) {
1841 sources += [ "fuzz/oss_fuzz/FuzzSkottieJSON.cpp" ]
1842 }
kjlubick14f984b2016-10-03 11:49:45 -07001843 }
Mike Klein38312422016-10-05 15:41:01 -04001844
Mike Kleine6682eb2017-01-05 10:54:57 -05001845 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001846 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001847 rebase_path("tests/skia_test.cpp"),
1848 rebase_path("tests/Test.cpp"),
1849 ]
caryclark9feb6322016-10-25 08:58:26 -07001850 deps = [
1851 ":flags",
1852 ":gpu_tool_utils",
1853 ":skia",
1854 ":tool_utils",
1855 ]
caryclark9feb6322016-10-25 08:58:26 -07001856 }
1857
Mike Kleine6682eb2017-01-05 10:54:57 -05001858 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001859 sources = [
1860 "tools/DumpRecord.cpp",
1861 "tools/dump_record.cpp",
1862 ]
1863 deps = [
1864 ":flags",
1865 ":skia",
1866 ]
Mike Klein38312422016-10-05 15:41:01 -04001867 }
bungemanfe917272016-10-13 17:36:40 -04001868
Mike Kleine6682eb2017-01-05 10:54:57 -05001869 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001870 sources = [
1871 "tools/skdiff/skdiff.cpp",
1872 "tools/skdiff/skdiff_html.cpp",
1873 "tools/skdiff/skdiff_main.cpp",
1874 "tools/skdiff/skdiff_utils.cpp",
1875 ]
1876 deps = [
1877 ":skia",
1878 ":tool_utils",
1879 ]
bungemanfe917272016-10-13 17:36:40 -04001880 }
halcanarya73d76a2016-10-17 13:19:02 -07001881
Mike Kleine6682eb2017-01-05 10:54:57 -05001882 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001883 sources = [
1884 "tools/skp_parser.cpp",
1885 ]
1886 deps = [
1887 ":skia",
1888 ":tool_utils",
1889 "//third_party/jsoncpp",
1890 ]
halcanarya73d76a2016-10-17 13:19:02 -07001891 }
Brian Osman16adfa32016-10-18 14:42:44 -04001892
Hal Canaryd7b38452017-12-11 17:46:26 -05001893 if (!is_win && skia_enable_gpu) {
1894 test_lib("skqp_lib") {
1895 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001896 defines =
1897 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001898 if (skia_skqp_enable_driver_correctness_workarounds) {
1899 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1900 }
Hal Canary75427132017-10-11 16:00:31 -04001901 sources = [
1902 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001903 "tools/skqp/gm_knowledge.cpp",
1904 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001905 ]
1906 deps = [
1907 ":gm",
1908 ":gpu_tool_utils",
1909 ":skia",
1910 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001911 ":tool_utils",
1912 ]
1913 }
1914 test_app("skqp") {
1915 sources = [
1916 "tools/skqp/skqp.cpp",
1917 ]
1918 deps = [
1919 ":skia",
1920 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001921 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001922 "//third_party/googletest",
1923 ]
1924 }
1925 }
Hal Canary28f89382017-12-12 09:42:14 -05001926 if (is_android && skia_enable_gpu) {
1927 test_app("skqp_app") {
1928 is_shared_library = true
1929 sources = [
1930 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1931 ]
1932 deps = [
1933 ":skia",
1934 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001935 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001936 ]
1937 libs = [ "android" ]
1938 }
1939 }
Hal Canary75427132017-10-11 16:00:31 -04001940
Hal Canarya9de7602018-01-19 13:08:23 -05001941 test_app("list_gms") {
1942 sources = [
1943 "tools/list_gms.cpp",
1944 ]
1945 deps = [
1946 ":gm",
1947 ":skia",
1948 ]
1949 }
1950 test_app("list_gpu_unit_tests") {
1951 sources = [
1952 "dm/DMGpuTestProcs.cpp",
1953 "tools/list_gpu_unit_tests.cpp",
1954 ]
1955 deps = [
1956 ":skia",
1957 ":tests",
1958 ]
1959 }
1960
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001961 if (skia_enable_gpu) {
Brian Osmaneff04b52017-11-21 13:18:02 -05001962 test_lib("sk_app") {
1963 public_include_dirs = [ "tools/sk_app" ]
Brian Osman16adfa32016-10-18 14:42:44 -04001964 sources = [
Brian Osmaneff04b52017-11-21 13:18:02 -05001965 "tools/sk_app/CommandSet.cpp",
1966 "tools/sk_app/GLWindowContext.cpp",
1967 "tools/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001968 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001969 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001970
Jim Van Verth4e56a912016-10-21 10:58:52 -04001971 if (is_android) {
1972 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001973 "tools/sk_app/android/GLWindowContext_android.cpp",
1974 "tools/sk_app/android/RasterWindowContext_android.cpp",
1975 "tools/sk_app/android/Window_android.cpp",
1976 "tools/sk_app/android/main_android.cpp",
1977 "tools/sk_app/android/surface_glue_android.cpp",
Jim Van Verth4e56a912016-10-21 10:58:52 -04001978 ]
Brian Osman462334e2017-02-09 11:22:57 -05001979 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001980 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001981 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001982 "tools/sk_app/unix/GLWindowContext_unix.cpp",
1983 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
1984 "tools/sk_app/unix/Window_unix.cpp",
Brian Osmanfa916272017-12-01 09:18:20 -05001985 "tools/sk_app/unix/keysym2ucs.c",
Brian Osmaneff04b52017-11-21 13:18:02 -05001986 "tools/sk_app/unix/main_unix.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001987 ]
Brian Osmanfa916272017-12-01 09:18:20 -05001988 libs += [
1989 "GL",
1990 "X11",
1991 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001992 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001993 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001994 "tools/sk_app/win/GLWindowContext_win.cpp",
1995 "tools/sk_app/win/RasterWindowContext_win.cpp",
1996 "tools/sk_app/win/Window_win.cpp",
1997 "tools/sk_app/win/main_win.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001998 ]
Brian Salomon194db172017-08-17 14:37:06 -04001999 if (skia_use_angle) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002000 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002001 }
Mike Klein43c25262016-10-20 10:17:47 -04002002 } else if (is_mac) {
2003 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002004 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2005 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2006 "tools/sk_app/mac/Window_mac.cpp",
2007 "tools/sk_app/mac/main_mac.cpp",
Mike Klein43c25262016-10-20 10:17:47 -04002008 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002009 libs += [
2010 "QuartzCore.framework",
2011 "Cocoa.framework",
2012 "Foundation.framework",
2013 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002014 } else if (is_ios) {
2015 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002016 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2017 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2018 "tools/sk_app/ios/Window_ios.cpp",
2019 "tools/sk_app/ios/main_ios.cpp",
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002020 ]
Brian Osman16adfa32016-10-18 14:42:44 -04002021 }
2022
2023 if (skia_use_vulkan) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002024 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002025 if (is_android) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002026 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002027 } else if (is_linux) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002028 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
Brian Osman2dd96932016-10-18 15:33:53 -04002029 libs += [ "X11-xcb" ]
2030 } else if (is_win) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002031 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Brian Osman16adfa32016-10-18 14:42:44 -04002032 }
2033 }
2034
Brian Osman16adfa32016-10-18 14:42:44 -04002035 deps = [
Brian Osman16adfa32016-10-18 14:42:44 -04002036 ":gpu_tool_utils",
Brian Osman16adfa32016-10-18 14:42:44 -04002037 ":skia",
2038 ":tool_utils",
2039 ":views",
Brian Osman16adfa32016-10-18 14:42:44 -04002040 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002041 if (is_android) {
2042 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002043 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04002044 deps += [ "//third_party/libsdl" ]
2045 }
Brian Salomon194db172017-08-17 14:37:06 -04002046 if (skia_use_angle) {
2047 deps += [ "//third_party/angle2" ]
2048 }
Mike Kleina92c3832016-12-08 09:49:39 -05002049 }
Brian Osman16adfa32016-10-18 14:42:44 -04002050 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002051
Brian Osmaneff04b52017-11-21 13:18:02 -05002052 if (skia_enable_gpu) {
2053 test_app("viewer") {
2054 is_shared_library = is_android
Jim Van Verth329c5a62017-11-29 11:42:33 -05002055 if (is_ios) {
2056 bundle_ios_data = true
2057 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002058 sources = [
Chris Dalton2d18f412018-02-20 13:23:32 -07002059 "tools/viewer/BisectSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002060 "tools/viewer/GMSlide.cpp",
Brian Osmand67e5182017-12-08 16:46:09 -05002061 "tools/viewer/ImGuiLayer.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002062 "tools/viewer/ImageSlide.cpp",
2063 "tools/viewer/SKPSlide.cpp",
2064 "tools/viewer/SampleSlide.cpp",
Florin Malita76a076b2018-02-15 18:40:48 -05002065 "tools/viewer/SlideDir.cpp",
Brian Osman56a24812017-12-19 11:15:16 -05002066 "tools/viewer/StatsLayer.cpp",
Florin Malitac659c2c2018-04-05 11:57:21 -04002067 "tools/viewer/SvgSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002068 "tools/viewer/Viewer.cpp",
2069 ]
2070 libs = []
2071
2072 include_dirs = []
2073 deps = [
Florin Malitabcd07232018-01-31 11:08:58 -05002074 ":experimental_sksg",
Florin Malitac659c2c2018-04-05 11:57:21 -04002075 ":experimental_svg_model",
Brian Osmaneff04b52017-11-21 13:18:02 -05002076 ":flags",
2077 ":gm",
2078 ":gpu_tool_utils",
2079 ":samples",
2080 ":sk_app",
2081 ":skia",
2082 ":tool_utils",
2083 ":views",
2084 "//third_party/imgui",
2085 "//third_party/jsoncpp",
2086 ]
Florin Malita87ccf332018-05-04 12:23:24 -04002087
2088 if (skia_enable_skottie) {
2089 sources += [ "tools/viewer/SkottieSlide.cpp" ]
2090 deps += [ ":experimental_skottie" ]
2091 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002092 }
2093 }
2094
2095 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
2096 test_app("HelloWorld") {
2097 sources = [
2098 "example/HelloWorld.cpp",
2099 ]
2100 libs = []
2101
2102 include_dirs = []
2103 deps = [
2104 ":flags",
2105 ":gpu_tool_utils",
2106 ":sk_app",
2107 ":skia",
2108 ":tool_utils",
2109 ":views",
2110 ]
2111 }
2112 }
2113
Jim Van Verthecfed2b2017-08-30 14:02:50 -04002114 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002115 test_app("SkiaSDLExample") {
2116 sources = [
2117 "example/SkiaSDLExample.cpp",
2118 ]
2119 libs = []
2120 include_dirs = []
2121 deps = [
2122 ":gpu_tool_utils",
2123 ":skia",
2124 "//third_party/libsdl",
2125 ]
2126 }
2127 }
2128
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002129 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2130 action_foreach("generate_mocs") {
2131 script = "gn/call.py"
2132 sources = [
2133 "tools/mdbviz/MainWindow.h",
2134 ]
2135 outputs = [
2136 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2137 ]
2138 args = [
2139 "$skia_qt_path" + "/bin/moc",
2140 "{{source}}",
2141 "-o",
2142 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2143 ]
2144 }
2145 action_foreach("generate_resources") {
2146 script = "gn/call.py"
2147 sources = [
2148 "tools/mdbviz/resources.qrc",
2149 ]
2150 outputs = [
2151 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2152 ]
2153 args = [
2154 "$skia_qt_path" + "/bin/rcc",
2155 "{{source}}",
2156 "-o",
2157 "gen/mdbviz/{{source_name_part}}_res.cpp",
2158 ]
2159 }
2160 test_app("mdbviz") {
2161 if (is_win) {
2162 # on Windows we need to disable some exception handling warnings due to the Qt headers
2163 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2164 }
2165 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002166 "tools/UrlDataManager.cpp",
2167 "tools/debugger/SkDebugCanvas.cpp",
2168 "tools/debugger/SkDrawCommand.cpp",
2169 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002170 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002171 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002172 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002173 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002174
2175 # generated files
2176 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2177 "$target_gen_dir/mdbviz/resources_res.cpp",
2178 ]
2179 lib_dirs = [ "$skia_qt_path/lib" ]
2180 libs = [
2181 "Qt5Core.lib",
2182 "Qt5Gui.lib",
2183 "Qt5Widgets.lib",
2184 ]
2185 include_dirs = [
2186 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002187 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002188 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002189 "tools",
2190 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002191 ]
2192 deps = [
2193 ":generate_mocs",
2194 ":generate_resources",
2195 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002196 "//third_party/jsoncpp",
2197 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002198 ]
2199 }
2200 }
2201
Mike Kleine459afd2017-03-03 09:21:30 -05002202 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002203 copy("gdbserver") {
2204 sources = [
2205 "$ndk/$ndk_gdbserver",
2206 ]
2207 outputs = [
2208 "$root_out_dir/gdbserver",
2209 ]
2210 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002211 }
mtklein25c81d42016-07-27 13:55:26 -07002212}