blob: 37d22a623efdf30225e5a38d3e7e4c43997917e3 [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
Kevin Lubickca7c2972018-10-17 13:52:24 +000042 skia_enable_nvpr = !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
Kevin Lubick32dfdbe2018-10-18 09:47:01 -040050 skia_enable_skpicture = true
Mike Klein3669a822017-03-03 10:55:02 -050051 skia_enable_tools = is_skia_dev_build
52 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Danielda16cce2018-08-01 09:23:57 -040053 skia_vulkan_header = "" # temporary as we remove the use from clients
Robert Phillipsa6d2d702017-09-01 12:17:03 -040054 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040055 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070056 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070057 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040058
Hal Canary4689b542018-01-31 11:54:14 -050059 skia_skqp_enable_driver_correctness_workarounds = false
Hal Canary2331c822018-02-01 14:06:13 -050060 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040061
62 skia_llvm_path = ""
63 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040064
65 skia_tools_require_resources = false
mtkleinc04ff472016-06-23 10:29:30 -070066}
Brian Salomon23d73ea2016-10-27 13:31:37 -040067declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040068 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040069 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050070 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Mike Klein10d665d2016-11-01 11:46:10 -040071
Mike Klein4d598a32016-10-31 13:44:49 -040072 if (is_android) {
73 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070074 } else if (is_fuchsia) {
75 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040076 } else {
Greg Daniel91dfa3b2018-05-22 13:25:15 -040077 skia_use_vulkan = (defined(skia_vulkan_sdk) && skia_vulkan_sdk != "") ||
78 (defined(skia_moltenvk_path) && skia_moltenvk_path != "")
Mike Klein4d598a32016-10-31 13:44:49 -040079 }
Jim Van Verth4e502972017-12-07 15:16:10 -050080
81 if (is_ios) {
82 skia_ios_identity = ".*Google.*"
83 skia_ios_profile = "Google Development"
84 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040085}
Brian Salomon789e25e2016-09-30 13:41:03 -040086
Adam Barth54ef74a2017-10-13 10:59:38 -070087if (defined(skia_settings)) {
88 import(skia_settings)
89}
90
Brian Osmanc9a42472018-05-31 13:17:12 -040091# Our tools require static linking (they use non-exported symbols), and the GPU backend.
92skia_enable_tools = skia_enable_tools && !is_component_build && skia_enable_gpu
mtklein06c35c02016-09-20 12:28:12 -070093
mtkleina45be612016-08-29 15:22:10 -070094fontmgr_android_enabled = skia_use_expat && skia_use_freetype
95
mtklein1211e0c2016-07-26 13:55:45 -070096skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070097 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070098 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070099 "include/codec",
100 "include/config",
101 "include/core",
Hal Canary23564b92018-09-07 14:33:14 -0400102 "include/docs",
mtklein1211e0c2016-07-26 13:55:45 -0700103 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -0400104 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -0700105 "include/gpu",
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500106 "include/atlastext",
mtklein1211e0c2016-07-26 13:55:45 -0700107 "include/pathops",
108 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -0700109 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700110 "include/utils",
111 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700112]
113
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500114if (skia_enable_atlas_text) {
115 skia_public_includes += [ "include/atlastext" ]
116}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000117
mtkleinc04ff472016-06-23 10:29:30 -0700118# Skia public API, generally provided by :skia.
119config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700120 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -0400121 defines = []
122 if (is_component_build) {
123 defines += [ "SKIA_DLL" ]
124 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400125 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700126 defines += [ "SK_SAMPLES_FOR_X" ]
127 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400128 if (skia_enable_flutter_defines) {
129 defines += flutter_defines
Kevin Lubickf4def342018-10-04 12:52:50 -0400130
131 # Flutter always wants this https://github.com/flutter/flutter/issues/11402
132 defines += [ "SK_ENABLE_DUMP_GPU" ]
Brian Osmanf2c90142017-07-13 15:50:03 -0400133 }
mtklein06c35c02016-09-20 12:28:12 -0700134 if (!skia_enable_gpu) {
135 defines += [ "SK_SUPPORT_GPU=0" ]
136 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500137 if (skia_enable_atlas_text) {
138 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
139 }
mtkleinc04ff472016-06-23 10:29:30 -0700140}
141
142# Skia internal APIs, used by Skia itself and a few test tools.
143config("skia_private") {
144 visibility = [ ":*" ]
145
146 include_dirs = [
147 "include/private",
148 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700149 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700150 "src/core",
151 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700152 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700153 "src/image",
154 "src/images",
155 "src/lazy",
156 "src/opts",
157 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700158 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700159 "src/ports",
160 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400161 "src/shaders",
162 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700163 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700164 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700165 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500166 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700167 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700168 ]
mtklein150d1132016-08-01 06:56:40 -0700169
Mike Reeda9e241d2017-05-03 10:52:00 -0400170 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700171 if (is_android) {
172 defines += [
173 "SK_GAMMA_EXPONENT=1.4",
174 "SK_GAMMA_CONTRAST=0.0",
175 ]
176 }
mtklein88a7ac02016-09-14 11:16:49 -0700177 if (is_official_build || is_android) {
178 # TODO(bsalomon): it'd be nice to make Android normal.
179 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
180 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400181 libs = []
182 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500183 if (skia_enable_gpu) {
184 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500185 if (is_skia_dev_build && skia_use_vulkan) {
186 include_dirs += [ "tools/gpu/vk" ]
187 }
Brian Salomon03e05842017-02-23 12:23:47 -0500188 }
Brian Osman34755e22016-12-05 09:46:02 -0500189 if (skia_use_angle) {
190 defines += [ "SK_ANGLE" ]
191 }
Brian Osman3f375d02016-12-28 11:19:22 -0500192 if (skia_enable_discrete_gpu) {
193 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
194 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400195 if (!is_official_build) {
196 defines += [ "GR_TEST_UTILS=1" ]
197 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400198 if (skia_llvm_path != "") {
199 defines += [ "SK_LLVM_AVAILABLE" ]
200 include_dirs += [ "$skia_llvm_path/include" ]
201 libs += [ skia_llvm_lib ]
202 lib_dirs += [ "$skia_llvm_path/lib/" ]
203 }
mtkleinc04ff472016-06-23 10:29:30 -0700204}
205
206# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
207config("skia_library") {
208 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700209 defines = [ "SKIA_IMPLEMENTATION=1" ]
210}
211
212skia_library_configs = [
213 ":skia_public",
214 ":skia_private",
215 ":skia_library",
216]
217
mtklein9b8583d2016-08-24 17:32:30 -0700218# Use for CPU-specific Skia code that needs particular compiler flags.
219template("opts") {
220 if (invoker.enabled) {
221 source_set(target_name) {
222 forward_variables_from(invoker, "*")
223 configs += skia_library_configs
224 }
225 } else {
226 # If not enabled, a phony empty target that swallows all otherwise unused variables.
227 source_set(target_name) {
228 forward_variables_from(invoker,
229 "*",
230 [
231 "sources",
232 "cflags",
233 ])
234 }
235 }
anmittala7eaf2e2016-08-17 13:57:26 -0700236}
237
mtklein422310d2016-08-16 18:28:43 -0700238is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700239
mtklein7d6fb2c2016-08-25 14:50:44 -0700240opts("none") {
241 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700242 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700243 cflags = []
244}
245
mtklein7d6fb2c2016-08-25 14:50:44 -0700246opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700247 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700248 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700249 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700250}
251
252opts("arm64") {
253 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700254 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700255 cflags = []
256}
257
258opts("crc32") {
259 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700260 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700261 cflags = [ "-march=armv8-a+crc" ]
262}
263
mtklein9b8583d2016-08-24 17:32:30 -0700264opts("sse2") {
265 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700266 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400267 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400268 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
269 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400270 cflags = [ "-msse2" ]
271 }
mtklein9b8583d2016-08-24 17:32:30 -0700272}
mtkleinc04ff472016-06-23 10:29:30 -0700273
mtklein9b8583d2016-08-24 17:32:30 -0700274opts("ssse3") {
275 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700276 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400277 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400278 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
279 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400280 cflags = [ "-mssse3" ]
281 }
mtklein9b8583d2016-08-24 17:32:30 -0700282}
mtkleinc04ff472016-06-23 10:29:30 -0700283
mtklein9b8583d2016-08-24 17:32:30 -0700284opts("sse41") {
285 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700286 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400287 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400288 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
289 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400290 cflags = [ "-msse4.1" ]
291 }
mtklein9b8583d2016-08-24 17:32:30 -0700292}
mtklein4e976072016-08-08 09:06:27 -0700293
mtklein9b8583d2016-08-24 17:32:30 -0700294opts("sse42") {
295 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700296 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400297 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400298 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
299 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400300 cflags = [ "-msse4.2" ]
301 }
mtklein9b8583d2016-08-24 17:32:30 -0700302}
303
304opts("avx") {
305 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700306 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400307 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000308 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400309 } else {
310 cflags = [ "-mavx" ]
311 }
mtkleinc04ff472016-06-23 10:29:30 -0700312}
313
Mike Klein1b9b7d52018-02-27 10:37:40 -0500314opts("hsw") {
315 enabled = is_x86
316 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400317 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500318 cflags = [ "/arch:AVX2" ]
319 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000320 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500321 }
322
323 # Oddly, clang-cl doesn't recognize this as a valid flag.
324 # If it ever does, it'd nice to move this up with -mavx2 and co.
325 if (is_clang && !is_win) {
326 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
327 # but nice to have, generating slightly better code for paths without explicit FMAs.
328 cflags += [ "-ffp-contract=fast" ]
329 }
330}
331
mtkleinc095df52016-08-24 12:23:52 -0700332# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700333template("optional") {
334 if (invoker.enabled) {
335 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700336 if (defined(invoker.public_defines)) {
337 defines = invoker.public_defines
338 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600339 if (defined(invoker.public_configs)) {
340 configs = invoker.public_configs
341 }
mtklein457b42a2016-08-23 13:56:37 -0700342 }
343 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700344 forward_variables_from(invoker,
345 "*",
346 [
347 "public_defines",
348 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700349 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700350 ])
mtklein457b42a2016-08-23 13:56:37 -0700351 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700352 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700353 if (defined(invoker.configs_to_remove)) {
354 configs -= invoker.configs_to_remove
355 }
mtklein457b42a2016-08-23 13:56:37 -0700356 }
357 } else {
mtklein457b42a2016-08-23 13:56:37 -0700358 source_set(target_name) {
359 forward_variables_from(invoker,
360 "*",
361 [
362 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400363 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700364 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700365 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700366 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700367 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700368 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700369 ])
mtkleincd01b032016-08-31 04:58:19 -0700370 if (defined(invoker.sources_when_disabled)) {
371 sources = invoker.sources_when_disabled
372 }
373 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700374 }
mtkleineb3c4252016-08-23 07:38:09 -0700375 }
mtklein457b42a2016-08-23 13:56:37 -0700376}
mtklein457b42a2016-08-23 13:56:37 -0700377
Mike Kleina04bb452017-02-09 12:24:07 -0500378optional("effects") {
379 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400380 deps = [
381 ":compile_processors",
382 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500383 sources =
384 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
Mike Reed0917fad2018-06-19 10:17:30 -0400385 if (skia_enable_effects_imagefilters) {
386 sources += skia_effects_imagefilter_sources
Kevin Lubick32dfdbe2018-10-18 09:47:01 -0400387 if (!skia_enable_skpicture) {
388 sources -= [ "//src/effects/imagefilters/SkPictureImageFilter.cpp" ]
389 }
Mike Reed0917fad2018-06-19 10:17:30 -0400390 } else {
391 sources += [ "src/ports/SkGlobalInitialization_none_imagefilters.cpp" ]
392 }
393 sources_when_disabled = [
394 "src/ports/SkGlobalInitialization_none.cpp",
395 "src/ports/SkGlobalInitialization_none_imagefilters.cpp",
396 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500397}
398
mtkleina45be612016-08-29 15:22:10 -0700399optional("fontmgr_android") {
400 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700401
402 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500403 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700404 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700405 ]
406 sources = [
407 "src/ports/SkFontMgr_android.cpp",
408 "src/ports/SkFontMgr_android_factory.cpp",
409 "src/ports/SkFontMgr_android_parser.cpp",
410 ]
411}
412
mtkleind2e39db2016-09-07 07:52:55 -0700413optional("fontmgr_custom") {
Kevin Lubick217056c2018-09-20 17:39:31 -0400414 enabled = (is_linux || target_cpu == "wasm") && skia_use_freetype &&
415 !skia_use_fontconfig
mtkleind2e39db2016-09-07 07:52:55 -0700416
417 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500418 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700419 ]
420 sources = [
421 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500422 "src/ports/SkFontMgr_custom.h",
423 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700424 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500425 "src/ports/SkFontMgr_custom_embedded.cpp",
426 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700427 ]
428}
429
Hal Canaryff2742e2018-01-30 11:35:47 -0500430optional("fontmgr_empty") {
431 enabled = skia_enable_fontmgr_empty
432 sources = [
433 "src/ports/SkFontMgr_empty_factory.cpp",
434 ]
435}
436
mtklein3cc22182016-08-29 13:26:14 -0700437optional("fontmgr_fontconfig") {
438 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700439
440 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500441 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700442 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700443 ]
444 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700445 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700446 "src/ports/SkFontConfigInterface_direct.cpp",
447 "src/ports/SkFontConfigInterface_direct_factory.cpp",
448 "src/ports/SkFontMgr_FontConfigInterface.cpp",
449 "src/ports/SkFontMgr_fontconfig.cpp",
450 "src/ports/SkFontMgr_fontconfig_factory.cpp",
451 ]
452}
453
mtkleincdedd0e2016-09-12 15:15:44 -0700454optional("fontmgr_fuchsia") {
455 enabled = is_fuchsia && skia_use_freetype
456
457 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500458 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700459 ]
460 sources = [
461 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500462 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700463 "src/ports/SkFontMgr_custom_empty_factory.cpp",
464 ]
465}
466
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700467if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400468 executable("sksllex") {
469 sources = [
470 "src/sksl/lex/Main.cpp",
471 "src/sksl/lex/NFA.cpp",
472 "src/sksl/lex/RegexNode.cpp",
473 "src/sksl/lex/RegexParser.cpp",
474 ]
475 include_dirs = [ "src/sksl/lex" ]
476 }
477
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700478 action("run_sksllex") {
479 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400480 deps = [
481 ":sksllex(//gn/toolchain:$host_toolchain)",
482 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700483 sources = [
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700484 "src/sksl/lex/sksl.lex",
485 ]
486
487 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
488 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
489 outputs = [
490 "$target_out_dir/" +
491 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
492 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
493 # confused due to the same file being named by two different paths
494 ]
495 sksllex_path = "$root_out_dir/"
496 sksllex_path += "sksllex"
497 if (host_os == "win") {
498 sksllex_path += ".exe"
499 }
500 args = [
501 rebase_path(sksllex_path),
502 rebase_path("bin/clang-format"),
503 rebase_path("src"),
504 ]
505 }
506} else {
507 group("run_sksllex") {
508 }
509}
510
511if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400512 executable("skslc") {
513 defines = [ "SKSL_STANDALONE" ]
514 sources = [
515 "src/sksl/SkSLMain.cpp",
516 ]
517 sources += skia_sksl_sources
518 include_dirs = [
519 "src/gpu",
520 "src/sksl",
521 ]
522 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500523 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400524 "//third_party/spirv-tools",
525 ]
526 }
527
528 skia_gpu_processor_outputs = []
529 foreach(src, skia_gpu_processor_sources) {
530 dir = get_path_info(src, "dir")
531 name = get_path_info(src, "name")
532
533 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
534 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
535 skia_gpu_processor_outputs += [
536 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
537 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
538 # confused due to the same file being named by two different paths
539 ]
540 }
541
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500542 action("create_sksl_enums") {
543 script = "gn/create_sksl_enums.py"
544 sources = [
545 "include/private/GrSharedEnums.h",
546 ]
547 outputs = [
548 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500549 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500550 ]
551 args = [
552 rebase_path(sources[0]),
553 rebase_path(outputs[0]),
554 ]
555 }
556
Ethan Nicholas762466e2017-06-29 10:03:38 -0400557 action("compile_processors") {
558 script = "gn/compile_processors.py"
559 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500560 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400561 ":skslc(//gn/toolchain:$host_toolchain)",
562 ]
563 sources = skia_gpu_processor_sources
564 outputs = skia_gpu_processor_outputs
565 skslc_path = "$root_out_dir/"
566 if (host_toolchain != default_toolchain_name) {
567 skslc_path += "$host_toolchain/"
568 }
569 skslc_path += "skslc"
570 if (host_os == "win") {
571 skslc_path += ".exe"
572 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400573 args = [
574 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400575 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400576 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400577 args += rebase_path(skia_gpu_processor_sources)
578 }
579} else {
580 skia_gpu_processor_outputs = []
581 group("compile_processors") {
582 }
583}
584
mtklein06c35c02016-09-20 12:28:12 -0700585optional("gpu") {
586 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400587 deps = [
588 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700589 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400590 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700591 if (skia_generate_workarounds) {
592 deps += [ ":workaround_list" ]
593 }
mtkleine9fb3d52016-09-20 15:11:46 -0700594 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600595 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400596 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700597
Brian Salomon3d6801e2017-12-11 10:06:31 -0500598 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400599 if (!skia_enable_ccpr) {
600 sources -= skia_ccpr_sources
601 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
602 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400603 if (!skia_enable_nvpr) {
604 sources -= skia_nvpr_sources
605 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
606 }
mtklein06c35c02016-09-20 12:28:12 -0700607
608 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500609 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700610 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400611 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700612 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400613 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400614
615 # this lib is required to link against AHardwareBuffer
616 if (defined(ndk_api) && ndk_api >= 26) {
617 libs += [ "android" ]
618 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400619 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500620 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400621 libs += [ "EGL" ]
Chinmay Garded92d0352018-09-17 10:23:28 -0700622 } else if (is_linux && skia_use_x11) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500623 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -0400624 libs += [ "GL" ]
mtklein06c35c02016-09-20 12:28:12 -0700625 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500626 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800627 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500628 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400629 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500630 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400631 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700632 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500633 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700634 }
mtkleine9fb3d52016-09-20 15:11:46 -0700635
636 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400637 public_defines += [ "SK_VULKAN" ]
Greg Daniel18dbfd02018-05-29 10:46:51 -0400638 deps += [ "third_party/vulkanmemoryallocator" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700639 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700640 if (skia_enable_vulkan_debug_layers) {
641 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
642 }
mtkleine9fb3d52016-09-20 15:11:46 -0700643 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400644
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400645 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400646 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400647 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
648 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400649
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400650 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400651 if (skia_use_metal) {
652 public_defines += [ "SK_METAL" ]
653 sources += skia_metal_sources
654 libs += [ "Metal.framework" ]
Greg Daniel53956d92018-08-08 14:41:19 -0400655 libs += [ "Foundation.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400656 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400657 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500658
659 if (skia_enable_atlas_text) {
660 sources += skia_atlas_text_sources
661 }
Kevin Lubickf4def342018-10-04 12:52:50 -0400662
663 if (is_debug) {
664 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
665 }
mtklein06c35c02016-09-20 12:28:12 -0700666}
667
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400668optional("heif") {
669 enabled = skia_use_libheif
670 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
671
672 deps = []
673
674 sources = [
675 "src/codec/SkHeifCodec.cpp",
676 ]
677}
678
mtklein63213812016-08-24 09:55:56 -0700679optional("jpeg") {
680 enabled = skia_use_libjpeg_turbo
681 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
682
mtklein63213812016-08-24 09:55:56 -0700683 deps = [
684 "//third_party/libjpeg-turbo:libjpeg",
685 ]
Mike Kleinf105dc72018-06-05 15:22:54 -0400686 public = [
687 "include/encode/SkJpegEncoder.h",
688 ]
mtklein63213812016-08-24 09:55:56 -0700689 sources = [
690 "src/codec/SkJpegCodec.cpp",
691 "src/codec/SkJpegDecoderMgr.cpp",
692 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700693 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400694 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700695 ]
696}
697
698optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500699 enabled = skia_use_zlib && skia_enable_pdf
700 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700701
mtklein63213812016-08-24 09:55:56 -0700702 deps = [
703 "//third_party/zlib",
704 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400705 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700706 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400707 }
brettwb9447282016-09-01 14:24:39 -0700708 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700709 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700710
711 if (skia_use_sfntly) {
712 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500713 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700714 }
715}
716
717optional("png") {
718 enabled = skia_use_libpng
719 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
720
mtklein63213812016-08-24 09:55:56 -0700721 deps = [
722 "//third_party/libpng",
723 ]
724 sources = [
725 "src/codec/SkIcoCodec.cpp",
726 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400727 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700728 ]
729}
730
scroggof84ad642016-10-31 09:02:57 -0700731optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400732 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700733 public_defines = [ "SK_CODEC_DECODES_RAW" ]
734
735 deps = [
736 "//third_party/dng_sdk",
737 "//third_party/libjpeg-turbo:libjpeg",
738 "//third_party/piex",
739 ]
740
741 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
742 # Skia.
743 configs_to_remove = [ "//gn:no_exceptions" ]
744
745 sources = [
746 "src/codec/SkRawAdapterCodec.cpp",
747 "src/codec/SkRawCodec.cpp",
748 ]
749}
750
Mike Klein852a8cb2018-05-15 10:46:58 -0400751import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -0400752source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -0400753 cflags = []
754 if (!is_win || is_clang) {
755 cflags += [
756 "-w",
757 "-std=c11",
758 ]
759 }
760
761 public = [
762 "third_party/skcms/skcms.h",
763 ]
764 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
765}
766
mtklein3cc22182016-08-29 13:26:14 -0700767optional("typeface_freetype") {
768 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700769
770 deps = [
771 "//third_party/freetype2",
772 ]
773 sources = [
774 "src/ports/SkFontHost_FreeType.cpp",
775 "src/ports/SkFontHost_FreeType_common.cpp",
776 ]
777}
778
mtklein457b42a2016-08-23 13:56:37 -0700779optional("webp") {
780 enabled = skia_use_libwebp
781 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
782
mtklein457b42a2016-08-23 13:56:37 -0700783 deps = [
784 "//third_party/libwebp",
785 ]
786 sources = [
787 "src/codec/SkWebpAdapterCodec.cpp",
788 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400789 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700790 ]
mtkleineb3c4252016-08-23 07:38:09 -0700791}
792
mtklein63213812016-08-24 09:55:56 -0700793optional("xml") {
794 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000795 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700796
mtklein63213812016-08-24 09:55:56 -0700797 deps = [
798 "//third_party/expat",
799 ]
800 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500801 "src/svg/SkSVGCanvas.cpp",
802 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700803 "src/xml/SkDOM.cpp",
804 "src/xml/SkXMLParser.cpp",
805 "src/xml/SkXMLWriter.cpp",
806 ]
807}
808
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700809if (skia_enable_gpu && skia_generate_workarounds) {
810 action("workaround_list") {
811 script = "tools/build_workaround_header.py"
812
813 inputs = [
814 "src/gpu/gpu_workaround_list.txt",
815 ]
816
817 # see comments in skia_compile_processors about out dir path shenanigans.
818 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700819 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700820
821 outputs = [
822 "$root_out_dir/$output_file",
823 ]
824 args = [
825 "--output-file",
826 "$output_file",
827 ]
828
829 foreach(file, inputs) {
830 args += [ rebase_path(file, root_build_dir) ]
831 }
832 }
833}
834
mtkleinc04ff472016-06-23 10:29:30 -0700835component("skia") {
836 public_configs = [ ":skia_public" ]
837 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700838
839 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700840 ":arm64",
841 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700842 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700843 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500844 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700845 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700846 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500847 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700848 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700849 ":fontmgr_fuchsia",
Greg Danielda16cce2018-08-01 09:23:57 -0400850 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400851 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500852 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700853 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700854 ":none",
mtklein63213812016-08-24 09:55:56 -0700855 ":pdf",
856 ":png",
scroggof84ad642016-10-31 09:02:57 -0700857 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500858 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700859 ":sse2",
860 ":sse41",
861 ":sse42",
862 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700863 ":webp",
mtklein63213812016-08-24 09:55:56 -0700864 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700865 ]
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",
Leon Scroggins III22f673d2018-05-30 15:33:46 -0400889 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -0400890 "src/codec/SkEncodedInfo.cpp",
scroggo19b91532016-10-24 09:03:26 -0700891 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700892 "src/codec/SkMaskSwizzler.cpp",
893 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700894 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700895 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700896 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700897 "src/codec/SkSwizzler.cpp",
898 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700899 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700900 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700901 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700902 "src/ports/SkMemory_malloc.cpp",
903 "src/ports/SkOSFile_stdio.cpp",
904 "src/sfnt/SkOTTable_name.cpp",
905 "src/sfnt/SkOTUtils.cpp",
906 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700907 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700908 ]
brettwb9447282016-09-01 14:24:39 -0700909
Kevin Lubick32dfdbe2018-10-18 09:47:01 -0400910 defines = []
911 if (!skia_enable_skpicture) {
912 defines = [ "SK_DISABLE_SKPICTURE" ]
913 sources -= skia_skpicture_sources
914 sources += [ "src/core/SkPicture_none.cpp" ]
915 }
916
mtklein7d6fb2c2016-08-25 14:50:44 -0700917 libs = []
918
mtkleinc04ff472016-06-23 10:29:30 -0700919 if (is_win) {
920 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400921 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700922 "src/ports/SkDebug_win.cpp",
923 "src/ports/SkFontHost_win.cpp",
924 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500925 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700926 "src/ports/SkImageEncoder_WIC.cpp",
927 "src/ports/SkImageGeneratorWIC.cpp",
928 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700929 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700930 "src/ports/SkScalerContext_win_dw.cpp",
931 "src/ports/SkTLS_win.cpp",
932 "src/ports/SkTypeface_win_dw.cpp",
933 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400934 libs += [
935 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500936 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400937 "Ole32.lib",
938 "OleAut32.lib",
939 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500940 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400941 ]
mtkleinc04ff472016-06-23 10:29:30 -0700942 } else {
943 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700944 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700945 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700946 "src/ports/SkTLS_pthread.cpp",
947 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400948 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700949 }
950
mtklein7d6fb2c2016-08-25 14:50:44 -0700951 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500952 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500953 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500954 deps += [ "//third_party/cpu-features" ]
955 }
mtklein06c35c02016-09-20 12:28:12 -0700956 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700957 libs += [
958 "EGL",
959 "GLESv2",
960 "log",
961 ]
962 }
963
Kevin Lubick217056c2018-09-20 17:39:31 -0400964 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -0700965 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400966 if (skia_use_egl) {
967 libs += [ "GLESv2" ]
968 }
mtkleinc04ff472016-06-23 10:29:30 -0700969 }
970
971 if (is_mac) {
972 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700973 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700974 "src/ports/SkFontHost_mac.cpp",
975 "src/ports/SkImageEncoder_CG.cpp",
976 "src/ports/SkImageGeneratorCG.cpp",
977 ]
mtklein09e61f72016-08-23 13:35:28 -0700978 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400979 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
980 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700981 "ApplicationServices.framework",
982 "OpenGL.framework",
983 ]
mtkleinc04ff472016-06-23 10:29:30 -0700984 }
abarth6fc8ff02016-07-15 15:15:15 -0700985
Mike Klein7d302882016-11-03 14:06:31 -0400986 if (is_ios) {
987 sources += [
988 "src/ports/SkDebug_stdio.cpp",
989 "src/ports/SkFontHost_mac.cpp",
990 "src/ports/SkImageEncoder_CG.cpp",
991 "src/ports/SkImageGeneratorCG.cpp",
992 ]
993 libs += [
994 "CoreFoundation.framework",
995 "CoreGraphics.framework",
996 "CoreText.framework",
997 "ImageIO.framework",
998 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400999
1000 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
1001 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001002 ]
1003 }
1004
abarth6fc8ff02016-07-15 15:15:15 -07001005 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001006 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001007 }
mtkleinc04ff472016-06-23 10:29:30 -07001008}
1009
Kevin Lubickcbcff382018-10-02 09:02:18 -04001010static_library("pathkit") {
1011 public_configs = [ ":skia_public" ]
1012 configs += skia_library_configs
1013
1014 deps = [
1015 ":arm64",
1016 ":armv7",
1017 ":avx",
1018 ":crc32",
1019 ":hsw",
1020 ":none",
1021 ":sse2",
1022 ":sse41",
1023 ":sse42",
1024 ":ssse3",
1025 ]
1026
1027 # This file (and all GN files in Skia) are designed to work with an
1028 # empty sources assignment filter; we handle all that explicitly.
1029 # We clear the filter here for clients who may have set up a global filter.
1030 set_sources_assignment_filter([])
1031
1032 sources = []
1033 sources += skia_pathops_sources
1034 sources += [
1035 "src/core/SkAnalyticEdge.cpp",
1036 "src/core/SkArenaAlloc.cpp",
1037 "src/core/SkCubicMap.cpp",
1038 "src/core/SkEdge.cpp",
1039 "src/core/SkEdgeBuilder.cpp",
1040 "src/core/SkEdgeClipper.cpp",
1041 "src/core/SkGeometry.cpp",
1042 "src/core/SkLineClipper.cpp",
1043 "src/core/SkMallocPixelRef.cpp",
1044 "src/core/SkMath.cpp",
1045 "src/core/SkMatrix.cpp",
1046 "src/core/SkOpts.cpp",
1047 "src/core/SkPaint.cpp",
1048 "src/core/SkPath.cpp",
1049 "src/core/SkPathEffect.cpp",
1050 "src/core/SkPathMeasure.cpp",
1051 "src/core/SkPathRef.cpp",
1052 "src/core/SkPoint.cpp",
1053 "src/core/SkRRect.cpp",
1054 "src/core/SkRect.cpp",
1055 "src/core/SkSemaphore.cpp",
1056 "src/core/SkStream.cpp",
1057 "src/core/SkString.cpp",
1058 "src/core/SkStringUtils.cpp",
1059 "src/core/SkStroke.cpp",
1060 "src/core/SkStrokeRec.cpp",
1061 "src/core/SkStrokerPriv.cpp",
1062 "src/core/SkThreadID.cpp",
1063 "src/core/SkUtils.cpp",
1064 "src/effects/SkDashPathEffect.cpp",
1065 "src/effects/SkTrimPathEffect.cpp",
1066 "src/ports/SkDebug_stdio.cpp",
1067 "src/ports/SkMemory_malloc.cpp",
1068 "src/utils/SkDashPath.cpp",
1069 "src/utils/SkParse.cpp",
1070 "src/utils/SkParsePath.cpp",
1071 "src/utils/SkUTF.cpp",
1072 ]
1073}
1074
mtkleinc095df52016-08-24 12:23:52 -07001075# Targets guarded by skia_enable_tools may use //third_party freely.
1076if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001077 # Used by gn_to_bp.py to list our public include dirs.
1078 source_set("public") {
1079 configs += [ ":skia_public" ]
1080 }
1081
Mike Kleinc36dedf2016-11-18 09:35:28 -05001082 config("skia.h_config") {
1083 include_dirs = [ "$target_gen_dir" ]
1084 }
1085 action("skia.h") {
1086 public_configs = [ ":skia.h_config" ]
1087 skia_h = "$target_gen_dir/skia.h"
1088 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001089
1090 # TODO: would be cool to not hard-code these here, but how?
1091 module_public_includes = [
1092 "modules/sksg/include",
1093 "modules/skottie/include",
1094 ]
1095 args =
1096 [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1097 [ rebase_path(skia_h, root_build_dir) ] +
1098 rebase_path(skia_public_includes) + rebase_path(module_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001099 depfile = "$skia_h.deps"
1100 outputs = [
1101 skia_h,
1102 ]
1103 }
1104
Brian Osmanc9a42472018-05-31 13:17:12 -04001105 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001106 executable("fiddle") {
1107 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001108 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001109 "tools/fiddle/draw.cpp",
1110 "tools/fiddle/fiddle_main.cpp",
1111 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001112
1113 if (skia_use_egl) {
1114 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001115 } else {
1116 sources += [ "tools/fiddle/null_context.cpp" ]
1117 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001118 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001119 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001120 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001121 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001122 ":skia",
1123 ":skia.h",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001124 "modules/skottie",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001125 ]
1126 }
1127 }
1128
Brian Osmanc9a42472018-05-31 13:17:12 -04001129 source_set("public_headers_warnings_check") {
1130 sources = [
1131 "tools/public_headers_warnings_check.cpp",
1132 ]
1133 configs -= [ "//gn:warnings_except_public_headers" ]
1134 deps = [
1135 ":skia",
1136 ":skia.h",
1137 "modules/skottie",
1138 ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001139 }
1140
mtkleinc095df52016-08-24 12:23:52 -07001141 template("test_lib") {
1142 config(target_name + "_config") {
1143 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001144 if (defined(invoker.public_defines)) {
1145 defines = invoker.public_defines
1146 }
mtklein25c81d42016-07-27 13:55:26 -07001147 }
mtkleinc095df52016-08-24 12:23:52 -07001148 source_set(target_name) {
1149 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1150 public_configs = [
1151 ":" + target_name + "_config",
1152 ":skia_private",
1153 ]
1154
1155 if (!defined(deps)) {
1156 deps = []
1157 }
1158 deps += [ ":skia" ]
1159 testonly = true
1160 }
mtklein25c81d42016-07-27 13:55:26 -07001161 }
mtklein25c81d42016-07-27 13:55:26 -07001162
Mike Kleine6682eb2017-01-05 10:54:57 -05001163 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001164 if (is_ios) {
1165 app_name = target_name
1166 gen_path = target_gen_dir
1167
1168 action("${app_name}_generate_info_plist") {
1169 script = "//gn/gen_plist_ios.py"
1170 outputs = [
1171 "$gen_path/${app_name}_Info.plist",
1172 ]
1173 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1174 }
1175
1176 bundle_data("${app_name}_bundle_info_plist") {
1177 public_deps = [
1178 ":${app_name}_generate_info_plist",
1179 ]
1180 sources = [
1181 "$gen_path/${app_name}_Info.plist",
1182 ]
1183 outputs = [
1184 "{{bundle_root_dir}}/Info.plist",
1185 ]
1186 }
1187
Jim Van Verth329c5a62017-11-29 11:42:33 -05001188 bundle_ios_data =
1189 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1190
1191 if (bundle_ios_data) {
1192 has_skps =
1193 "True" == exec_script("//gn/checkdir.py",
1194 [ rebase_path("skps", root_build_dir) ],
1195 "trim string")
1196 bundle_data("${app_name}_bundle_resources") {
1197 sources = [
1198 "resources",
1199 ]
1200 outputs = [
1201 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1202 "{{bundle_resources_dir}}/data/resources",
1203 ]
1204 }
1205
1206 if (has_skps) {
1207 bundle_data("${app_name}_bundle_skps") {
1208 sources = [
1209 "skps",
1210 ]
1211 outputs = [
1212 # Store in same folder as resources
1213 "{{bundle_resources_dir}}/data/skps",
1214 ]
1215 }
1216 }
1217 }
1218
Jim Van Verth443a9132017-11-28 09:45:26 -05001219 executable("${app_name}_generate_executable") {
1220 forward_variables_from(invoker,
1221 "*",
1222 [
1223 "output_name",
1224 "visibility",
1225 "is_shared_library",
1226 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001227 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001228 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001229 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1230 }
1231
1232 bundle_data("${app_name}_bundle_executable") {
1233 public_deps = [
1234 ":${app_name}_generate_executable",
1235 ]
1236 sources = [
1237 "$gen_path/$app_name",
1238 ]
1239 outputs = [
1240 "{{bundle_executable_dir}}/$app_name",
1241 ]
1242 testonly = true
1243 }
1244
1245 create_bundle("$app_name") {
1246 product_type = "com.apple.product-type.application"
1247 testonly = true
1248
1249 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1250 bundle_resources_dir = bundle_root_dir
1251 bundle_executable_dir = bundle_root_dir
1252 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1253
1254 deps = [
1255 ":${app_name}_bundle_executable",
1256 ":${app_name}_bundle_info_plist",
1257 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001258 if (bundle_ios_data) {
1259 deps += [ ":${app_name}_bundle_resources" ]
1260 if (has_skps) {
1261 deps += [ ":${app_name}_bundle_skps" ]
1262 }
1263 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001264
1265 # should only code sign when running on a device, not the simulator
1266 if (target_cpu != "x64") {
1267 code_signing_script = "//gn/codesign_ios.py"
1268 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1269 code_signing_outputs = [
1270 "$bundle_root_dir/_CodeSignature/CodeResources",
1271 "$bundle_root_dir/embedded.mobileprovision",
1272 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001273 code_signing_args = [
1274 rebase_path("$bundle_root_dir", root_build_dir),
1275 skia_ios_identity,
1276 skia_ios_profile,
1277 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001278 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001279 }
1280 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001281 # !is_ios
1282
1283 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1284 shared_library("lib" + target_name) {
1285 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1286 configs += [ ":skia_private" ]
1287 testonly = true
1288 }
1289 } else {
1290 _executable = target_name
1291 executable(_executable) {
1292 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1293 configs += [ ":skia_private" ]
1294 testonly = true
1295 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001296 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001297 if (is_android && skia_android_serial != "" && defined(_executable)) {
1298 action("push_" + target_name) {
1299 script = "gn/push_to_android.py"
1300 deps = [
1301 ":" + _executable,
1302 ]
1303 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1304 outputs = [
1305 _stamp,
1306 ]
1307 args = [
1308 rebase_path("$root_build_dir/$_executable"),
1309 skia_android_serial,
1310 rebase_path(_stamp),
1311 ]
1312 testonly = true
1313 }
Mike Klein7d921032017-01-05 12:20:41 -05001314 }
1315 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001316 }
1317
Greg Danielda16cce2018-08-01 09:23:57 -04001318 config("moltenvk_config") {
1319 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1320 if (is_ios) {
1321 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
1322 } else {
1323 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
1324 }
1325 cflags = [ "-F$moltenvk_framework_path" ]
1326 ldflags = [ "-F$moltenvk_framework_path" ]
1327 libs = [
1328 "MoltenVK.framework",
1329 "Metal.framework",
1330 "IOSurface.framework",
1331 "QuartzCore.framework",
1332 "Foundation.framework",
1333 ]
1334 if (is_ios) {
1335 libs += [ "UIKit.framework" ]
1336 } else {
1337 libs += [ "IOKit.framework" ]
1338 }
1339 defines = [ "SK_MOLTENVK" ]
1340 }
1341 }
1342
1343 source_set("moltenvk") {
1344 public_configs = [ ":moltenvk_config" ]
1345 }
1346
mtkleinc095df52016-08-24 12:23:52 -07001347 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001348 public_include_dirs = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001349 public_defines = []
1350 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001351
Brian Osmanc9a42472018-05-31 13:17:12 -04001352 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001353 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001354 sources = [
1355 "tools/gpu/GrContextFactory.cpp",
1356 "tools/gpu/GrTest.cpp",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001357 "tools/gpu/MemoryCache.cpp",
1358 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001359 "tools/gpu/ProxyUtils.cpp",
1360 "tools/gpu/TestContext.cpp",
1361 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
1362 "tools/gpu/gl/GLTestContext.cpp",
1363 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04001364 "tools/gpu/gl/null/NullGLTestContext.cpp",
1365 "tools/gpu/mock/MockTestContext.cpp",
1366 ]
1367 libs = []
1368
1369 if (is_android || skia_use_egl) {
1370 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1371 } else if (is_ios) {
1372 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1373 libs += [ "OpenGLES.framework" ]
1374 } else if (is_linux) {
1375 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -04001376 libs += [
1377 "GLU",
1378 "X11",
1379 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001380 } else if (is_mac) {
1381 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
1382 } else if (is_win) {
1383 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1384 libs += [
1385 "Gdi32.lib",
1386 "OpenGL32.lib",
mtklein38925aa2016-09-21 10:11:25 -07001387 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001388 }
mtklein25c81d42016-07-27 13:55:26 -07001389
Brian Osmanc9a42472018-05-31 13:17:12 -04001390 cflags_objcc = [ "-fobjc-arc" ]
mtklein6ef69992016-09-14 06:12:09 -07001391
Brian Osmanc9a42472018-05-31 13:17:12 -04001392 if (skia_use_angle) {
1393 deps += [ "//third_party/angle2" ]
1394 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1395 }
Greg Danielb4d89562018-10-03 18:44:49 +00001396 public_include_dirs += [ "third_party/vulkan" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001397 if (skia_use_vulkan) {
1398 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
1399 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Greg Danielda16cce2018-08-01 09:23:57 -04001400 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1401 public_deps += [ ":moltenvk" ]
1402 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001403 }
1404 if (skia_use_metal) {
1405 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001406 }
mtklein25c81d42016-07-27 13:55:26 -07001407 }
mtklein25c81d42016-07-27 13:55:26 -07001408
mtkleinc095df52016-08-24 12:23:52 -07001409 test_lib("flags") {
1410 public_include_dirs = [ "tools/flags" ]
1411 sources = [
1412 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001413 ]
1414 }
1415 test_lib("common_flags") {
1416 public_include_dirs = [ "tools/flags" ]
1417 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001418 "tools/flags/SkCommonFlags.cpp",
1419 "tools/flags/SkCommonFlagsConfig.cpp",
1420 ]
1421 deps = [
mtklein046cb562016-09-16 10:23:12 -07001422 ":flags",
Greg Danielda16cce2018-08-01 09:23:57 -04001423 ]
1424 public_deps = [
mtkleinc095df52016-08-24 12:23:52 -07001425 ":gpu_tool_utils",
1426 ]
1427 }
mtklein25c81d42016-07-27 13:55:26 -07001428
mtkleinc095df52016-08-24 12:23:52 -07001429 test_lib("tool_utils") {
1430 public_include_dirs = [
1431 "tools",
1432 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001433 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001434 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001435 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001436 ]
1437 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001438 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001439 "tools/CrashHandler.cpp",
Robert Phillips96601082018-05-29 16:13:26 -04001440 "tools/DDLPromiseImageHelper.cpp",
1441 "tools/DDLTileHelper.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001442 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001443 "tools/ProcStats.cpp",
1444 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001445 "tools/UrlDataManager.cpp",
1446 "tools/debugger/SkDebugCanvas.cpp",
1447 "tools/debugger/SkDrawCommand.cpp",
1448 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001449 "tools/fonts/SkRandomScalerContext.cpp",
Herb Derby33ac15e2018-08-29 12:36:22 -04001450 "tools/fonts/SkTestEmptyTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001451 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001452 "tools/fonts/SkTestFontMgr.h",
1453 "tools/fonts/SkTestSVGTypeface.cpp",
1454 "tools/fonts/SkTestSVGTypeface.h",
1455 "tools/fonts/SkTestTypeface.cpp",
1456 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001457 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001458 "tools/random_parse_path.cpp",
1459 "tools/sk_tool_utils.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001460 "tools/timer/SkAnimTimer.h",
mtkleinc095df52016-08-24 12:23:52 -07001461 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001462 "tools/trace/SkChromeTracingTracer.cpp",
1463 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001464 "tools/trace/SkDebugfTracer.cpp",
1465 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001466 "tools/trace/SkEventTracingPriv.cpp",
1467 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001468 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001469 libs = []
1470 if (is_ios) {
1471 sources += [ "tools/ios_utils.m" ]
1472 libs += [ "Foundation.framework" ]
1473 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001474 defines = []
1475 if (skia_tools_require_resources) {
1476 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1477 }
mtkleinc095df52016-08-24 12:23:52 -07001478 deps = [
Ben Wagner97182cc2018-02-15 10:20:04 -05001479 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001480 ":flags",
1481 "//third_party/libpng",
1482 ]
1483 public_deps = [
Greg Danielda16cce2018-08-01 09:23:57 -04001484 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001485 "//third_party/jsoncpp",
1486 ]
1487 }
mtklein25c81d42016-07-27 13:55:26 -07001488
Mike Klein6e744122016-10-27 12:21:40 -04001489 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001490 test_lib("gm") {
1491 public_include_dirs = [ "gm" ]
1492 sources = gm_sources
1493 deps = [
scroggo19b91532016-10-24 09:03:26 -07001494 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001495 ":skia",
1496 ":tool_utils",
Mike Reed2f0edd52018-05-31 14:22:30 -04001497 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001498 "modules/skottie:gm",
Florin Malita3b526b02018-05-25 12:43:51 -04001499 "modules/sksg",
mtkleinc095df52016-08-24 12:23:52 -07001500 ]
Greg Danielda16cce2018-08-01 09:23:57 -04001501 public_deps = [
1502 ":gpu_tool_utils",
1503 ]
mtkleinc095df52016-08-24 12:23:52 -07001504 }
mtklein25c81d42016-07-27 13:55:26 -07001505
Mike Klein6e744122016-10-27 12:21:40 -04001506 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001507 test_lib("tests") {
1508 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001509 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001510 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001511 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001512 }
Ben Wagner37a06c02018-06-22 21:11:00 +00001513 if (!(skia_use_freetype && skia_use_fontconfig)) {
1514 sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
1515 }
mtkleinc095df52016-08-24 12:23:52 -07001516 deps = [
Hal Canary0f666812018-03-22 15:21:12 -04001517 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001518 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001519 ":skia",
1520 ":tool_utils",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001521 "modules/skottie:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001522 "modules/sksg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001523 "//third_party/libpng",
1524 "//third_party/zlib",
1525 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001526 public_deps = [
1527 ":gpu_tool_utils", # Test.h #includes headers from this target.
1528 ]
mtkleinc095df52016-08-24 12:23:52 -07001529 }
mtklein2f3416d2016-08-02 16:02:05 -07001530
Mike Klein6e744122016-10-27 12:21:40 -04001531 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001532 test_lib("bench") {
1533 public_include_dirs = [ "bench" ]
1534 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001535 deps = [
1536 ":flags",
1537 ":gm",
1538 ":gpu_tool_utils",
1539 ":skia",
1540 ":tool_utils",
1541 ]
1542 }
mtklein2b6870c2016-07-28 14:17:33 -07001543
mtkleinc095df52016-08-24 12:23:52 -07001544 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001545 public_include_dirs = []
1546 if (skia_use_expat) {
1547 public_include_dirs += [ "experimental/svg/model" ]
1548 sources = [
1549 "experimental/svg/model/SkSVGAttribute.cpp",
1550 "experimental/svg/model/SkSVGAttributeParser.cpp",
1551 "experimental/svg/model/SkSVGCircle.cpp",
1552 "experimental/svg/model/SkSVGClipPath.cpp",
1553 "experimental/svg/model/SkSVGContainer.cpp",
1554 "experimental/svg/model/SkSVGDOM.cpp",
1555 "experimental/svg/model/SkSVGEllipse.cpp",
1556 "experimental/svg/model/SkSVGGradient.cpp",
1557 "experimental/svg/model/SkSVGLine.cpp",
1558 "experimental/svg/model/SkSVGLinearGradient.cpp",
1559 "experimental/svg/model/SkSVGNode.cpp",
1560 "experimental/svg/model/SkSVGPath.cpp",
1561 "experimental/svg/model/SkSVGPattern.cpp",
1562 "experimental/svg/model/SkSVGPoly.cpp",
1563 "experimental/svg/model/SkSVGRadialGradient.cpp",
1564 "experimental/svg/model/SkSVGRect.cpp",
1565 "experimental/svg/model/SkSVGRenderContext.cpp",
1566 "experimental/svg/model/SkSVGSVG.cpp",
1567 "experimental/svg/model/SkSVGShape.cpp",
1568 "experimental/svg/model/SkSVGStop.cpp",
1569 "experimental/svg/model/SkSVGTransformableNode.cpp",
1570 "experimental/svg/model/SkSVGUse.cpp",
1571 "experimental/svg/model/SkSVGValue.cpp",
1572 ]
1573 deps = [
1574 ":skia",
1575 ":xml",
1576 ]
1577 }
mtkleinc095df52016-08-24 12:23:52 -07001578 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001579
Mike Klein38af9432016-11-11 11:39:44 -05001580 if (skia_use_lua) {
1581 test_lib("lua") {
1582 public_include_dirs = []
1583 sources = [
1584 "src/utils/SkLua.cpp",
1585 "src/utils/SkLuaCanvas.cpp",
1586 ]
1587 deps = [
Herb Derby264182c2018-05-29 15:53:40 -04001588 "modules/skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001589 "//third_party/lua",
1590 ]
1591 }
1592
Mike Kleine6682eb2017-01-05 10:54:57 -05001593 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001594 sources = [
1595 "tools/lua/lua_app.cpp",
1596 ]
1597 deps = [
1598 ":lua",
1599 ":skia",
1600 "//third_party/lua",
1601 ]
Mike Klein38af9432016-11-11 11:39:44 -05001602 }
1603
Mike Kleine6682eb2017-01-05 10:54:57 -05001604 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001605 sources = [
1606 "tools/lua/lua_pictures.cpp",
1607 ]
1608 deps = [
1609 ":flags",
1610 ":lua",
1611 ":skia",
1612 ":tool_utils",
1613 "//third_party/lua",
1614 ]
Mike Klein38af9432016-11-11 11:39:44 -05001615 }
1616 }
1617
Cary Clark8032b982017-07-28 11:04:54 -04001618 test_app("bookmaker") {
1619 sources = [
1620 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001621 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001622 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001623 "tools/bookmaker/fiddleParser.cpp",
1624 "tools/bookmaker/includeParser.cpp",
1625 "tools/bookmaker/includeWriter.cpp",
1626 "tools/bookmaker/mdOut.cpp",
1627 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001628 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001629 "tools/bookmaker/spellCheck.cpp",
1630 ]
1631 deps = [
1632 ":flags",
1633 ":skia",
1634 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001635 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001636 ]
1637 }
1638
Florin Malitabfe876a2018-09-02 12:33:59 -04001639 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04001640 test_app("skottie_tool") {
1641 deps = [
1642 "modules/skottie:tool",
1643 ]
1644 }
1645 }
1646
Kevin Lubickebf648e2017-09-21 13:45:16 -04001647 if (target_cpu != "wasm") {
1648 import("gn/samples.gni")
1649 test_lib("samples") {
1650 public_include_dirs = [ "samplecode" ]
1651 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001652 sources = samples_sources
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001653 public_deps = [
1654 ":tool_utils",
1655 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001656 deps = [
1657 ":experimental_svg_model",
1658 ":flags",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001659 ":xml",
Herb Derby264182c2018-05-29 15:53:40 -04001660 "modules/skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001661 ]
Mike Klein38af9432016-11-11 11:39:44 -05001662
Ruiqi Maof5101492018-06-29 14:32:21 -04001663 # NIMA does not build on Windows clang
1664 if (!is_win || !is_clang) {
1665 deps += [ "//third_party/Nima-Cpp" ]
1666 }
1667
Kevin Lubickebf648e2017-09-21 13:45:16 -04001668 if (skia_use_lua) {
1669 sources += [ "samplecode/SampleLua.cpp" ]
1670 deps += [
1671 ":lua",
1672 "//third_party/lua",
1673 ]
1674 }
1675 }
Mike Klein7af351a2018-07-27 09:54:43 -04001676 test_app("imgcvt") {
1677 sources = [
1678 "tools/imgcvt.cpp",
1679 ]
1680 deps = [
1681 ":skcms",
1682 ":skia",
1683 ]
1684 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04001685 test_app("dm") {
1686 sources = [
1687 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001688 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001689 "dm/DMJsonWriter.cpp",
1690 "dm/DMSrcSink.cpp",
1691 ]
1692 include_dirs = [ "tests" ]
1693 deps = [
1694 ":common_flags",
1695 ":experimental_svg_model",
1696 ":flags",
1697 ":gm",
1698 ":gpu_tool_utils",
1699 ":skia",
1700 ":tests",
1701 ":tool_utils",
Florin Malita3d856bd2018-05-26 09:49:28 -04001702 "modules/skottie",
Florin Malita3b526b02018-05-25 12:43:51 -04001703 "modules/sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001704 "//third_party/jsoncpp",
1705 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001706 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04001707
1708 # NIMA does not build on Windows clang
1709 if (!is_win || !is_clang) {
1710 deps += [ "//third_party/Nima-Cpp" ]
1711 }
Mike Klein38af9432016-11-11 11:39:44 -05001712 }
Brian Osman16adfa32016-10-18 14:42:44 -04001713 }
1714
Mike Kleina8a51ce2018-01-09 12:34:11 -05001715 if (!is_win) {
1716 test_app("remote_demo") {
1717 sources = [
1718 "tools/remote_demo.cpp",
1719 ]
1720 deps = [
1721 ":skia",
1722 ]
1723 }
1724 }
1725
Mike Kleine6682eb2017-01-05 10:54:57 -05001726 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001727 sources = [
1728 "bench/nanobench.cpp",
1729 ]
1730 deps = [
1731 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001732 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001733 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001734 ":flags",
1735 ":gm",
1736 ":gpu_tool_utils",
1737 ":skia",
1738 ":tool_utils",
Florin Malita3b526b02018-05-25 12:43:51 -04001739 "modules/sksg",
mtklein2b6870c2016-07-28 14:17:33 -07001740 "//third_party/jsoncpp",
1741 ]
mtklein2b6870c2016-07-28 14:17:33 -07001742 }
halcanary19a97202016-08-03 15:08:04 -07001743
Ravi Mistry10d36c52017-01-31 09:49:18 -05001744 test_app("skpinfo") {
1745 sources = [
1746 "tools/skpinfo.cpp",
1747 ]
1748 deps = [
1749 ":flags",
1750 ":skia",
1751 ]
1752 }
1753
Brian Osmanc9a42472018-05-31 13:17:12 -04001754 test_app("skpbench") {
1755 sources = [
1756 "tools/skpbench/skpbench.cpp",
1757 ]
1758 deps = [
1759 ":flags",
1760 ":gpu_tool_utils",
1761 ":skia",
1762 ":tool_utils",
1763 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07001764 }
1765
Mike Kleine6682eb2017-01-05 10:54:57 -05001766 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001767 sources = [
Herb Derby264182c2018-05-29 15:53:40 -04001768 "tools/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001769 ]
1770 deps = [
1771 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04001772 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001773 ]
halcanary3eee9d92016-09-10 07:01:53 -07001774 }
mtklein046cb562016-09-16 10:23:12 -07001775
Ben Wagner219f3622017-07-17 15:32:25 -04001776 test_app("create_test_font") {
1777 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001778 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001779 ]
1780 deps = [
1781 ":skia",
1782 ]
1783 assert_no_deps = [
1784 # tool_utils requires the output of this app.
1785 ":tool_utils",
1786 ]
1787 }
1788
Florin Malita5d3ff432018-07-31 16:38:43 -04001789 if (skia_use_expat) {
1790 test_app("create_test_font_color") {
1791 sources = [
1792 "tools/fonts/create_test_font_color.cpp",
1793 ]
1794 deps = [
1795 ":flags",
1796 ":skia",
1797 ":tool_utils",
1798 ]
1799 }
Ben Wagner97182cc2018-02-15 10:20:04 -05001800 }
1801
Mike Kleine6682eb2017-01-05 10:54:57 -05001802 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001803 sources = [
1804 "tools/get_images_from_skps.cpp",
1805 ]
1806 deps = [
1807 ":flags",
1808 ":skia",
mtklein046cb562016-09-16 10:23:12 -07001809 ]
mtklein046cb562016-09-16 10:23:12 -07001810 }
mtkleinecbc5262016-09-22 11:51:24 -07001811
Kevin Lubickebf648e2017-09-21 13:45:16 -04001812 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001813 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001814 sources = [
1815 "tools/skiaserve/Request.cpp",
1816 "tools/skiaserve/Response.cpp",
1817 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001818 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1819 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1820 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1821 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1822 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1823 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1824 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1825 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1826 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001827 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1828 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001829 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1830 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1831 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1832 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1833 ]
1834 deps = [
1835 ":flags",
1836 ":gpu_tool_utils",
1837 ":skia",
1838 ":tool_utils",
1839 "//third_party/jsoncpp",
1840 "//third_party/libmicrohttpd",
1841 "//third_party/libpng",
1842 ]
Mike Klein7d302882016-11-03 14:06:31 -04001843 }
mtkleinecbc5262016-09-22 11:51:24 -07001844 }
kjlubick14f984b2016-10-03 11:49:45 -07001845
Mike Kleine6682eb2017-01-05 10:54:57 -05001846 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001847 include_dirs = [
1848 "tools",
1849 "tools/debugger",
1850 ]
kjlubick14f984b2016-10-03 11:49:45 -07001851 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001852 "fuzz/Fuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001853 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001854 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001855 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001856 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001857 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001858 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001859 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001860 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001861 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04001862 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001863 "fuzz/FuzzRegionOp.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04001864 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001865 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1866 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001867 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04001868 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04001869 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001870 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001871 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1872 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001873 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001874 "tools/UrlDataManager.cpp",
1875 "tools/debugger/SkDebugCanvas.cpp",
1876 "tools/debugger/SkDrawCommand.cpp",
1877 "tools/debugger/SkJsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001878 ]
1879 deps = [
1880 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001881 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001882 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04001883 "modules/skottie:fuzz",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001884 "//third_party/jsoncpp",
1885 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001886 ]
kjlubick14f984b2016-10-03 11:49:45 -07001887 }
Mike Klein38312422016-10-05 15:41:01 -04001888
Mike Kleine6682eb2017-01-05 10:54:57 -05001889 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001890 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001891 rebase_path("tests/skia_test.cpp"),
1892 rebase_path("tests/Test.cpp"),
1893 ]
caryclark9feb6322016-10-25 08:58:26 -07001894 deps = [
1895 ":flags",
1896 ":gpu_tool_utils",
1897 ":skia",
1898 ":tool_utils",
1899 ]
caryclark9feb6322016-10-25 08:58:26 -07001900 }
1901
Mike Kleine6682eb2017-01-05 10:54:57 -05001902 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001903 sources = [
1904 "tools/DumpRecord.cpp",
1905 "tools/dump_record.cpp",
1906 ]
1907 deps = [
1908 ":flags",
1909 ":skia",
1910 ]
Mike Klein38312422016-10-05 15:41:01 -04001911 }
bungemanfe917272016-10-13 17:36:40 -04001912
Mike Kleine6682eb2017-01-05 10:54:57 -05001913 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001914 sources = [
1915 "tools/skdiff/skdiff.cpp",
1916 "tools/skdiff/skdiff_html.cpp",
1917 "tools/skdiff/skdiff_main.cpp",
1918 "tools/skdiff/skdiff_utils.cpp",
1919 ]
1920 deps = [
1921 ":skia",
1922 ":tool_utils",
1923 ]
bungemanfe917272016-10-13 17:36:40 -04001924 }
halcanarya73d76a2016-10-17 13:19:02 -07001925
Mike Kleine6682eb2017-01-05 10:54:57 -05001926 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001927 sources = [
1928 "tools/skp_parser.cpp",
1929 ]
1930 deps = [
1931 ":skia",
1932 ":tool_utils",
1933 "//third_party/jsoncpp",
1934 ]
halcanarya73d76a2016-10-17 13:19:02 -07001935 }
Brian Osman16adfa32016-10-18 14:42:44 -04001936
Brian Osmanc9a42472018-05-31 13:17:12 -04001937 if (!is_win) {
Hal Canaryd7b38452017-12-11 17:46:26 -05001938 test_lib("skqp_lib") {
1939 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001940 defines =
1941 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001942 if (skia_skqp_enable_driver_correctness_workarounds) {
1943 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1944 }
Hal Canary75427132017-10-11 16:00:31 -04001945 sources = [
1946 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001947 "tools/skqp/gm_knowledge.cpp",
1948 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001949 ]
1950 deps = [
1951 ":gm",
1952 ":gpu_tool_utils",
1953 ":skia",
1954 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001955 ":tool_utils",
1956 ]
1957 }
1958 test_app("skqp") {
1959 sources = [
1960 "tools/skqp/skqp.cpp",
1961 ]
1962 deps = [
1963 ":skia",
1964 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001965 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001966 "//third_party/googletest",
1967 ]
1968 }
1969 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001970 if (is_android) {
Hal Canary28f89382017-12-12 09:42:14 -05001971 test_app("skqp_app") {
1972 is_shared_library = true
1973 sources = [
1974 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1975 ]
1976 deps = [
1977 ":skia",
1978 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001979 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001980 ]
1981 libs = [ "android" ]
1982 }
1983 }
Stan Iliev93151722018-08-02 11:10:52 -04001984 if (is_android && skia_enable_gpu) {
1985 test_app("skottie_android") {
1986 is_shared_library = true
1987
1988 sources = [
1989 "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
1990 "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
1991 ]
1992 libs = []
1993
1994 include_dirs = []
1995 deps = [
1996 ":skia",
1997 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04001998 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04001999 ]
2000 }
2001 }
Hal Canary75427132017-10-11 16:00:31 -04002002
Hal Canarya9de7602018-01-19 13:08:23 -05002003 test_app("list_gms") {
2004 sources = [
2005 "tools/list_gms.cpp",
2006 ]
2007 deps = [
2008 ":gm",
2009 ":skia",
2010 ]
2011 }
2012 test_app("list_gpu_unit_tests") {
2013 sources = [
2014 "dm/DMGpuTestProcs.cpp",
2015 "tools/list_gpu_unit_tests.cpp",
2016 ]
2017 deps = [
2018 ":skia",
2019 ":tests",
2020 ]
2021 }
2022
Brian Osmanc9a42472018-05-31 13:17:12 -04002023 test_lib("sk_app") {
2024 public_include_dirs = [ "tools/sk_app" ]
2025 sources = [
2026 "tools/sk_app/CommandSet.cpp",
2027 "tools/sk_app/GLWindowContext.cpp",
2028 "tools/sk_app/Window.cpp",
2029 ]
2030 libs = []
2031
2032 if (is_android) {
2033 sources += [
2034 "tools/sk_app/android/GLWindowContext_android.cpp",
2035 "tools/sk_app/android/RasterWindowContext_android.cpp",
2036 "tools/sk_app/android/Window_android.cpp",
2037 "tools/sk_app/android/main_android.cpp",
2038 "tools/sk_app/android/surface_glue_android.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002039 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002040 libs += [ "android" ]
2041 } else if (is_linux) {
2042 sources += [
2043 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2044 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2045 "tools/sk_app/unix/Window_unix.cpp",
2046 "tools/sk_app/unix/keysym2ucs.c",
2047 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002048 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002049 libs += [
2050 "GL",
2051 "X11",
2052 ]
2053 } else if (is_win) {
2054 sources += [
2055 "tools/sk_app/win/GLWindowContext_win.cpp",
2056 "tools/sk_app/win/RasterWindowContext_win.cpp",
2057 "tools/sk_app/win/Window_win.cpp",
2058 "tools/sk_app/win/main_win.cpp",
2059 ]
Brian Salomon194db172017-08-17 14:37:06 -04002060 if (skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002061 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002062 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002063 } else if (is_mac) {
2064 sources += [
2065 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2066 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2067 "tools/sk_app/mac/Window_mac.cpp",
2068 "tools/sk_app/mac/main_mac.cpp",
2069 ]
2070 libs += [
2071 "QuartzCore.framework",
2072 "Cocoa.framework",
2073 "Foundation.framework",
2074 ]
2075 } else if (is_ios) {
2076 sources += [
2077 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2078 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2079 "tools/sk_app/ios/Window_ios.cpp",
2080 "tools/sk_app/ios/main_ios.cpp",
2081 ]
2082 }
2083
2084 if (skia_use_vulkan) {
2085 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
2086 if (is_android) {
2087 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2088 } else if (is_linux) {
2089 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2090 libs += [ "X11-xcb" ]
2091 } else if (is_win) {
2092 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2093 }
2094 }
2095
2096 deps = [
2097 ":gpu_tool_utils",
2098 ":skia",
2099 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002100 ]
2101 if (is_android) {
2102 deps += [ "//third_party/native_app_glue" ]
2103 } else if (is_mac || is_ios) {
2104 deps += [ "//third_party/libsdl" ]
2105 }
2106 if (skia_use_angle) {
2107 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002108 }
Brian Osman16adfa32016-10-18 14:42:44 -04002109 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002110
Brian Osmanc9a42472018-05-31 13:17:12 -04002111 test_app("viewer") {
2112 is_shared_library = is_android
2113 if (is_ios) {
2114 bundle_ios_data = true
Brian Osmaneff04b52017-11-21 13:18:02 -05002115 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002116 sources = [
2117 "tools/viewer/BisectSlide.cpp",
2118 "tools/viewer/GMSlide.cpp",
2119 "tools/viewer/ImGuiLayer.cpp",
2120 "tools/viewer/ImageSlide.cpp",
2121 "tools/viewer/SKPSlide.cpp",
2122 "tools/viewer/SampleSlide.cpp",
2123 "tools/viewer/SkottieSlide.cpp",
2124 "tools/viewer/SlideDir.cpp",
2125 "tools/viewer/StatsLayer.cpp",
2126 "tools/viewer/SvgSlide.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002127 "tools/viewer/TouchGesture.cpp",
Leon Scroggins III81886e82018-08-22 11:18:08 -04002128 "tools/viewer/TouchGesture.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002129 "tools/viewer/Viewer.cpp",
2130 ]
2131 libs = []
2132
2133 include_dirs = []
2134 deps = [
2135 ":experimental_svg_model",
2136 ":flags",
2137 ":gm",
2138 ":gpu_tool_utils",
2139 ":samples",
2140 ":sk_app",
2141 ":skia",
2142 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002143 "modules/skottie",
2144 "modules/sksg",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002145 "modules/sksg:samples",
Brian Osmanc9a42472018-05-31 13:17:12 -04002146 "//third_party/imgui",
Brian Osmanc9a42472018-05-31 13:17:12 -04002147 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04002148
2149 # NIMA does not build on Windows clang
2150 if (!is_win || !is_clang) {
2151 sources += [ "tools/viewer/NIMASlide.cpp" ]
2152 deps += [ "//third_party/Nima-Cpp" ]
2153 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002154 }
2155
ziadbbceddbc2018-06-19 13:57:15 -04002156 if (is_android) {
2157 test_app("arcore") {
2158 is_shared_library = true
2159 configs = [
2160 ":skia_public",
2161 "gn:default",
2162 ]
2163
2164 # For internship expedience, yes, we're rebuilding Skia rather than depending on :skia.
2165 # At the moment there's no way to use Skia and Skottie/SkShaper unless they're in the same .so.
2166 sources = []
2167 sources += skia_core_sources
2168 sources += skia_utils_sources
2169 sources += skia_xps_sources
2170 sources += [
2171 "src/android/SkAndroidFrameworkUtils.cpp",
2172 "src/android/SkAnimatedImage.cpp",
2173 "src/android/SkBitmapRegionCodec.cpp",
2174 "src/android/SkBitmapRegionDecoder.cpp",
2175 "src/codec/SkAndroidCodec.cpp",
2176 "src/codec/SkBmpBaseCodec.cpp",
2177 "src/codec/SkBmpCodec.cpp",
2178 "src/codec/SkBmpMaskCodec.cpp",
2179 "src/codec/SkBmpRLECodec.cpp",
2180 "src/codec/SkBmpStandardCodec.cpp",
2181 "src/codec/SkCodec.cpp",
2182 "src/codec/SkCodecImageGenerator.cpp",
2183 "src/codec/SkColorTable.cpp",
2184 "src/codec/SkGifCodec.cpp",
2185 "src/codec/SkMaskSwizzler.cpp",
2186 "src/codec/SkMasks.cpp",
2187 "src/codec/SkSampledCodec.cpp",
2188 "src/codec/SkSampler.cpp",
2189 "src/codec/SkStreamBuffer.cpp",
2190 "src/codec/SkSwizzler.cpp",
2191 "src/codec/SkWbmpCodec.cpp",
2192 "src/images/SkImageEncoder.cpp",
2193 "src/ports/SkDiscardableMemory_none.cpp",
2194 "src/ports/SkImageGenerator_skia.cpp",
2195 "src/ports/SkMemory_malloc.cpp",
2196 "src/ports/SkOSFile_stdio.cpp",
2197 "src/sfnt/SkOTTable_name.cpp",
2198 "src/sfnt/SkOTUtils.cpp",
2199 "src/utils/mac/SkStream_mac.cpp",
2200 "third_party/gif/SkGifImageReader.cpp",
2201 ]
2202 deps = [
2203 ":tool_utils",
2204 "modules/skottie",
2205 "modules/skshaper",
2206 ]
2207 }
2208 }
2209
Brian Osmanc9a42472018-05-31 13:17:12 -04002210 if (!skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002211 test_app("HelloWorld") {
2212 sources = [
2213 "example/HelloWorld.cpp",
2214 ]
2215 libs = []
2216
2217 include_dirs = []
2218 deps = [
2219 ":flags",
2220 ":gpu_tool_utils",
2221 ":sk_app",
2222 ":skia",
2223 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002224 ]
2225 }
2226 }
2227
Brian Osmanc9a42472018-05-31 13:17:12 -04002228 if (is_linux || is_mac || is_ios) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002229 test_app("SkiaSDLExample") {
2230 sources = [
2231 "example/SkiaSDLExample.cpp",
2232 ]
2233 libs = []
2234 include_dirs = []
2235 deps = [
2236 ":gpu_tool_utils",
2237 ":skia",
2238 "//third_party/libsdl",
2239 ]
2240 }
2241 }
2242
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002243 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2244 action_foreach("generate_mocs") {
2245 script = "gn/call.py"
2246 sources = [
2247 "tools/mdbviz/MainWindow.h",
2248 ]
2249 outputs = [
2250 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2251 ]
2252 args = [
2253 "$skia_qt_path" + "/bin/moc",
2254 "{{source}}",
2255 "-o",
2256 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2257 ]
2258 }
2259 action_foreach("generate_resources") {
2260 script = "gn/call.py"
2261 sources = [
2262 "tools/mdbviz/resources.qrc",
2263 ]
2264 outputs = [
2265 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2266 ]
2267 args = [
2268 "$skia_qt_path" + "/bin/rcc",
2269 "{{source}}",
2270 "-o",
2271 "gen/mdbviz/{{source_name_part}}_res.cpp",
2272 ]
2273 }
2274 test_app("mdbviz") {
2275 if (is_win) {
2276 # on Windows we need to disable some exception handling warnings due to the Qt headers
2277 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2278 }
2279 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002280 "tools/UrlDataManager.cpp",
2281 "tools/debugger/SkDebugCanvas.cpp",
2282 "tools/debugger/SkDrawCommand.cpp",
2283 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002284 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002285 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002286 "tools/mdbviz/main.cpp",
2287
2288 # generated files
2289 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2290 "$target_gen_dir/mdbviz/resources_res.cpp",
2291 ]
2292 lib_dirs = [ "$skia_qt_path/lib" ]
2293 libs = [
2294 "Qt5Core.lib",
2295 "Qt5Gui.lib",
2296 "Qt5Widgets.lib",
2297 ]
2298 include_dirs = [
2299 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002300 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002301 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002302 "tools",
2303 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002304 ]
2305 deps = [
2306 ":generate_mocs",
2307 ":generate_resources",
2308 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002309 "//third_party/jsoncpp",
2310 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002311 ]
2312 }
2313 }
2314
Mike Kleine459afd2017-03-03 09:21:30 -05002315 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002316 copy("gdbserver") {
2317 sources = [
2318 "$ndk/$ndk_gdbserver",
2319 ]
2320 outputs = [
2321 "$root_out_dir/gdbserver",
2322 ]
2323 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002324 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002325
2326 if (skia_use_opencl) {
2327 test_app("hello-opencl") {
2328 sources = [
2329 "src/compute/common/cl/assert_cl.c",
2330 "src/compute/common/cl/find_cl.c",
2331 "tools/hello-opencl.cpp",
2332 ]
2333 include_dirs = [ "src/compute/common" ]
Ben Wagner30a4e3d2018-08-07 16:58:15 -04002334 if (is_linux) {
2335 libs = [ "OpenCL" ]
2336 } else if (is_win) {
2337 libs = [ "OpenCL.lib" ]
2338 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002339 }
2340 }
mtklein25c81d42016-07-27 13:55:26 -07002341}