blob: fe6dc7555af57a6e48161f8a5562931ee1a0d5f0 [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 Klein26a60492018-10-15 10:38:25 -040019 skia_enable_flutter_defines = false
20}
21
22declare_args() {
Mike Kleinc168a3a2016-11-14 14:53:13 +000023 skia_use_angle = false
Kevin Lubick4a24e102017-03-29 11:19:01 -040024 skia_use_egl = false
mtklein63213812016-08-24 09:55:56 -070025 skia_use_expat = true
mtklein3cc22182016-08-29 13:26:14 -070026 skia_use_fontconfig = is_linux
mtkleincdedd0e2016-09-12 15:15:44 -070027 skia_use_freetype = is_android || is_fuchsia || is_linux
Mike Klein7d302882016-11-03 14:06:31 -040028 skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows
mtklein63213812016-08-24 09:55:56 -070029 skia_use_libjpeg_turbo = true
30 skia_use_libpng = true
mtkleineb3c4252016-08-23 07:38:09 -070031 skia_use_libwebp = !is_fuchsia
Mike Kleinfae86b72018-01-08 15:49:09 -050032 skia_use_lua = is_skia_dev_build && !is_ios
Mike Kleinf9ae6702018-06-20 14:05:05 -040033 skia_use_opencl = false
Mike Klein10d665d2016-11-01 11:46:10 -040034 skia_use_piex = !is_win
mtklein63213812016-08-24 09:55:56 -070035 skia_use_zlib = true
Greg Daniele5ddff52017-07-05 16:49:36 -040036 skia_use_metal = false
Mike Klein36f182f2017-10-20 12:33:53 -040037 skia_use_libheif = is_skia_dev_build
Chinmay Garded92d0352018-09-17 10:23:28 -070038 skia_use_x11 = is_linux
mtklein1bd72ba2016-09-16 07:45:52 -070039
Mike Klein7d921032017-01-05 12:20:41 -050040 skia_android_serial = ""
Kevin Lubick93faa672018-10-10 15:54:53 -040041 skia_enable_ccpr = true
Greg Danielf9c5ca42018-10-16 12:12:59 -040042 skia_enable_nvpr = true # TODO: !skia_enable_flutter_defines
Brian Osman3f375d02016-12-28 11:19:22 -050043 skia_enable_discrete_gpu = true
Mike Kleina04bb452017-02-09 12:24:07 -050044 skia_enable_effects = true
Mike Reed0917fad2018-06-19 10:17:30 -040045 skia_enable_effects_imagefilters = true
Hal Canaryff2742e2018-01-30 11:35:47 -050046 skia_enable_fontmgr_empty = false
Brian Osman74511012018-04-02 20:13:46 +000047 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050048 skia_enable_pdf = true
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040049 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050050 skia_enable_tools = is_skia_dev_build
51 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Danielda16cce2018-08-01 09:23:57 -040052 skia_vulkan_header = "" # temporary as we remove the use from clients
Robert Phillipsa6d2d702017-09-01 12:17:03 -040053 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040054 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070055 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070056 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040057
Hal Canary4689b542018-01-31 11:54:14 -050058 skia_skqp_enable_driver_correctness_workarounds = false
Hal Canary2331c822018-02-01 14:06:13 -050059 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040060
61 skia_llvm_path = ""
62 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040063
64 skia_tools_require_resources = false
mtkleinc04ff472016-06-23 10:29:30 -070065}
Brian Salomon23d73ea2016-10-27 13:31:37 -040066declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040067 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040068 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050069 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Mike Klein10d665d2016-11-01 11:46:10 -040070
Mike Klein4d598a32016-10-31 13:44:49 -040071 if (is_android) {
72 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070073 } else if (is_fuchsia) {
74 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040075 } else {
Greg Daniel91dfa3b2018-05-22 13:25:15 -040076 skia_use_vulkan = (defined(skia_vulkan_sdk) && skia_vulkan_sdk != "") ||
77 (defined(skia_moltenvk_path) && skia_moltenvk_path != "")
Mike Klein4d598a32016-10-31 13:44:49 -040078 }
Jim Van Verth4e502972017-12-07 15:16:10 -050079
80 if (is_ios) {
81 skia_ios_identity = ".*Google.*"
82 skia_ios_profile = "Google Development"
83 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040084}
Brian Salomon789e25e2016-09-30 13:41:03 -040085
Adam Barth54ef74a2017-10-13 10:59:38 -070086if (defined(skia_settings)) {
87 import(skia_settings)
88}
89
Brian Osmanc9a42472018-05-31 13:17:12 -040090# Our tools require static linking (they use non-exported symbols), and the GPU backend.
91skia_enable_tools = skia_enable_tools && !is_component_build && skia_enable_gpu
mtklein06c35c02016-09-20 12:28:12 -070092
mtkleina45be612016-08-29 15:22:10 -070093fontmgr_android_enabled = skia_use_expat && skia_use_freetype
94
mtklein1211e0c2016-07-26 13:55:45 -070095skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070096 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070097 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070098 "include/codec",
99 "include/config",
100 "include/core",
Hal Canary23564b92018-09-07 14:33:14 -0400101 "include/docs",
mtklein1211e0c2016-07-26 13:55:45 -0700102 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -0400103 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -0700104 "include/gpu",
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500105 "include/atlastext",
mtklein1211e0c2016-07-26 13:55:45 -0700106 "include/pathops",
107 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -0700108 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700109 "include/utils",
110 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700111]
112
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500113if (skia_enable_atlas_text) {
114 skia_public_includes += [ "include/atlastext" ]
115}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000116
mtkleinc04ff472016-06-23 10:29:30 -0700117# Skia public API, generally provided by :skia.
118config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700119 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -0400120 defines = []
121 if (is_component_build) {
122 defines += [ "SKIA_DLL" ]
123 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400124 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700125 defines += [ "SK_SAMPLES_FOR_X" ]
126 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400127 if (skia_enable_flutter_defines) {
128 defines += flutter_defines
Kevin Lubickf4def342018-10-04 12:52:50 -0400129
130 # Flutter always wants this https://github.com/flutter/flutter/issues/11402
131 defines += [ "SK_ENABLE_DUMP_GPU" ]
Brian Osmanf2c90142017-07-13 15:50:03 -0400132 }
mtklein06c35c02016-09-20 12:28:12 -0700133 if (!skia_enable_gpu) {
134 defines += [ "SK_SUPPORT_GPU=0" ]
135 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500136 if (skia_enable_atlas_text) {
137 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
138 }
mtkleinc04ff472016-06-23 10:29:30 -0700139}
140
141# Skia internal APIs, used by Skia itself and a few test tools.
142config("skia_private") {
143 visibility = [ ":*" ]
144
145 include_dirs = [
146 "include/private",
147 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700148 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700149 "src/core",
150 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700151 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700152 "src/image",
153 "src/images",
154 "src/lazy",
155 "src/opts",
156 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700157 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700158 "src/ports",
159 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400160 "src/shaders",
161 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700162 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700163 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700164 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500165 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700166 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700167 ]
mtklein150d1132016-08-01 06:56:40 -0700168
Mike Reeda9e241d2017-05-03 10:52:00 -0400169 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700170 if (is_android) {
171 defines += [
172 "SK_GAMMA_EXPONENT=1.4",
173 "SK_GAMMA_CONTRAST=0.0",
174 ]
175 }
mtklein88a7ac02016-09-14 11:16:49 -0700176 if (is_official_build || is_android) {
177 # TODO(bsalomon): it'd be nice to make Android normal.
178 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
179 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400180 libs = []
181 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500182 if (skia_enable_gpu) {
183 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500184 if (is_skia_dev_build && skia_use_vulkan) {
185 include_dirs += [ "tools/gpu/vk" ]
186 }
Brian Salomon03e05842017-02-23 12:23:47 -0500187 }
Brian Osman34755e22016-12-05 09:46:02 -0500188 if (skia_use_angle) {
189 defines += [ "SK_ANGLE" ]
190 }
Brian Osman3f375d02016-12-28 11:19:22 -0500191 if (skia_enable_discrete_gpu) {
192 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
193 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400194 if (!is_official_build) {
195 defines += [ "GR_TEST_UTILS=1" ]
196 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400197 if (skia_llvm_path != "") {
198 defines += [ "SK_LLVM_AVAILABLE" ]
199 include_dirs += [ "$skia_llvm_path/include" ]
200 libs += [ skia_llvm_lib ]
201 lib_dirs += [ "$skia_llvm_path/lib/" ]
202 }
mtkleinc04ff472016-06-23 10:29:30 -0700203}
204
205# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
206config("skia_library") {
207 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700208 defines = [ "SKIA_IMPLEMENTATION=1" ]
209}
210
211skia_library_configs = [
212 ":skia_public",
213 ":skia_private",
214 ":skia_library",
215]
216
mtklein9b8583d2016-08-24 17:32:30 -0700217# Use for CPU-specific Skia code that needs particular compiler flags.
218template("opts") {
219 if (invoker.enabled) {
220 source_set(target_name) {
221 forward_variables_from(invoker, "*")
222 configs += skia_library_configs
223 }
224 } else {
225 # If not enabled, a phony empty target that swallows all otherwise unused variables.
226 source_set(target_name) {
227 forward_variables_from(invoker,
228 "*",
229 [
230 "sources",
231 "cflags",
232 ])
233 }
234 }
anmittala7eaf2e2016-08-17 13:57:26 -0700235}
236
mtklein422310d2016-08-16 18:28:43 -0700237is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700238
mtklein7d6fb2c2016-08-25 14:50:44 -0700239opts("none") {
240 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700241 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700242 cflags = []
243}
244
mtklein7d6fb2c2016-08-25 14:50:44 -0700245opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700246 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700247 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700248 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700249}
250
251opts("arm64") {
252 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700253 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700254 cflags = []
255}
256
257opts("crc32") {
258 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700259 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700260 cflags = [ "-march=armv8-a+crc" ]
261}
262
mtklein9b8583d2016-08-24 17:32:30 -0700263opts("sse2") {
264 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700265 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400266 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400267 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
268 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400269 cflags = [ "-msse2" ]
270 }
mtklein9b8583d2016-08-24 17:32:30 -0700271}
mtkleinc04ff472016-06-23 10:29:30 -0700272
mtklein9b8583d2016-08-24 17:32:30 -0700273opts("ssse3") {
274 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700275 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400276 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400277 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
278 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400279 cflags = [ "-mssse3" ]
280 }
mtklein9b8583d2016-08-24 17:32:30 -0700281}
mtkleinc04ff472016-06-23 10:29:30 -0700282
mtklein9b8583d2016-08-24 17:32:30 -0700283opts("sse41") {
284 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700285 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400286 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400287 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
288 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400289 cflags = [ "-msse4.1" ]
290 }
mtklein9b8583d2016-08-24 17:32:30 -0700291}
mtklein4e976072016-08-08 09:06:27 -0700292
mtklein9b8583d2016-08-24 17:32:30 -0700293opts("sse42") {
294 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700295 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400296 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400297 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
298 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400299 cflags = [ "-msse4.2" ]
300 }
mtklein9b8583d2016-08-24 17:32:30 -0700301}
302
303opts("avx") {
304 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700305 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400306 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000307 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400308 } else {
309 cflags = [ "-mavx" ]
310 }
mtkleinc04ff472016-06-23 10:29:30 -0700311}
312
Mike Klein1b9b7d52018-02-27 10:37:40 -0500313opts("hsw") {
314 enabled = is_x86
315 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400316 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500317 cflags = [ "/arch:AVX2" ]
318 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000319 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500320 }
321
322 # Oddly, clang-cl doesn't recognize this as a valid flag.
323 # If it ever does, it'd nice to move this up with -mavx2 and co.
324 if (is_clang && !is_win) {
325 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
326 # but nice to have, generating slightly better code for paths without explicit FMAs.
327 cflags += [ "-ffp-contract=fast" ]
328 }
329}
330
mtkleinc095df52016-08-24 12:23:52 -0700331# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700332template("optional") {
333 if (invoker.enabled) {
334 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700335 if (defined(invoker.public_defines)) {
336 defines = invoker.public_defines
337 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600338 if (defined(invoker.public_configs)) {
339 configs = invoker.public_configs
340 }
mtklein457b42a2016-08-23 13:56:37 -0700341 }
342 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700343 forward_variables_from(invoker,
344 "*",
345 [
346 "public_defines",
347 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700348 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700349 ])
mtklein457b42a2016-08-23 13:56:37 -0700350 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700351 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700352 if (defined(invoker.configs_to_remove)) {
353 configs -= invoker.configs_to_remove
354 }
mtklein457b42a2016-08-23 13:56:37 -0700355 }
356 } else {
mtklein457b42a2016-08-23 13:56:37 -0700357 source_set(target_name) {
358 forward_variables_from(invoker,
359 "*",
360 [
361 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400362 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700363 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700364 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700365 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700366 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700367 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700368 ])
mtkleincd01b032016-08-31 04:58:19 -0700369 if (defined(invoker.sources_when_disabled)) {
370 sources = invoker.sources_when_disabled
371 }
372 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700373 }
mtkleineb3c4252016-08-23 07:38:09 -0700374 }
mtklein457b42a2016-08-23 13:56:37 -0700375}
mtklein457b42a2016-08-23 13:56:37 -0700376
Mike Kleina04bb452017-02-09 12:24:07 -0500377optional("effects") {
378 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400379 deps = [
380 ":compile_processors",
381 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500382 sources =
383 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
Mike Reed0917fad2018-06-19 10:17:30 -0400384 if (skia_enable_effects_imagefilters) {
385 sources += skia_effects_imagefilter_sources
386 } else {
387 sources += [ "src/ports/SkGlobalInitialization_none_imagefilters.cpp" ]
388 }
389 sources_when_disabled = [
390 "src/ports/SkGlobalInitialization_none.cpp",
391 "src/ports/SkGlobalInitialization_none_imagefilters.cpp",
392 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500393}
394
mtkleina45be612016-08-29 15:22:10 -0700395optional("fontmgr_android") {
396 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700397
398 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500399 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700400 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700401 ]
402 sources = [
403 "src/ports/SkFontMgr_android.cpp",
404 "src/ports/SkFontMgr_android_factory.cpp",
405 "src/ports/SkFontMgr_android_parser.cpp",
406 ]
407}
408
mtkleind2e39db2016-09-07 07:52:55 -0700409optional("fontmgr_custom") {
Kevin Lubick217056c2018-09-20 17:39:31 -0400410 enabled = (is_linux || target_cpu == "wasm") && skia_use_freetype &&
411 !skia_use_fontconfig
mtkleind2e39db2016-09-07 07:52:55 -0700412
413 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500414 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700415 ]
416 sources = [
417 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500418 "src/ports/SkFontMgr_custom.h",
419 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700420 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500421 "src/ports/SkFontMgr_custom_embedded.cpp",
422 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700423 ]
424}
425
Hal Canaryff2742e2018-01-30 11:35:47 -0500426optional("fontmgr_empty") {
427 enabled = skia_enable_fontmgr_empty
428 sources = [
429 "src/ports/SkFontMgr_empty_factory.cpp",
430 ]
431}
432
mtklein3cc22182016-08-29 13:26:14 -0700433optional("fontmgr_fontconfig") {
434 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700435
436 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500437 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700438 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700439 ]
440 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700441 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700442 "src/ports/SkFontConfigInterface_direct.cpp",
443 "src/ports/SkFontConfigInterface_direct_factory.cpp",
444 "src/ports/SkFontMgr_FontConfigInterface.cpp",
445 "src/ports/SkFontMgr_fontconfig.cpp",
446 "src/ports/SkFontMgr_fontconfig_factory.cpp",
447 ]
448}
449
mtkleincdedd0e2016-09-12 15:15:44 -0700450optional("fontmgr_fuchsia") {
451 enabled = is_fuchsia && skia_use_freetype
452
453 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500454 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700455 ]
456 sources = [
457 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500458 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700459 "src/ports/SkFontMgr_custom_empty_factory.cpp",
460 ]
461}
462
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700463if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400464 executable("sksllex") {
465 sources = [
466 "src/sksl/lex/Main.cpp",
467 "src/sksl/lex/NFA.cpp",
468 "src/sksl/lex/RegexNode.cpp",
469 "src/sksl/lex/RegexParser.cpp",
470 ]
471 include_dirs = [ "src/sksl/lex" ]
472 }
473
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700474 action("run_sksllex") {
475 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400476 deps = [
477 ":sksllex(//gn/toolchain:$host_toolchain)",
478 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700479 sources = [
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700480 "src/sksl/lex/sksl.lex",
481 ]
482
483 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
484 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
485 outputs = [
486 "$target_out_dir/" +
487 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
488 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
489 # confused due to the same file being named by two different paths
490 ]
491 sksllex_path = "$root_out_dir/"
492 sksllex_path += "sksllex"
493 if (host_os == "win") {
494 sksllex_path += ".exe"
495 }
496 args = [
497 rebase_path(sksllex_path),
498 rebase_path("bin/clang-format"),
499 rebase_path("src"),
500 ]
501 }
502} else {
503 group("run_sksllex") {
504 }
505}
506
507if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400508 executable("skslc") {
509 defines = [ "SKSL_STANDALONE" ]
510 sources = [
511 "src/sksl/SkSLMain.cpp",
512 ]
513 sources += skia_sksl_sources
514 include_dirs = [
515 "src/gpu",
516 "src/sksl",
517 ]
518 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500519 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400520 "//third_party/spirv-tools",
521 ]
522 }
523
524 skia_gpu_processor_outputs = []
525 foreach(src, skia_gpu_processor_sources) {
526 dir = get_path_info(src, "dir")
527 name = get_path_info(src, "name")
528
529 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
530 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
531 skia_gpu_processor_outputs += [
532 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
533 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
534 # confused due to the same file being named by two different paths
535 ]
536 }
537
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500538 action("create_sksl_enums") {
539 script = "gn/create_sksl_enums.py"
540 sources = [
541 "include/private/GrSharedEnums.h",
542 ]
543 outputs = [
544 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500545 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500546 ]
547 args = [
548 rebase_path(sources[0]),
549 rebase_path(outputs[0]),
550 ]
551 }
552
Ethan Nicholas762466e2017-06-29 10:03:38 -0400553 action("compile_processors") {
554 script = "gn/compile_processors.py"
555 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500556 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400557 ":skslc(//gn/toolchain:$host_toolchain)",
558 ]
559 sources = skia_gpu_processor_sources
560 outputs = skia_gpu_processor_outputs
561 skslc_path = "$root_out_dir/"
562 if (host_toolchain != default_toolchain_name) {
563 skslc_path += "$host_toolchain/"
564 }
565 skslc_path += "skslc"
566 if (host_os == "win") {
567 skslc_path += ".exe"
568 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400569 args = [
570 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400571 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400572 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400573 args += rebase_path(skia_gpu_processor_sources)
574 }
575} else {
576 skia_gpu_processor_outputs = []
577 group("compile_processors") {
578 }
579}
580
mtklein06c35c02016-09-20 12:28:12 -0700581optional("gpu") {
582 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400583 deps = [
584 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700585 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400586 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700587 if (skia_generate_workarounds) {
588 deps += [ ":workaround_list" ]
589 }
mtkleine9fb3d52016-09-20 15:11:46 -0700590 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600591 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400592 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700593
Brian Salomon3d6801e2017-12-11 10:06:31 -0500594 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400595 if (!skia_enable_ccpr) {
596 sources -= skia_ccpr_sources
597 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
598 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400599 if (!skia_enable_nvpr) {
600 sources -= skia_nvpr_sources
601 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
602 }
mtklein06c35c02016-09-20 12:28:12 -0700603
604 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500605 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700606 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400607 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700608 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400609 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400610
611 # this lib is required to link against AHardwareBuffer
612 if (defined(ndk_api) && ndk_api >= 26) {
613 libs += [ "android" ]
614 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400615 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500616 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400617 libs += [ "EGL" ]
Chinmay Garded92d0352018-09-17 10:23:28 -0700618 } else if (is_linux && skia_use_x11) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500619 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -0400620 libs += [ "GL" ]
mtklein06c35c02016-09-20 12:28:12 -0700621 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500622 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800623 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500624 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400625 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500626 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400627 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700628 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500629 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700630 }
mtkleine9fb3d52016-09-20 15:11:46 -0700631
632 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400633 public_defines += [ "SK_VULKAN" ]
Greg Daniel18dbfd02018-05-29 10:46:51 -0400634 deps += [ "third_party/vulkanmemoryallocator" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700635 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700636 if (skia_enable_vulkan_debug_layers) {
637 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
638 }
mtkleine9fb3d52016-09-20 15:11:46 -0700639 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400640
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400641 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400642 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400643 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
644 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400645
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400646 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400647 if (skia_use_metal) {
648 public_defines += [ "SK_METAL" ]
649 sources += skia_metal_sources
650 libs += [ "Metal.framework" ]
Greg Daniel53956d92018-08-08 14:41:19 -0400651 libs += [ "Foundation.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400652 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400653 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500654
655 if (skia_enable_atlas_text) {
656 sources += skia_atlas_text_sources
657 }
Kevin Lubickf4def342018-10-04 12:52:50 -0400658
659 if (is_debug) {
660 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
661 }
mtklein06c35c02016-09-20 12:28:12 -0700662}
663
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400664optional("heif") {
665 enabled = skia_use_libheif
666 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
667
668 deps = []
669
670 sources = [
671 "src/codec/SkHeifCodec.cpp",
672 ]
673}
674
mtklein63213812016-08-24 09:55:56 -0700675optional("jpeg") {
676 enabled = skia_use_libjpeg_turbo
677 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
678
mtklein63213812016-08-24 09:55:56 -0700679 deps = [
680 "//third_party/libjpeg-turbo:libjpeg",
681 ]
Mike Kleinf105dc72018-06-05 15:22:54 -0400682 public = [
683 "include/encode/SkJpegEncoder.h",
684 ]
mtklein63213812016-08-24 09:55:56 -0700685 sources = [
686 "src/codec/SkJpegCodec.cpp",
687 "src/codec/SkJpegDecoderMgr.cpp",
688 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700689 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400690 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700691 ]
692}
693
694optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500695 enabled = skia_use_zlib && skia_enable_pdf
696 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700697
mtklein63213812016-08-24 09:55:56 -0700698 deps = [
699 "//third_party/zlib",
700 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400701 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700702 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400703 }
brettwb9447282016-09-01 14:24:39 -0700704 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700705 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700706
707 if (skia_use_sfntly) {
708 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500709 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700710 }
711}
712
713optional("png") {
714 enabled = skia_use_libpng
715 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
716
mtklein63213812016-08-24 09:55:56 -0700717 deps = [
718 "//third_party/libpng",
719 ]
720 sources = [
721 "src/codec/SkIcoCodec.cpp",
722 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400723 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700724 ]
725}
726
scroggof84ad642016-10-31 09:02:57 -0700727optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400728 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700729 public_defines = [ "SK_CODEC_DECODES_RAW" ]
730
731 deps = [
732 "//third_party/dng_sdk",
733 "//third_party/libjpeg-turbo:libjpeg",
734 "//third_party/piex",
735 ]
736
737 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
738 # Skia.
739 configs_to_remove = [ "//gn:no_exceptions" ]
740
741 sources = [
742 "src/codec/SkRawAdapterCodec.cpp",
743 "src/codec/SkRawCodec.cpp",
744 ]
745}
746
Mike Klein852a8cb2018-05-15 10:46:58 -0400747import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -0400748source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -0400749 cflags = []
750 if (!is_win || is_clang) {
751 cflags += [
752 "-w",
753 "-std=c11",
754 ]
755 }
756
757 public = [
758 "third_party/skcms/skcms.h",
759 ]
760 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
761}
762
mtklein3cc22182016-08-29 13:26:14 -0700763optional("typeface_freetype") {
764 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700765
766 deps = [
767 "//third_party/freetype2",
768 ]
769 sources = [
770 "src/ports/SkFontHost_FreeType.cpp",
771 "src/ports/SkFontHost_FreeType_common.cpp",
772 ]
773}
774
mtklein457b42a2016-08-23 13:56:37 -0700775optional("webp") {
776 enabled = skia_use_libwebp
777 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
778
mtklein457b42a2016-08-23 13:56:37 -0700779 deps = [
780 "//third_party/libwebp",
781 ]
782 sources = [
783 "src/codec/SkWebpAdapterCodec.cpp",
784 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400785 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700786 ]
mtkleineb3c4252016-08-23 07:38:09 -0700787}
788
mtklein63213812016-08-24 09:55:56 -0700789optional("xml") {
790 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000791 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700792
mtklein63213812016-08-24 09:55:56 -0700793 deps = [
794 "//third_party/expat",
795 ]
796 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500797 "src/svg/SkSVGCanvas.cpp",
798 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700799 "src/xml/SkDOM.cpp",
800 "src/xml/SkXMLParser.cpp",
801 "src/xml/SkXMLWriter.cpp",
802 ]
803}
804
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700805if (skia_enable_gpu && skia_generate_workarounds) {
806 action("workaround_list") {
807 script = "tools/build_workaround_header.py"
808
809 inputs = [
810 "src/gpu/gpu_workaround_list.txt",
811 ]
812
813 # see comments in skia_compile_processors about out dir path shenanigans.
814 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700815 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700816
817 outputs = [
818 "$root_out_dir/$output_file",
819 ]
820 args = [
821 "--output-file",
822 "$output_file",
823 ]
824
825 foreach(file, inputs) {
826 args += [ rebase_path(file, root_build_dir) ]
827 }
828 }
829}
830
mtkleinc04ff472016-06-23 10:29:30 -0700831component("skia") {
832 public_configs = [ ":skia_public" ]
833 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700834
835 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700836 ":arm64",
837 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700838 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700839 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500840 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700841 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700842 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500843 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700844 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700845 ":fontmgr_fuchsia",
Greg Danielda16cce2018-08-01 09:23:57 -0400846 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400847 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500848 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700849 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700850 ":none",
mtklein63213812016-08-24 09:55:56 -0700851 ":pdf",
852 ":png",
scroggof84ad642016-10-31 09:02:57 -0700853 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500854 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700855 ":sse2",
856 ":sse41",
857 ":sse42",
858 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700859 ":webp",
mtklein63213812016-08-24 09:55:56 -0700860 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700861 ]
862
Chinmay Garde43f115c2016-11-16 15:04:12 -0800863 # This file (and all GN files in Skia) are designed to work with an
864 # empty sources assignment filter; we handle all that explicitly.
865 # We clear the filter here for clients who may have set up a global filter.
866 set_sources_assignment_filter([])
867
mtkleinc04ff472016-06-23 10:29:30 -0700868 sources = []
brettwb9447282016-09-01 14:24:39 -0700869 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700870 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500871 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700872 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400873 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500874 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700875 "src/android/SkBitmapRegionCodec.cpp",
876 "src/android/SkBitmapRegionDecoder.cpp",
877 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400878 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700879 "src/codec/SkBmpCodec.cpp",
880 "src/codec/SkBmpMaskCodec.cpp",
881 "src/codec/SkBmpRLECodec.cpp",
882 "src/codec/SkBmpStandardCodec.cpp",
883 "src/codec/SkCodec.cpp",
884 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -0400885 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -0400886 "src/codec/SkEncodedInfo.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
Kevin Lubick217056c2018-09-20 17:39:31 -0400953 if (is_linux || target_cpu == "wasm") {
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
Kevin Lubickcbcff382018-10-02 09:02:18 -0400999static_library("pathkit") {
1000 public_configs = [ ":skia_public" ]
1001 configs += skia_library_configs
1002
1003 deps = [
1004 ":arm64",
1005 ":armv7",
1006 ":avx",
1007 ":crc32",
1008 ":hsw",
1009 ":none",
1010 ":sse2",
1011 ":sse41",
1012 ":sse42",
1013 ":ssse3",
1014 ]
1015
1016 # This file (and all GN files in Skia) are designed to work with an
1017 # empty sources assignment filter; we handle all that explicitly.
1018 # We clear the filter here for clients who may have set up a global filter.
1019 set_sources_assignment_filter([])
1020
1021 sources = []
1022 sources += skia_pathops_sources
1023 sources += [
1024 "src/core/SkAnalyticEdge.cpp",
1025 "src/core/SkArenaAlloc.cpp",
1026 "src/core/SkCubicMap.cpp",
1027 "src/core/SkEdge.cpp",
1028 "src/core/SkEdgeBuilder.cpp",
1029 "src/core/SkEdgeClipper.cpp",
1030 "src/core/SkGeometry.cpp",
1031 "src/core/SkLineClipper.cpp",
1032 "src/core/SkMallocPixelRef.cpp",
1033 "src/core/SkMath.cpp",
1034 "src/core/SkMatrix.cpp",
1035 "src/core/SkOpts.cpp",
1036 "src/core/SkPaint.cpp",
1037 "src/core/SkPath.cpp",
1038 "src/core/SkPathEffect.cpp",
1039 "src/core/SkPathMeasure.cpp",
1040 "src/core/SkPathRef.cpp",
1041 "src/core/SkPoint.cpp",
1042 "src/core/SkRRect.cpp",
1043 "src/core/SkRect.cpp",
1044 "src/core/SkSemaphore.cpp",
1045 "src/core/SkStream.cpp",
1046 "src/core/SkString.cpp",
1047 "src/core/SkStringUtils.cpp",
1048 "src/core/SkStroke.cpp",
1049 "src/core/SkStrokeRec.cpp",
1050 "src/core/SkStrokerPriv.cpp",
1051 "src/core/SkThreadID.cpp",
1052 "src/core/SkUtils.cpp",
1053 "src/effects/SkDashPathEffect.cpp",
1054 "src/effects/SkTrimPathEffect.cpp",
1055 "src/ports/SkDebug_stdio.cpp",
1056 "src/ports/SkMemory_malloc.cpp",
1057 "src/utils/SkDashPath.cpp",
1058 "src/utils/SkParse.cpp",
1059 "src/utils/SkParsePath.cpp",
1060 "src/utils/SkUTF.cpp",
1061 ]
1062}
1063
mtkleinc095df52016-08-24 12:23:52 -07001064# Targets guarded by skia_enable_tools may use //third_party freely.
1065if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001066 # Used by gn_to_bp.py to list our public include dirs.
1067 source_set("public") {
1068 configs += [ ":skia_public" ]
1069 }
1070
Mike Kleinc36dedf2016-11-18 09:35:28 -05001071 config("skia.h_config") {
1072 include_dirs = [ "$target_gen_dir" ]
1073 }
1074 action("skia.h") {
1075 public_configs = [ ":skia.h_config" ]
1076 skia_h = "$target_gen_dir/skia.h"
1077 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001078
1079 # TODO: would be cool to not hard-code these here, but how?
1080 module_public_includes = [
1081 "modules/sksg/include",
1082 "modules/skottie/include",
1083 ]
1084 args =
1085 [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1086 [ rebase_path(skia_h, root_build_dir) ] +
1087 rebase_path(skia_public_includes) + rebase_path(module_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001088 depfile = "$skia_h.deps"
1089 outputs = [
1090 skia_h,
1091 ]
1092 }
1093
Brian Osmanc9a42472018-05-31 13:17:12 -04001094 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001095 executable("fiddle") {
1096 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001097 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001098 "tools/fiddle/draw.cpp",
1099 "tools/fiddle/fiddle_main.cpp",
1100 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001101
1102 if (skia_use_egl) {
1103 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001104 } else {
1105 sources += [ "tools/fiddle/null_context.cpp" ]
1106 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001107 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001108 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001109 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001110 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001111 ":skia",
1112 ":skia.h",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001113 "modules/skottie",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001114 ]
1115 }
1116 }
1117
Brian Osmanc9a42472018-05-31 13:17:12 -04001118 source_set("public_headers_warnings_check") {
1119 sources = [
1120 "tools/public_headers_warnings_check.cpp",
1121 ]
1122 configs -= [ "//gn:warnings_except_public_headers" ]
1123 deps = [
1124 ":skia",
1125 ":skia.h",
1126 "modules/skottie",
1127 ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001128 }
1129
mtkleinc095df52016-08-24 12:23:52 -07001130 template("test_lib") {
1131 config(target_name + "_config") {
1132 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001133 if (defined(invoker.public_defines)) {
1134 defines = invoker.public_defines
1135 }
mtklein25c81d42016-07-27 13:55:26 -07001136 }
mtkleinc095df52016-08-24 12:23:52 -07001137 source_set(target_name) {
1138 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1139 public_configs = [
1140 ":" + target_name + "_config",
1141 ":skia_private",
1142 ]
1143
1144 if (!defined(deps)) {
1145 deps = []
1146 }
1147 deps += [ ":skia" ]
1148 testonly = true
1149 }
mtklein25c81d42016-07-27 13:55:26 -07001150 }
mtklein25c81d42016-07-27 13:55:26 -07001151
Mike Kleine6682eb2017-01-05 10:54:57 -05001152 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001153 if (is_ios) {
1154 app_name = target_name
1155 gen_path = target_gen_dir
1156
1157 action("${app_name}_generate_info_plist") {
1158 script = "//gn/gen_plist_ios.py"
1159 outputs = [
1160 "$gen_path/${app_name}_Info.plist",
1161 ]
1162 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1163 }
1164
1165 bundle_data("${app_name}_bundle_info_plist") {
1166 public_deps = [
1167 ":${app_name}_generate_info_plist",
1168 ]
1169 sources = [
1170 "$gen_path/${app_name}_Info.plist",
1171 ]
1172 outputs = [
1173 "{{bundle_root_dir}}/Info.plist",
1174 ]
1175 }
1176
Jim Van Verth329c5a62017-11-29 11:42:33 -05001177 bundle_ios_data =
1178 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1179
1180 if (bundle_ios_data) {
1181 has_skps =
1182 "True" == exec_script("//gn/checkdir.py",
1183 [ rebase_path("skps", root_build_dir) ],
1184 "trim string")
1185 bundle_data("${app_name}_bundle_resources") {
1186 sources = [
1187 "resources",
1188 ]
1189 outputs = [
1190 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1191 "{{bundle_resources_dir}}/data/resources",
1192 ]
1193 }
1194
1195 if (has_skps) {
1196 bundle_data("${app_name}_bundle_skps") {
1197 sources = [
1198 "skps",
1199 ]
1200 outputs = [
1201 # Store in same folder as resources
1202 "{{bundle_resources_dir}}/data/skps",
1203 ]
1204 }
1205 }
1206 }
1207
Jim Van Verth443a9132017-11-28 09:45:26 -05001208 executable("${app_name}_generate_executable") {
1209 forward_variables_from(invoker,
1210 "*",
1211 [
1212 "output_name",
1213 "visibility",
1214 "is_shared_library",
1215 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001216 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001217 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001218 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1219 }
1220
1221 bundle_data("${app_name}_bundle_executable") {
1222 public_deps = [
1223 ":${app_name}_generate_executable",
1224 ]
1225 sources = [
1226 "$gen_path/$app_name",
1227 ]
1228 outputs = [
1229 "{{bundle_executable_dir}}/$app_name",
1230 ]
1231 testonly = true
1232 }
1233
1234 create_bundle("$app_name") {
1235 product_type = "com.apple.product-type.application"
1236 testonly = true
1237
1238 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1239 bundle_resources_dir = bundle_root_dir
1240 bundle_executable_dir = bundle_root_dir
1241 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1242
1243 deps = [
1244 ":${app_name}_bundle_executable",
1245 ":${app_name}_bundle_info_plist",
1246 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001247 if (bundle_ios_data) {
1248 deps += [ ":${app_name}_bundle_resources" ]
1249 if (has_skps) {
1250 deps += [ ":${app_name}_bundle_skps" ]
1251 }
1252 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001253
1254 # should only code sign when running on a device, not the simulator
1255 if (target_cpu != "x64") {
1256 code_signing_script = "//gn/codesign_ios.py"
1257 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1258 code_signing_outputs = [
1259 "$bundle_root_dir/_CodeSignature/CodeResources",
1260 "$bundle_root_dir/embedded.mobileprovision",
1261 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001262 code_signing_args = [
1263 rebase_path("$bundle_root_dir", root_build_dir),
1264 skia_ios_identity,
1265 skia_ios_profile,
1266 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001267 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001268 }
1269 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001270 # !is_ios
1271
1272 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1273 shared_library("lib" + target_name) {
1274 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1275 configs += [ ":skia_private" ]
1276 testonly = true
1277 }
1278 } else {
1279 _executable = target_name
1280 executable(_executable) {
1281 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1282 configs += [ ":skia_private" ]
1283 testonly = true
1284 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001285 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001286 if (is_android && skia_android_serial != "" && defined(_executable)) {
1287 action("push_" + target_name) {
1288 script = "gn/push_to_android.py"
1289 deps = [
1290 ":" + _executable,
1291 ]
1292 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1293 outputs = [
1294 _stamp,
1295 ]
1296 args = [
1297 rebase_path("$root_build_dir/$_executable"),
1298 skia_android_serial,
1299 rebase_path(_stamp),
1300 ]
1301 testonly = true
1302 }
Mike Klein7d921032017-01-05 12:20:41 -05001303 }
1304 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001305 }
1306
Greg Danielda16cce2018-08-01 09:23:57 -04001307 config("moltenvk_config") {
1308 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1309 if (is_ios) {
1310 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
1311 } else {
1312 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
1313 }
1314 cflags = [ "-F$moltenvk_framework_path" ]
1315 ldflags = [ "-F$moltenvk_framework_path" ]
1316 libs = [
1317 "MoltenVK.framework",
1318 "Metal.framework",
1319 "IOSurface.framework",
1320 "QuartzCore.framework",
1321 "Foundation.framework",
1322 ]
1323 if (is_ios) {
1324 libs += [ "UIKit.framework" ]
1325 } else {
1326 libs += [ "IOKit.framework" ]
1327 }
1328 defines = [ "SK_MOLTENVK" ]
1329 }
1330 }
1331
1332 source_set("moltenvk") {
1333 public_configs = [ ":moltenvk_config" ]
1334 }
1335
mtkleinc095df52016-08-24 12:23:52 -07001336 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001337 public_include_dirs = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001338 public_defines = []
1339 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001340
Brian Osmanc9a42472018-05-31 13:17:12 -04001341 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001342 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001343 sources = [
1344 "tools/gpu/GrContextFactory.cpp",
1345 "tools/gpu/GrTest.cpp",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001346 "tools/gpu/MemoryCache.cpp",
1347 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001348 "tools/gpu/ProxyUtils.cpp",
1349 "tools/gpu/TestContext.cpp",
1350 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
1351 "tools/gpu/gl/GLTestContext.cpp",
1352 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04001353 "tools/gpu/gl/null/NullGLTestContext.cpp",
1354 "tools/gpu/mock/MockTestContext.cpp",
1355 ]
1356 libs = []
1357
1358 if (is_android || skia_use_egl) {
1359 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1360 } else if (is_ios) {
1361 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1362 libs += [ "OpenGLES.framework" ]
1363 } else if (is_linux) {
1364 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -04001365 libs += [
1366 "GLU",
1367 "X11",
1368 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001369 } else if (is_mac) {
1370 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
1371 } else if (is_win) {
1372 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1373 libs += [
1374 "Gdi32.lib",
1375 "OpenGL32.lib",
mtklein38925aa2016-09-21 10:11:25 -07001376 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001377 }
mtklein25c81d42016-07-27 13:55:26 -07001378
Brian Osmanc9a42472018-05-31 13:17:12 -04001379 cflags_objcc = [ "-fobjc-arc" ]
mtklein6ef69992016-09-14 06:12:09 -07001380
Brian Osmanc9a42472018-05-31 13:17:12 -04001381 if (skia_use_angle) {
1382 deps += [ "//third_party/angle2" ]
1383 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1384 }
Greg Danielb4d89562018-10-03 18:44:49 +00001385 public_include_dirs += [ "third_party/vulkan" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001386 if (skia_use_vulkan) {
1387 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
1388 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Greg Danielda16cce2018-08-01 09:23:57 -04001389 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1390 public_deps += [ ":moltenvk" ]
1391 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001392 }
1393 if (skia_use_metal) {
1394 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001395 }
mtklein25c81d42016-07-27 13:55:26 -07001396 }
mtklein25c81d42016-07-27 13:55:26 -07001397
mtkleinc095df52016-08-24 12:23:52 -07001398 test_lib("flags") {
1399 public_include_dirs = [ "tools/flags" ]
1400 sources = [
1401 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001402 ]
1403 }
1404 test_lib("common_flags") {
1405 public_include_dirs = [ "tools/flags" ]
1406 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001407 "tools/flags/SkCommonFlags.cpp",
1408 "tools/flags/SkCommonFlagsConfig.cpp",
1409 ]
1410 deps = [
mtklein046cb562016-09-16 10:23:12 -07001411 ":flags",
Greg Danielda16cce2018-08-01 09:23:57 -04001412 ]
1413 public_deps = [
mtkleinc095df52016-08-24 12:23:52 -07001414 ":gpu_tool_utils",
1415 ]
1416 }
mtklein25c81d42016-07-27 13:55:26 -07001417
mtkleinc095df52016-08-24 12:23:52 -07001418 test_lib("tool_utils") {
1419 public_include_dirs = [
1420 "tools",
1421 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001422 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001423 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001424 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001425 ]
1426 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001427 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001428 "tools/CrashHandler.cpp",
Robert Phillips96601082018-05-29 16:13:26 -04001429 "tools/DDLPromiseImageHelper.cpp",
1430 "tools/DDLTileHelper.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001431 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001432 "tools/ProcStats.cpp",
1433 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001434 "tools/UrlDataManager.cpp",
1435 "tools/debugger/SkDebugCanvas.cpp",
1436 "tools/debugger/SkDrawCommand.cpp",
1437 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001438 "tools/fonts/SkRandomScalerContext.cpp",
Herb Derby33ac15e2018-08-29 12:36:22 -04001439 "tools/fonts/SkTestEmptyTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001440 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001441 "tools/fonts/SkTestFontMgr.h",
1442 "tools/fonts/SkTestSVGTypeface.cpp",
1443 "tools/fonts/SkTestSVGTypeface.h",
1444 "tools/fonts/SkTestTypeface.cpp",
1445 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001446 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001447 "tools/random_parse_path.cpp",
1448 "tools/sk_tool_utils.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001449 "tools/timer/SkAnimTimer.h",
mtkleinc095df52016-08-24 12:23:52 -07001450 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001451 "tools/trace/SkChromeTracingTracer.cpp",
1452 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001453 "tools/trace/SkDebugfTracer.cpp",
1454 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001455 "tools/trace/SkEventTracingPriv.cpp",
1456 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001457 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001458 libs = []
1459 if (is_ios) {
1460 sources += [ "tools/ios_utils.m" ]
1461 libs += [ "Foundation.framework" ]
1462 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001463 defines = []
1464 if (skia_tools_require_resources) {
1465 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1466 }
mtkleinc095df52016-08-24 12:23:52 -07001467 deps = [
Ben Wagner97182cc2018-02-15 10:20:04 -05001468 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001469 ":flags",
1470 "//third_party/libpng",
1471 ]
1472 public_deps = [
Greg Danielda16cce2018-08-01 09:23:57 -04001473 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001474 "//third_party/jsoncpp",
1475 ]
1476 }
mtklein25c81d42016-07-27 13:55:26 -07001477
Mike Klein6e744122016-10-27 12:21:40 -04001478 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001479 test_lib("gm") {
1480 public_include_dirs = [ "gm" ]
1481 sources = gm_sources
1482 deps = [
scroggo19b91532016-10-24 09:03:26 -07001483 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001484 ":skia",
1485 ":tool_utils",
Mike Reed2f0edd52018-05-31 14:22:30 -04001486 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001487 "modules/skottie:gm",
Florin Malita3b526b02018-05-25 12:43:51 -04001488 "modules/sksg",
mtkleinc095df52016-08-24 12:23:52 -07001489 ]
Greg Danielda16cce2018-08-01 09:23:57 -04001490 public_deps = [
1491 ":gpu_tool_utils",
1492 ]
mtkleinc095df52016-08-24 12:23:52 -07001493 }
mtklein25c81d42016-07-27 13:55:26 -07001494
Mike Klein6e744122016-10-27 12:21:40 -04001495 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001496 test_lib("tests") {
1497 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001498 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001499 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001500 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001501 }
Ben Wagner37a06c02018-06-22 21:11:00 +00001502 if (!(skia_use_freetype && skia_use_fontconfig)) {
1503 sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
1504 }
mtkleinc095df52016-08-24 12:23:52 -07001505 deps = [
Hal Canary0f666812018-03-22 15:21:12 -04001506 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001507 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001508 ":skia",
1509 ":tool_utils",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001510 "modules/skottie:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001511 "modules/sksg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001512 "//third_party/libpng",
1513 "//third_party/zlib",
1514 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001515 public_deps = [
1516 ":gpu_tool_utils", # Test.h #includes headers from this target.
1517 ]
mtkleinc095df52016-08-24 12:23:52 -07001518 }
mtklein2f3416d2016-08-02 16:02:05 -07001519
Mike Klein6e744122016-10-27 12:21:40 -04001520 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001521 test_lib("bench") {
1522 public_include_dirs = [ "bench" ]
1523 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001524 deps = [
1525 ":flags",
1526 ":gm",
1527 ":gpu_tool_utils",
1528 ":skia",
1529 ":tool_utils",
1530 ]
1531 }
mtklein2b6870c2016-07-28 14:17:33 -07001532
mtkleinc095df52016-08-24 12:23:52 -07001533 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001534 public_include_dirs = []
1535 if (skia_use_expat) {
1536 public_include_dirs += [ "experimental/svg/model" ]
1537 sources = [
1538 "experimental/svg/model/SkSVGAttribute.cpp",
1539 "experimental/svg/model/SkSVGAttributeParser.cpp",
1540 "experimental/svg/model/SkSVGCircle.cpp",
1541 "experimental/svg/model/SkSVGClipPath.cpp",
1542 "experimental/svg/model/SkSVGContainer.cpp",
1543 "experimental/svg/model/SkSVGDOM.cpp",
1544 "experimental/svg/model/SkSVGEllipse.cpp",
1545 "experimental/svg/model/SkSVGGradient.cpp",
1546 "experimental/svg/model/SkSVGLine.cpp",
1547 "experimental/svg/model/SkSVGLinearGradient.cpp",
1548 "experimental/svg/model/SkSVGNode.cpp",
1549 "experimental/svg/model/SkSVGPath.cpp",
1550 "experimental/svg/model/SkSVGPattern.cpp",
1551 "experimental/svg/model/SkSVGPoly.cpp",
1552 "experimental/svg/model/SkSVGRadialGradient.cpp",
1553 "experimental/svg/model/SkSVGRect.cpp",
1554 "experimental/svg/model/SkSVGRenderContext.cpp",
1555 "experimental/svg/model/SkSVGSVG.cpp",
1556 "experimental/svg/model/SkSVGShape.cpp",
1557 "experimental/svg/model/SkSVGStop.cpp",
1558 "experimental/svg/model/SkSVGTransformableNode.cpp",
1559 "experimental/svg/model/SkSVGUse.cpp",
1560 "experimental/svg/model/SkSVGValue.cpp",
1561 ]
1562 deps = [
1563 ":skia",
1564 ":xml",
1565 ]
1566 }
mtkleinc095df52016-08-24 12:23:52 -07001567 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001568
Mike Klein38af9432016-11-11 11:39:44 -05001569 if (skia_use_lua) {
1570 test_lib("lua") {
1571 public_include_dirs = []
1572 sources = [
1573 "src/utils/SkLua.cpp",
1574 "src/utils/SkLuaCanvas.cpp",
1575 ]
1576 deps = [
Herb Derby264182c2018-05-29 15:53:40 -04001577 "modules/skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001578 "//third_party/lua",
1579 ]
1580 }
1581
Mike Kleine6682eb2017-01-05 10:54:57 -05001582 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001583 sources = [
1584 "tools/lua/lua_app.cpp",
1585 ]
1586 deps = [
1587 ":lua",
1588 ":skia",
1589 "//third_party/lua",
1590 ]
Mike Klein38af9432016-11-11 11:39:44 -05001591 }
1592
Mike Kleine6682eb2017-01-05 10:54:57 -05001593 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001594 sources = [
1595 "tools/lua/lua_pictures.cpp",
1596 ]
1597 deps = [
1598 ":flags",
1599 ":lua",
1600 ":skia",
1601 ":tool_utils",
1602 "//third_party/lua",
1603 ]
Mike Klein38af9432016-11-11 11:39:44 -05001604 }
1605 }
1606
Cary Clark8032b982017-07-28 11:04:54 -04001607 test_app("bookmaker") {
1608 sources = [
1609 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001610 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001611 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001612 "tools/bookmaker/fiddleParser.cpp",
1613 "tools/bookmaker/includeParser.cpp",
1614 "tools/bookmaker/includeWriter.cpp",
1615 "tools/bookmaker/mdOut.cpp",
1616 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001617 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001618 "tools/bookmaker/spellCheck.cpp",
1619 ]
1620 deps = [
1621 ":flags",
1622 ":skia",
1623 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001624 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001625 ]
1626 }
1627
Florin Malitabfe876a2018-09-02 12:33:59 -04001628 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04001629 test_app("skottie_tool") {
1630 deps = [
1631 "modules/skottie:tool",
1632 ]
1633 }
1634 }
1635
Kevin Lubickebf648e2017-09-21 13:45:16 -04001636 if (target_cpu != "wasm") {
1637 import("gn/samples.gni")
1638 test_lib("samples") {
1639 public_include_dirs = [ "samplecode" ]
1640 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001641 sources = samples_sources
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001642 public_deps = [
1643 ":tool_utils",
1644 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001645 deps = [
1646 ":experimental_svg_model",
1647 ":flags",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001648 ":xml",
Herb Derby264182c2018-05-29 15:53:40 -04001649 "modules/skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001650 ]
Mike Klein38af9432016-11-11 11:39:44 -05001651
Ruiqi Maof5101492018-06-29 14:32:21 -04001652 # NIMA does not build on Windows clang
1653 if (!is_win || !is_clang) {
1654 deps += [ "//third_party/Nima-Cpp" ]
1655 }
1656
Kevin Lubickebf648e2017-09-21 13:45:16 -04001657 if (skia_use_lua) {
1658 sources += [ "samplecode/SampleLua.cpp" ]
1659 deps += [
1660 ":lua",
1661 "//third_party/lua",
1662 ]
1663 }
1664 }
Mike Klein7af351a2018-07-27 09:54:43 -04001665 test_app("imgcvt") {
1666 sources = [
1667 "tools/imgcvt.cpp",
1668 ]
1669 deps = [
1670 ":skcms",
1671 ":skia",
1672 ]
1673 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04001674 test_app("dm") {
1675 sources = [
1676 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001677 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001678 "dm/DMJsonWriter.cpp",
1679 "dm/DMSrcSink.cpp",
1680 ]
1681 include_dirs = [ "tests" ]
1682 deps = [
1683 ":common_flags",
1684 ":experimental_svg_model",
1685 ":flags",
1686 ":gm",
1687 ":gpu_tool_utils",
1688 ":skia",
1689 ":tests",
1690 ":tool_utils",
Florin Malita3d856bd2018-05-26 09:49:28 -04001691 "modules/skottie",
Florin Malita3b526b02018-05-25 12:43:51 -04001692 "modules/sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001693 "//third_party/jsoncpp",
1694 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001695 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04001696
1697 # NIMA does not build on Windows clang
1698 if (!is_win || !is_clang) {
1699 deps += [ "//third_party/Nima-Cpp" ]
1700 }
Mike Klein38af9432016-11-11 11:39:44 -05001701 }
Brian Osman16adfa32016-10-18 14:42:44 -04001702 }
1703
Mike Kleina8a51ce2018-01-09 12:34:11 -05001704 if (!is_win) {
1705 test_app("remote_demo") {
1706 sources = [
1707 "tools/remote_demo.cpp",
1708 ]
1709 deps = [
1710 ":skia",
1711 ]
1712 }
1713 }
1714
Mike Kleine6682eb2017-01-05 10:54:57 -05001715 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001716 sources = [
1717 "bench/nanobench.cpp",
1718 ]
1719 deps = [
1720 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001721 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001722 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001723 ":flags",
1724 ":gm",
1725 ":gpu_tool_utils",
1726 ":skia",
1727 ":tool_utils",
Florin Malita3b526b02018-05-25 12:43:51 -04001728 "modules/sksg",
mtklein2b6870c2016-07-28 14:17:33 -07001729 "//third_party/jsoncpp",
1730 ]
mtklein2b6870c2016-07-28 14:17:33 -07001731 }
halcanary19a97202016-08-03 15:08:04 -07001732
Ravi Mistry10d36c52017-01-31 09:49:18 -05001733 test_app("skpinfo") {
1734 sources = [
1735 "tools/skpinfo.cpp",
1736 ]
1737 deps = [
1738 ":flags",
1739 ":skia",
1740 ]
1741 }
1742
Brian Osmanc9a42472018-05-31 13:17:12 -04001743 test_app("skpbench") {
1744 sources = [
1745 "tools/skpbench/skpbench.cpp",
1746 ]
1747 deps = [
1748 ":flags",
1749 ":gpu_tool_utils",
1750 ":skia",
1751 ":tool_utils",
1752 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07001753 }
1754
Mike Kleine6682eb2017-01-05 10:54:57 -05001755 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001756 sources = [
Herb Derby264182c2018-05-29 15:53:40 -04001757 "tools/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001758 ]
1759 deps = [
1760 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04001761 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001762 ]
halcanary3eee9d92016-09-10 07:01:53 -07001763 }
mtklein046cb562016-09-16 10:23:12 -07001764
Ben Wagner219f3622017-07-17 15:32:25 -04001765 test_app("create_test_font") {
1766 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001767 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001768 ]
1769 deps = [
1770 ":skia",
1771 ]
1772 assert_no_deps = [
1773 # tool_utils requires the output of this app.
1774 ":tool_utils",
1775 ]
1776 }
1777
Florin Malita5d3ff432018-07-31 16:38:43 -04001778 if (skia_use_expat) {
1779 test_app("create_test_font_color") {
1780 sources = [
1781 "tools/fonts/create_test_font_color.cpp",
1782 ]
1783 deps = [
1784 ":flags",
1785 ":skia",
1786 ":tool_utils",
1787 ]
1788 }
Ben Wagner97182cc2018-02-15 10:20:04 -05001789 }
1790
Mike Kleine6682eb2017-01-05 10:54:57 -05001791 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001792 sources = [
1793 "tools/get_images_from_skps.cpp",
1794 ]
1795 deps = [
1796 ":flags",
1797 ":skia",
mtklein046cb562016-09-16 10:23:12 -07001798 ]
mtklein046cb562016-09-16 10:23:12 -07001799 }
mtkleinecbc5262016-09-22 11:51:24 -07001800
Kevin Lubickebf648e2017-09-21 13:45:16 -04001801 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001802 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001803 sources = [
1804 "tools/skiaserve/Request.cpp",
1805 "tools/skiaserve/Response.cpp",
1806 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001807 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1808 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1809 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1810 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1811 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1812 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1813 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1814 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1815 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001816 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1817 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001818 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1819 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1820 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1821 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1822 ]
1823 deps = [
1824 ":flags",
1825 ":gpu_tool_utils",
1826 ":skia",
1827 ":tool_utils",
1828 "//third_party/jsoncpp",
1829 "//third_party/libmicrohttpd",
1830 "//third_party/libpng",
1831 ]
Mike Klein7d302882016-11-03 14:06:31 -04001832 }
mtkleinecbc5262016-09-22 11:51:24 -07001833 }
kjlubick14f984b2016-10-03 11:49:45 -07001834
Mike Kleine6682eb2017-01-05 10:54:57 -05001835 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001836 include_dirs = [
1837 "tools",
1838 "tools/debugger",
1839 ]
kjlubick14f984b2016-10-03 11:49:45 -07001840 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001841 "fuzz/Fuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001842 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001843 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001844 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001845 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001846 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001847 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001848 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001849 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001850 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04001851 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001852 "fuzz/FuzzRegionOp.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04001853 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001854 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1855 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001856 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04001857 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04001858 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001859 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001860 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1861 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001862 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001863 "tools/UrlDataManager.cpp",
1864 "tools/debugger/SkDebugCanvas.cpp",
1865 "tools/debugger/SkDrawCommand.cpp",
1866 "tools/debugger/SkJsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001867 ]
1868 deps = [
1869 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001870 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001871 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04001872 "modules/skottie:fuzz",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001873 "//third_party/jsoncpp",
1874 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001875 ]
kjlubick14f984b2016-10-03 11:49:45 -07001876 }
Mike Klein38312422016-10-05 15:41:01 -04001877
Mike Kleine6682eb2017-01-05 10:54:57 -05001878 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001879 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001880 rebase_path("tests/skia_test.cpp"),
1881 rebase_path("tests/Test.cpp"),
1882 ]
caryclark9feb6322016-10-25 08:58:26 -07001883 deps = [
1884 ":flags",
1885 ":gpu_tool_utils",
1886 ":skia",
1887 ":tool_utils",
1888 ]
caryclark9feb6322016-10-25 08:58:26 -07001889 }
1890
Mike Kleine6682eb2017-01-05 10:54:57 -05001891 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001892 sources = [
1893 "tools/DumpRecord.cpp",
1894 "tools/dump_record.cpp",
1895 ]
1896 deps = [
1897 ":flags",
1898 ":skia",
1899 ]
Mike Klein38312422016-10-05 15:41:01 -04001900 }
bungemanfe917272016-10-13 17:36:40 -04001901
Mike Kleine6682eb2017-01-05 10:54:57 -05001902 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001903 sources = [
1904 "tools/skdiff/skdiff.cpp",
1905 "tools/skdiff/skdiff_html.cpp",
1906 "tools/skdiff/skdiff_main.cpp",
1907 "tools/skdiff/skdiff_utils.cpp",
1908 ]
1909 deps = [
1910 ":skia",
1911 ":tool_utils",
1912 ]
bungemanfe917272016-10-13 17:36:40 -04001913 }
halcanarya73d76a2016-10-17 13:19:02 -07001914
Mike Kleine6682eb2017-01-05 10:54:57 -05001915 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001916 sources = [
1917 "tools/skp_parser.cpp",
1918 ]
1919 deps = [
1920 ":skia",
1921 ":tool_utils",
1922 "//third_party/jsoncpp",
1923 ]
halcanarya73d76a2016-10-17 13:19:02 -07001924 }
Brian Osman16adfa32016-10-18 14:42:44 -04001925
Brian Osmanc9a42472018-05-31 13:17:12 -04001926 if (!is_win) {
Hal Canaryd7b38452017-12-11 17:46:26 -05001927 test_lib("skqp_lib") {
1928 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001929 defines =
1930 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001931 if (skia_skqp_enable_driver_correctness_workarounds) {
1932 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1933 }
Hal Canary75427132017-10-11 16:00:31 -04001934 sources = [
1935 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001936 "tools/skqp/gm_knowledge.cpp",
1937 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001938 ]
1939 deps = [
1940 ":gm",
1941 ":gpu_tool_utils",
1942 ":skia",
1943 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001944 ":tool_utils",
1945 ]
1946 }
1947 test_app("skqp") {
1948 sources = [
1949 "tools/skqp/skqp.cpp",
1950 ]
1951 deps = [
1952 ":skia",
1953 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001954 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001955 "//third_party/googletest",
1956 ]
1957 }
1958 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001959 if (is_android) {
Hal Canary28f89382017-12-12 09:42:14 -05001960 test_app("skqp_app") {
1961 is_shared_library = true
1962 sources = [
1963 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1964 ]
1965 deps = [
1966 ":skia",
1967 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001968 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001969 ]
1970 libs = [ "android" ]
1971 }
1972 }
Stan Iliev93151722018-08-02 11:10:52 -04001973 if (is_android && skia_enable_gpu) {
1974 test_app("skottie_android") {
1975 is_shared_library = true
1976
1977 sources = [
1978 "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
1979 "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
1980 ]
1981 libs = []
1982
1983 include_dirs = []
1984 deps = [
1985 ":skia",
1986 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04001987 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04001988 ]
1989 }
1990 }
Hal Canary75427132017-10-11 16:00:31 -04001991
Hal Canarya9de7602018-01-19 13:08:23 -05001992 test_app("list_gms") {
1993 sources = [
1994 "tools/list_gms.cpp",
1995 ]
1996 deps = [
1997 ":gm",
1998 ":skia",
1999 ]
2000 }
2001 test_app("list_gpu_unit_tests") {
2002 sources = [
2003 "dm/DMGpuTestProcs.cpp",
2004 "tools/list_gpu_unit_tests.cpp",
2005 ]
2006 deps = [
2007 ":skia",
2008 ":tests",
2009 ]
2010 }
2011
Brian Osmanc9a42472018-05-31 13:17:12 -04002012 test_lib("sk_app") {
2013 public_include_dirs = [ "tools/sk_app" ]
2014 sources = [
2015 "tools/sk_app/CommandSet.cpp",
2016 "tools/sk_app/GLWindowContext.cpp",
2017 "tools/sk_app/Window.cpp",
2018 ]
2019 libs = []
2020
2021 if (is_android) {
2022 sources += [
2023 "tools/sk_app/android/GLWindowContext_android.cpp",
2024 "tools/sk_app/android/RasterWindowContext_android.cpp",
2025 "tools/sk_app/android/Window_android.cpp",
2026 "tools/sk_app/android/main_android.cpp",
2027 "tools/sk_app/android/surface_glue_android.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002028 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002029 libs += [ "android" ]
2030 } else if (is_linux) {
2031 sources += [
2032 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2033 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2034 "tools/sk_app/unix/Window_unix.cpp",
2035 "tools/sk_app/unix/keysym2ucs.c",
2036 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002037 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002038 libs += [
2039 "GL",
2040 "X11",
2041 ]
2042 } else if (is_win) {
2043 sources += [
2044 "tools/sk_app/win/GLWindowContext_win.cpp",
2045 "tools/sk_app/win/RasterWindowContext_win.cpp",
2046 "tools/sk_app/win/Window_win.cpp",
2047 "tools/sk_app/win/main_win.cpp",
2048 ]
Brian Salomon194db172017-08-17 14:37:06 -04002049 if (skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002050 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002051 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002052 } else if (is_mac) {
2053 sources += [
2054 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2055 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2056 "tools/sk_app/mac/Window_mac.cpp",
2057 "tools/sk_app/mac/main_mac.cpp",
2058 ]
2059 libs += [
2060 "QuartzCore.framework",
2061 "Cocoa.framework",
2062 "Foundation.framework",
2063 ]
2064 } else if (is_ios) {
2065 sources += [
2066 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2067 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2068 "tools/sk_app/ios/Window_ios.cpp",
2069 "tools/sk_app/ios/main_ios.cpp",
2070 ]
2071 }
2072
2073 if (skia_use_vulkan) {
2074 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
2075 if (is_android) {
2076 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2077 } else if (is_linux) {
2078 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2079 libs += [ "X11-xcb" ]
2080 } else if (is_win) {
2081 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2082 }
2083 }
2084
2085 deps = [
2086 ":gpu_tool_utils",
2087 ":skia",
2088 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002089 ]
2090 if (is_android) {
2091 deps += [ "//third_party/native_app_glue" ]
2092 } else if (is_mac || is_ios) {
2093 deps += [ "//third_party/libsdl" ]
2094 }
2095 if (skia_use_angle) {
2096 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002097 }
Brian Osman16adfa32016-10-18 14:42:44 -04002098 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002099
Brian Osmanc9a42472018-05-31 13:17:12 -04002100 test_app("viewer") {
2101 is_shared_library = is_android
2102 if (is_ios) {
2103 bundle_ios_data = true
Brian Osmaneff04b52017-11-21 13:18:02 -05002104 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002105 sources = [
2106 "tools/viewer/BisectSlide.cpp",
2107 "tools/viewer/GMSlide.cpp",
2108 "tools/viewer/ImGuiLayer.cpp",
2109 "tools/viewer/ImageSlide.cpp",
2110 "tools/viewer/SKPSlide.cpp",
2111 "tools/viewer/SampleSlide.cpp",
2112 "tools/viewer/SkottieSlide.cpp",
2113 "tools/viewer/SlideDir.cpp",
2114 "tools/viewer/StatsLayer.cpp",
2115 "tools/viewer/SvgSlide.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002116 "tools/viewer/TouchGesture.cpp",
Leon Scroggins III81886e82018-08-22 11:18:08 -04002117 "tools/viewer/TouchGesture.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002118 "tools/viewer/Viewer.cpp",
2119 ]
2120 libs = []
2121
2122 include_dirs = []
2123 deps = [
2124 ":experimental_svg_model",
2125 ":flags",
2126 ":gm",
2127 ":gpu_tool_utils",
2128 ":samples",
2129 ":sk_app",
2130 ":skia",
2131 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002132 "modules/skottie",
2133 "modules/sksg",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002134 "modules/sksg:samples",
Brian Osmanc9a42472018-05-31 13:17:12 -04002135 "//third_party/imgui",
Brian Osmanc9a42472018-05-31 13:17:12 -04002136 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04002137
2138 # NIMA does not build on Windows clang
2139 if (!is_win || !is_clang) {
2140 sources += [ "tools/viewer/NIMASlide.cpp" ]
2141 deps += [ "//third_party/Nima-Cpp" ]
2142 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002143 }
2144
ziadbbceddbc2018-06-19 13:57:15 -04002145 if (is_android) {
2146 test_app("arcore") {
2147 is_shared_library = true
2148 configs = [
2149 ":skia_public",
2150 "gn:default",
2151 ]
2152
2153 # For internship expedience, yes, we're rebuilding Skia rather than depending on :skia.
2154 # At the moment there's no way to use Skia and Skottie/SkShaper unless they're in the same .so.
2155 sources = []
2156 sources += skia_core_sources
2157 sources += skia_utils_sources
2158 sources += skia_xps_sources
2159 sources += [
2160 "src/android/SkAndroidFrameworkUtils.cpp",
2161 "src/android/SkAnimatedImage.cpp",
2162 "src/android/SkBitmapRegionCodec.cpp",
2163 "src/android/SkBitmapRegionDecoder.cpp",
2164 "src/codec/SkAndroidCodec.cpp",
2165 "src/codec/SkBmpBaseCodec.cpp",
2166 "src/codec/SkBmpCodec.cpp",
2167 "src/codec/SkBmpMaskCodec.cpp",
2168 "src/codec/SkBmpRLECodec.cpp",
2169 "src/codec/SkBmpStandardCodec.cpp",
2170 "src/codec/SkCodec.cpp",
2171 "src/codec/SkCodecImageGenerator.cpp",
2172 "src/codec/SkColorTable.cpp",
2173 "src/codec/SkGifCodec.cpp",
2174 "src/codec/SkMaskSwizzler.cpp",
2175 "src/codec/SkMasks.cpp",
2176 "src/codec/SkSampledCodec.cpp",
2177 "src/codec/SkSampler.cpp",
2178 "src/codec/SkStreamBuffer.cpp",
2179 "src/codec/SkSwizzler.cpp",
2180 "src/codec/SkWbmpCodec.cpp",
2181 "src/images/SkImageEncoder.cpp",
2182 "src/ports/SkDiscardableMemory_none.cpp",
2183 "src/ports/SkImageGenerator_skia.cpp",
2184 "src/ports/SkMemory_malloc.cpp",
2185 "src/ports/SkOSFile_stdio.cpp",
2186 "src/sfnt/SkOTTable_name.cpp",
2187 "src/sfnt/SkOTUtils.cpp",
2188 "src/utils/mac/SkStream_mac.cpp",
2189 "third_party/gif/SkGifImageReader.cpp",
2190 ]
2191 deps = [
2192 ":tool_utils",
2193 "modules/skottie",
2194 "modules/skshaper",
2195 ]
2196 }
2197 }
2198
Brian Osmanc9a42472018-05-31 13:17:12 -04002199 if (!skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002200 test_app("HelloWorld") {
2201 sources = [
2202 "example/HelloWorld.cpp",
2203 ]
2204 libs = []
2205
2206 include_dirs = []
2207 deps = [
2208 ":flags",
2209 ":gpu_tool_utils",
2210 ":sk_app",
2211 ":skia",
2212 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002213 ]
2214 }
2215 }
2216
Brian Osmanc9a42472018-05-31 13:17:12 -04002217 if (is_linux || is_mac || is_ios) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002218 test_app("SkiaSDLExample") {
2219 sources = [
2220 "example/SkiaSDLExample.cpp",
2221 ]
2222 libs = []
2223 include_dirs = []
2224 deps = [
2225 ":gpu_tool_utils",
2226 ":skia",
2227 "//third_party/libsdl",
2228 ]
2229 }
2230 }
2231
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002232 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2233 action_foreach("generate_mocs") {
2234 script = "gn/call.py"
2235 sources = [
2236 "tools/mdbviz/MainWindow.h",
2237 ]
2238 outputs = [
2239 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2240 ]
2241 args = [
2242 "$skia_qt_path" + "/bin/moc",
2243 "{{source}}",
2244 "-o",
2245 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2246 ]
2247 }
2248 action_foreach("generate_resources") {
2249 script = "gn/call.py"
2250 sources = [
2251 "tools/mdbviz/resources.qrc",
2252 ]
2253 outputs = [
2254 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2255 ]
2256 args = [
2257 "$skia_qt_path" + "/bin/rcc",
2258 "{{source}}",
2259 "-o",
2260 "gen/mdbviz/{{source_name_part}}_res.cpp",
2261 ]
2262 }
2263 test_app("mdbviz") {
2264 if (is_win) {
2265 # on Windows we need to disable some exception handling warnings due to the Qt headers
2266 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2267 }
2268 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002269 "tools/UrlDataManager.cpp",
2270 "tools/debugger/SkDebugCanvas.cpp",
2271 "tools/debugger/SkDrawCommand.cpp",
2272 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002273 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002274 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002275 "tools/mdbviz/main.cpp",
2276
2277 # generated files
2278 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2279 "$target_gen_dir/mdbviz/resources_res.cpp",
2280 ]
2281 lib_dirs = [ "$skia_qt_path/lib" ]
2282 libs = [
2283 "Qt5Core.lib",
2284 "Qt5Gui.lib",
2285 "Qt5Widgets.lib",
2286 ]
2287 include_dirs = [
2288 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002289 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002290 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002291 "tools",
2292 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002293 ]
2294 deps = [
2295 ":generate_mocs",
2296 ":generate_resources",
2297 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002298 "//third_party/jsoncpp",
2299 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002300 ]
2301 }
2302 }
2303
Mike Kleine459afd2017-03-03 09:21:30 -05002304 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002305 copy("gdbserver") {
2306 sources = [
2307 "$ndk/$ndk_gdbserver",
2308 ]
2309 outputs = [
2310 "$root_out_dir/gdbserver",
2311 ]
2312 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002313 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002314
2315 if (skia_use_opencl) {
2316 test_app("hello-opencl") {
2317 sources = [
2318 "src/compute/common/cl/assert_cl.c",
2319 "src/compute/common/cl/find_cl.c",
2320 "tools/hello-opencl.cpp",
2321 ]
2322 include_dirs = [ "src/compute/common" ]
Ben Wagner30a4e3d2018-08-07 16:58:15 -04002323 if (is_linux) {
2324 libs = [ "OpenCL" ]
2325 } else if (is_win) {
2326 libs = [ "OpenCL.lib" ]
2327 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002328 }
2329 }
mtklein25c81d42016-07-27 13:55:26 -07002330}