blob: acc3b9de5908ff8b267ee3486531d54138fac795 [file] [log] [blame]
mtkleinc04ff472016-06-23 10:29:30 -07001# Copyright 2016 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
Brian Osmanf2c90142017-07-13 15:50:03 -04006import("gn/flutter_defines.gni")
mikejurka8c24f4f2016-09-12 16:51:58 -07007import("gn/shared_sources.gni")
brettwb9447282016-09-01 14:24:39 -07008
Forrest Reiling30229ac2017-04-17 13:36:39 -07009if (is_fuchsia) {
10 import("//build/vulkan/config.gni")
11}
12
Mike Klein3669a822017-03-03 10:55:02 -050013if (!defined(is_skia_standalone)) {
14 is_skia_standalone = false
15}
16is_skia_dev_build = is_skia_standalone && !is_official_build
17
mtkleinc04ff472016-06-23 10:29:30 -070018declare_args() {
Mike Kleinc168a3a2016-11-14 14:53:13 +000019 skia_use_angle = false
Kevin Lubick4a24e102017-03-29 11:19:01 -040020 skia_use_egl = false
mtklein63213812016-08-24 09:55:56 -070021 skia_use_expat = true
mtklein3cc22182016-08-29 13:26:14 -070022 skia_use_fontconfig = is_linux
mtkleincdedd0e2016-09-12 15:15:44 -070023 skia_use_freetype = is_android || is_fuchsia || is_linux
Mike Klein7d302882016-11-03 14:06:31 -040024 skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows
mtklein63213812016-08-24 09:55:56 -070025 skia_use_libjpeg_turbo = true
26 skia_use_libpng = true
mtkleineb3c4252016-08-23 07:38:09 -070027 skia_use_libwebp = !is_fuchsia
Mike Kleinfae86b72018-01-08 15:49:09 -050028 skia_use_lua = is_skia_dev_build && !is_ios
Mike Kleinf9ae6702018-06-20 14:05:05 -040029 skia_use_opencl = false
Mike Klein10d665d2016-11-01 11:46:10 -040030 skia_use_piex = !is_win
mtklein63213812016-08-24 09:55:56 -070031 skia_use_zlib = true
Greg Daniele5ddff52017-07-05 16:49:36 -040032 skia_use_metal = false
Mike Klein36f182f2017-10-20 12:33:53 -040033 skia_use_libheif = is_skia_dev_build
Chinmay Garded92d0352018-09-17 10:23:28 -070034 skia_use_x11 = is_linux
mtklein1bd72ba2016-09-16 07:45:52 -070035
Mike Klein7d921032017-01-05 12:20:41 -050036 skia_android_serial = ""
Brian Osman3f375d02016-12-28 11:19:22 -050037 skia_enable_discrete_gpu = true
Mike Kleina04bb452017-02-09 12:24:07 -050038 skia_enable_effects = true
Mike Reed0917fad2018-06-19 10:17:30 -040039 skia_enable_effects_imagefilters = true
Brian Osmanf2c90142017-07-13 15:50:03 -040040 skia_enable_flutter_defines = false
Hal Canaryff2742e2018-01-30 11:35:47 -050041 skia_enable_fontmgr_empty = false
Brian Osman74511012018-04-02 20:13:46 +000042 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050043 skia_enable_pdf = true
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040044 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050045 skia_enable_tools = is_skia_dev_build
46 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Danielda16cce2018-08-01 09:23:57 -040047 skia_vulkan_header = "" # temporary as we remove the use from clients
Robert Phillipsa6d2d702017-09-01 12:17:03 -040048 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040049 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070050 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070051 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040052
Hal Canary4689b542018-01-31 11:54:14 -050053 skia_skqp_enable_driver_correctness_workarounds = false
Hal Canary2331c822018-02-01 14:06:13 -050054 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040055
56 skia_llvm_path = ""
57 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040058
59 skia_tools_require_resources = false
mtkleinc04ff472016-06-23 10:29:30 -070060}
Brian Salomon23d73ea2016-10-27 13:31:37 -040061declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040062 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040063 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050064 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Mike Klein10d665d2016-11-01 11:46:10 -040065
Mike Klein4d598a32016-10-31 13:44:49 -040066 if (is_android) {
67 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070068 } else if (is_fuchsia) {
69 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040070 } else {
Greg Daniel91dfa3b2018-05-22 13:25:15 -040071 skia_use_vulkan = (defined(skia_vulkan_sdk) && skia_vulkan_sdk != "") ||
72 (defined(skia_moltenvk_path) && skia_moltenvk_path != "")
Mike Klein4d598a32016-10-31 13:44:49 -040073 }
Jim Van Verth4e502972017-12-07 15:16:10 -050074
75 if (is_ios) {
76 skia_ios_identity = ".*Google.*"
77 skia_ios_profile = "Google Development"
78 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040079}
Brian Salomon789e25e2016-09-30 13:41:03 -040080
Adam Barth54ef74a2017-10-13 10:59:38 -070081if (defined(skia_settings)) {
82 import(skia_settings)
83}
84
Brian Osmanc9a42472018-05-31 13:17:12 -040085# Our tools require static linking (they use non-exported symbols), and the GPU backend.
86skia_enable_tools = skia_enable_tools && !is_component_build && skia_enable_gpu
mtklein06c35c02016-09-20 12:28:12 -070087
mtkleina45be612016-08-29 15:22:10 -070088fontmgr_android_enabled = skia_use_expat && skia_use_freetype
89
mtklein1211e0c2016-07-26 13:55:45 -070090skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070091 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070092 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070093 "include/codec",
94 "include/config",
95 "include/core",
Hal Canary23564b92018-09-07 14:33:14 -040096 "include/docs",
mtklein1211e0c2016-07-26 13:55:45 -070097 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -040098 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -070099 "include/gpu",
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500100 "include/atlastext",
mtklein1211e0c2016-07-26 13:55:45 -0700101 "include/pathops",
102 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -0700103 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700104 "include/utils",
105 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700106]
107
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500108if (skia_enable_atlas_text) {
109 skia_public_includes += [ "include/atlastext" ]
110}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000111
mtkleinc04ff472016-06-23 10:29:30 -0700112# Skia public API, generally provided by :skia.
113config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700114 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -0400115 defines = []
116 if (is_component_build) {
117 defines += [ "SKIA_DLL" ]
118 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400119 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700120 defines += [ "SK_SAMPLES_FOR_X" ]
121 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400122 if (skia_enable_flutter_defines) {
123 defines += flutter_defines
Kevin Lubickf4def342018-10-04 12:52:50 -0400124
125 # Flutter always wants this https://github.com/flutter/flutter/issues/11402
126 defines += [ "SK_ENABLE_DUMP_GPU" ]
Brian Osmanf2c90142017-07-13 15:50:03 -0400127 }
mtklein06c35c02016-09-20 12:28:12 -0700128 if (!skia_enable_gpu) {
129 defines += [ "SK_SUPPORT_GPU=0" ]
130 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500131 if (skia_enable_atlas_text) {
132 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
133 }
mtkleinc04ff472016-06-23 10:29:30 -0700134}
135
136# Skia internal APIs, used by Skia itself and a few test tools.
137config("skia_private") {
138 visibility = [ ":*" ]
139
140 include_dirs = [
141 "include/private",
142 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700143 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700144 "src/core",
145 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700146 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700147 "src/image",
148 "src/images",
149 "src/lazy",
150 "src/opts",
151 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700152 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700153 "src/ports",
154 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400155 "src/shaders",
156 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700157 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700158 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700159 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500160 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700161 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700162 ]
mtklein150d1132016-08-01 06:56:40 -0700163
Mike Reeda9e241d2017-05-03 10:52:00 -0400164 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700165 if (is_android) {
166 defines += [
167 "SK_GAMMA_EXPONENT=1.4",
168 "SK_GAMMA_CONTRAST=0.0",
169 ]
170 }
mtklein88a7ac02016-09-14 11:16:49 -0700171 if (is_official_build || is_android) {
172 # TODO(bsalomon): it'd be nice to make Android normal.
173 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
174 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400175 libs = []
176 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500177 if (skia_enable_gpu) {
178 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500179 if (is_skia_dev_build && skia_use_vulkan) {
180 include_dirs += [ "tools/gpu/vk" ]
181 }
Brian Salomon03e05842017-02-23 12:23:47 -0500182 }
Brian Osman34755e22016-12-05 09:46:02 -0500183 if (skia_use_angle) {
184 defines += [ "SK_ANGLE" ]
185 }
Brian Osman3f375d02016-12-28 11:19:22 -0500186 if (skia_enable_discrete_gpu) {
187 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
188 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400189 if (!is_official_build) {
190 defines += [ "GR_TEST_UTILS=1" ]
191 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400192 if (skia_llvm_path != "") {
193 defines += [ "SK_LLVM_AVAILABLE" ]
194 include_dirs += [ "$skia_llvm_path/include" ]
195 libs += [ skia_llvm_lib ]
196 lib_dirs += [ "$skia_llvm_path/lib/" ]
197 }
mtkleinc04ff472016-06-23 10:29:30 -0700198}
199
200# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
201config("skia_library") {
202 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700203 defines = [ "SKIA_IMPLEMENTATION=1" ]
204}
205
206skia_library_configs = [
207 ":skia_public",
208 ":skia_private",
209 ":skia_library",
210]
211
mtklein9b8583d2016-08-24 17:32:30 -0700212# Use for CPU-specific Skia code that needs particular compiler flags.
213template("opts") {
214 if (invoker.enabled) {
215 source_set(target_name) {
216 forward_variables_from(invoker, "*")
217 configs += skia_library_configs
218 }
219 } else {
220 # If not enabled, a phony empty target that swallows all otherwise unused variables.
221 source_set(target_name) {
222 forward_variables_from(invoker,
223 "*",
224 [
225 "sources",
226 "cflags",
227 ])
228 }
229 }
anmittala7eaf2e2016-08-17 13:57:26 -0700230}
231
mtklein422310d2016-08-16 18:28:43 -0700232is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700233
mtklein7d6fb2c2016-08-25 14:50:44 -0700234opts("none") {
235 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700236 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700237 cflags = []
238}
239
mtklein7d6fb2c2016-08-25 14:50:44 -0700240opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700241 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700242 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700243 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700244}
245
246opts("arm64") {
247 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700248 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700249 cflags = []
250}
251
252opts("crc32") {
253 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700254 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700255 cflags = [ "-march=armv8-a+crc" ]
256}
257
mtklein9b8583d2016-08-24 17:32:30 -0700258opts("sse2") {
259 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700260 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400261 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400262 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
263 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400264 cflags = [ "-msse2" ]
265 }
mtklein9b8583d2016-08-24 17:32:30 -0700266}
mtkleinc04ff472016-06-23 10:29:30 -0700267
mtklein9b8583d2016-08-24 17:32:30 -0700268opts("ssse3") {
269 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700270 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400271 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400272 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
273 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400274 cflags = [ "-mssse3" ]
275 }
mtklein9b8583d2016-08-24 17:32:30 -0700276}
mtkleinc04ff472016-06-23 10:29:30 -0700277
mtklein9b8583d2016-08-24 17:32:30 -0700278opts("sse41") {
279 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700280 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400281 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400282 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
283 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400284 cflags = [ "-msse4.1" ]
285 }
mtklein9b8583d2016-08-24 17:32:30 -0700286}
mtklein4e976072016-08-08 09:06:27 -0700287
mtklein9b8583d2016-08-24 17:32:30 -0700288opts("sse42") {
289 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700290 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400291 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400292 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
293 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400294 cflags = [ "-msse4.2" ]
295 }
mtklein9b8583d2016-08-24 17:32:30 -0700296}
297
298opts("avx") {
299 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700300 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400301 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000302 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400303 } else {
304 cflags = [ "-mavx" ]
305 }
mtkleinc04ff472016-06-23 10:29:30 -0700306}
307
Mike Klein1b9b7d52018-02-27 10:37:40 -0500308opts("hsw") {
309 enabled = is_x86
310 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400311 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500312 cflags = [ "/arch:AVX2" ]
313 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000314 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500315 }
316
317 # Oddly, clang-cl doesn't recognize this as a valid flag.
318 # If it ever does, it'd nice to move this up with -mavx2 and co.
319 if (is_clang && !is_win) {
320 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
321 # but nice to have, generating slightly better code for paths without explicit FMAs.
322 cflags += [ "-ffp-contract=fast" ]
323 }
324}
325
mtkleinc095df52016-08-24 12:23:52 -0700326# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700327template("optional") {
328 if (invoker.enabled) {
329 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700330 if (defined(invoker.public_defines)) {
331 defines = invoker.public_defines
332 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600333 if (defined(invoker.public_configs)) {
334 configs = invoker.public_configs
335 }
mtklein457b42a2016-08-23 13:56:37 -0700336 }
337 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700338 forward_variables_from(invoker,
339 "*",
340 [
341 "public_defines",
342 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700343 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700344 ])
mtklein457b42a2016-08-23 13:56:37 -0700345 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700346 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700347 if (defined(invoker.configs_to_remove)) {
348 configs -= invoker.configs_to_remove
349 }
mtklein457b42a2016-08-23 13:56:37 -0700350 }
351 } else {
mtklein457b42a2016-08-23 13:56:37 -0700352 source_set(target_name) {
353 forward_variables_from(invoker,
354 "*",
355 [
356 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400357 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700358 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700359 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700360 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700361 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700362 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700363 ])
mtkleincd01b032016-08-31 04:58:19 -0700364 if (defined(invoker.sources_when_disabled)) {
365 sources = invoker.sources_when_disabled
366 }
367 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700368 }
mtkleineb3c4252016-08-23 07:38:09 -0700369 }
mtklein457b42a2016-08-23 13:56:37 -0700370}
mtklein457b42a2016-08-23 13:56:37 -0700371
Mike Kleina04bb452017-02-09 12:24:07 -0500372optional("effects") {
373 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400374 deps = [
375 ":compile_processors",
376 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500377 sources =
378 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
Mike Reed0917fad2018-06-19 10:17:30 -0400379 if (skia_enable_effects_imagefilters) {
380 sources += skia_effects_imagefilter_sources
381 } else {
382 sources += [ "src/ports/SkGlobalInitialization_none_imagefilters.cpp" ]
383 }
384 sources_when_disabled = [
385 "src/ports/SkGlobalInitialization_none.cpp",
386 "src/ports/SkGlobalInitialization_none_imagefilters.cpp",
387 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500388}
389
mtkleina45be612016-08-29 15:22:10 -0700390optional("fontmgr_android") {
391 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700392
393 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500394 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700395 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700396 ]
397 sources = [
398 "src/ports/SkFontMgr_android.cpp",
399 "src/ports/SkFontMgr_android_factory.cpp",
400 "src/ports/SkFontMgr_android_parser.cpp",
401 ]
402}
403
mtkleind2e39db2016-09-07 07:52:55 -0700404optional("fontmgr_custom") {
Kevin Lubick217056c2018-09-20 17:39:31 -0400405 enabled = (is_linux || target_cpu == "wasm") && skia_use_freetype &&
406 !skia_use_fontconfig
mtkleind2e39db2016-09-07 07:52:55 -0700407
408 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500409 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700410 ]
411 sources = [
412 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500413 "src/ports/SkFontMgr_custom.h",
414 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700415 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500416 "src/ports/SkFontMgr_custom_embedded.cpp",
417 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700418 ]
419}
420
Hal Canaryff2742e2018-01-30 11:35:47 -0500421optional("fontmgr_empty") {
422 enabled = skia_enable_fontmgr_empty
423 sources = [
424 "src/ports/SkFontMgr_empty_factory.cpp",
425 ]
426}
427
mtklein3cc22182016-08-29 13:26:14 -0700428optional("fontmgr_fontconfig") {
429 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700430
431 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500432 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700433 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700434 ]
435 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700436 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700437 "src/ports/SkFontConfigInterface_direct.cpp",
438 "src/ports/SkFontConfigInterface_direct_factory.cpp",
439 "src/ports/SkFontMgr_FontConfigInterface.cpp",
440 "src/ports/SkFontMgr_fontconfig.cpp",
441 "src/ports/SkFontMgr_fontconfig_factory.cpp",
442 ]
443}
444
mtkleincdedd0e2016-09-12 15:15:44 -0700445optional("fontmgr_fuchsia") {
446 enabled = is_fuchsia && skia_use_freetype
447
448 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500449 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700450 ]
451 sources = [
452 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500453 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700454 "src/ports/SkFontMgr_custom_empty_factory.cpp",
455 ]
456}
457
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700458if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400459 executable("sksllex") {
460 sources = [
461 "src/sksl/lex/Main.cpp",
462 "src/sksl/lex/NFA.cpp",
463 "src/sksl/lex/RegexNode.cpp",
464 "src/sksl/lex/RegexParser.cpp",
465 ]
466 include_dirs = [ "src/sksl/lex" ]
467 }
468
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700469 action("run_sksllex") {
470 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400471 deps = [
472 ":sksllex(//gn/toolchain:$host_toolchain)",
473 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700474 sources = [
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700475 "src/sksl/lex/sksl.lex",
476 ]
477
478 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
479 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
480 outputs = [
481 "$target_out_dir/" +
482 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
483 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
484 # confused due to the same file being named by two different paths
485 ]
486 sksllex_path = "$root_out_dir/"
487 sksllex_path += "sksllex"
488 if (host_os == "win") {
489 sksllex_path += ".exe"
490 }
491 args = [
492 rebase_path(sksllex_path),
493 rebase_path("bin/clang-format"),
494 rebase_path("src"),
495 ]
496 }
497} else {
498 group("run_sksllex") {
499 }
500}
501
502if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400503 executable("skslc") {
504 defines = [ "SKSL_STANDALONE" ]
505 sources = [
506 "src/sksl/SkSLMain.cpp",
507 ]
508 sources += skia_sksl_sources
509 include_dirs = [
510 "src/gpu",
511 "src/sksl",
512 ]
513 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500514 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400515 "//third_party/spirv-tools",
516 ]
517 }
518
519 skia_gpu_processor_outputs = []
520 foreach(src, skia_gpu_processor_sources) {
521 dir = get_path_info(src, "dir")
522 name = get_path_info(src, "name")
523
524 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
525 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
526 skia_gpu_processor_outputs += [
527 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
528 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
529 # confused due to the same file being named by two different paths
530 ]
531 }
532
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500533 action("create_sksl_enums") {
534 script = "gn/create_sksl_enums.py"
535 sources = [
536 "include/private/GrSharedEnums.h",
537 ]
538 outputs = [
539 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500540 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500541 ]
542 args = [
543 rebase_path(sources[0]),
544 rebase_path(outputs[0]),
545 ]
546 }
547
Ethan Nicholas762466e2017-06-29 10:03:38 -0400548 action("compile_processors") {
549 script = "gn/compile_processors.py"
550 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500551 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400552 ":skslc(//gn/toolchain:$host_toolchain)",
553 ]
554 sources = skia_gpu_processor_sources
555 outputs = skia_gpu_processor_outputs
556 skslc_path = "$root_out_dir/"
557 if (host_toolchain != default_toolchain_name) {
558 skslc_path += "$host_toolchain/"
559 }
560 skslc_path += "skslc"
561 if (host_os == "win") {
562 skslc_path += ".exe"
563 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400564 args = [
565 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400566 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400567 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400568 args += rebase_path(skia_gpu_processor_sources)
569 }
570} else {
571 skia_gpu_processor_outputs = []
572 group("compile_processors") {
573 }
574}
575
mtklein06c35c02016-09-20 12:28:12 -0700576optional("gpu") {
577 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400578 deps = [
579 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700580 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400581 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700582 if (skia_generate_workarounds) {
583 deps += [ ":workaround_list" ]
584 }
mtkleine9fb3d52016-09-20 15:11:46 -0700585 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600586 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400587 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700588
Brian Salomon3d6801e2017-12-11 10:06:31 -0500589 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700590
591 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500592 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700593 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400594 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700595 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400596 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400597
598 # this lib is required to link against AHardwareBuffer
599 if (defined(ndk_api) && ndk_api >= 26) {
600 libs += [ "android" ]
601 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400602 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500603 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400604 libs += [ "EGL" ]
Chinmay Garded92d0352018-09-17 10:23:28 -0700605 } else if (is_linux && skia_use_x11) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500606 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -0400607 libs += [ "GL" ]
mtklein06c35c02016-09-20 12:28:12 -0700608 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500609 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800610 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500611 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400612 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500613 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400614 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700615 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500616 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700617 }
mtkleine9fb3d52016-09-20 15:11:46 -0700618
619 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400620 public_defines += [ "SK_VULKAN" ]
Greg Daniel18dbfd02018-05-29 10:46:51 -0400621 deps += [ "third_party/vulkanmemoryallocator" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700622 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700623 if (skia_enable_vulkan_debug_layers) {
624 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
625 }
mtkleine9fb3d52016-09-20 15:11:46 -0700626 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400627
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400628 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400629 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400630 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
631 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400632
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400633 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400634 if (skia_use_metal) {
635 public_defines += [ "SK_METAL" ]
636 sources += skia_metal_sources
637 libs += [ "Metal.framework" ]
Greg Daniel53956d92018-08-08 14:41:19 -0400638 libs += [ "Foundation.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400639 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400640 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500641
642 if (skia_enable_atlas_text) {
643 sources += skia_atlas_text_sources
644 }
Kevin Lubickf4def342018-10-04 12:52:50 -0400645
646 if (is_debug) {
647 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
648 }
mtklein06c35c02016-09-20 12:28:12 -0700649}
650
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400651optional("heif") {
652 enabled = skia_use_libheif
653 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
654
655 deps = []
656
657 sources = [
658 "src/codec/SkHeifCodec.cpp",
659 ]
660}
661
mtklein63213812016-08-24 09:55:56 -0700662optional("jpeg") {
663 enabled = skia_use_libjpeg_turbo
664 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
665
mtklein63213812016-08-24 09:55:56 -0700666 deps = [
667 "//third_party/libjpeg-turbo:libjpeg",
668 ]
Mike Kleinf105dc72018-06-05 15:22:54 -0400669 public = [
670 "include/encode/SkJpegEncoder.h",
671 ]
mtklein63213812016-08-24 09:55:56 -0700672 sources = [
673 "src/codec/SkJpegCodec.cpp",
674 "src/codec/SkJpegDecoderMgr.cpp",
675 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700676 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400677 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700678 ]
679}
680
681optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500682 enabled = skia_use_zlib && skia_enable_pdf
683 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700684
mtklein63213812016-08-24 09:55:56 -0700685 deps = [
686 "//third_party/zlib",
687 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400688 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700689 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400690 }
brettwb9447282016-09-01 14:24:39 -0700691 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700692 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700693
694 if (skia_use_sfntly) {
695 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500696 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700697 }
698}
699
700optional("png") {
701 enabled = skia_use_libpng
702 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
703
mtklein63213812016-08-24 09:55:56 -0700704 deps = [
705 "//third_party/libpng",
706 ]
707 sources = [
708 "src/codec/SkIcoCodec.cpp",
709 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400710 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700711 ]
712}
713
scroggof84ad642016-10-31 09:02:57 -0700714optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400715 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700716 public_defines = [ "SK_CODEC_DECODES_RAW" ]
717
718 deps = [
719 "//third_party/dng_sdk",
720 "//third_party/libjpeg-turbo:libjpeg",
721 "//third_party/piex",
722 ]
723
724 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
725 # Skia.
726 configs_to_remove = [ "//gn:no_exceptions" ]
727
728 sources = [
729 "src/codec/SkRawAdapterCodec.cpp",
730 "src/codec/SkRawCodec.cpp",
731 ]
732}
733
Mike Klein852a8cb2018-05-15 10:46:58 -0400734import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -0400735source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -0400736 cflags = []
737 if (!is_win || is_clang) {
738 cflags += [
739 "-w",
740 "-std=c11",
741 ]
742 }
743
744 public = [
745 "third_party/skcms/skcms.h",
746 ]
747 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
748}
749
mtklein3cc22182016-08-29 13:26:14 -0700750optional("typeface_freetype") {
751 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700752
753 deps = [
754 "//third_party/freetype2",
755 ]
756 sources = [
757 "src/ports/SkFontHost_FreeType.cpp",
758 "src/ports/SkFontHost_FreeType_common.cpp",
759 ]
760}
761
mtklein457b42a2016-08-23 13:56:37 -0700762optional("webp") {
763 enabled = skia_use_libwebp
764 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
765
mtklein457b42a2016-08-23 13:56:37 -0700766 deps = [
767 "//third_party/libwebp",
768 ]
769 sources = [
770 "src/codec/SkWebpAdapterCodec.cpp",
771 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400772 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700773 ]
mtkleineb3c4252016-08-23 07:38:09 -0700774}
775
mtklein63213812016-08-24 09:55:56 -0700776optional("xml") {
777 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000778 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700779
mtklein63213812016-08-24 09:55:56 -0700780 deps = [
781 "//third_party/expat",
782 ]
783 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500784 "src/svg/SkSVGCanvas.cpp",
785 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700786 "src/xml/SkDOM.cpp",
787 "src/xml/SkXMLParser.cpp",
788 "src/xml/SkXMLWriter.cpp",
789 ]
790}
791
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700792if (skia_enable_gpu && skia_generate_workarounds) {
793 action("workaround_list") {
794 script = "tools/build_workaround_header.py"
795
796 inputs = [
797 "src/gpu/gpu_workaround_list.txt",
798 ]
799
800 # see comments in skia_compile_processors about out dir path shenanigans.
801 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700802 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700803
804 outputs = [
805 "$root_out_dir/$output_file",
806 ]
807 args = [
808 "--output-file",
809 "$output_file",
810 ]
811
812 foreach(file, inputs) {
813 args += [ rebase_path(file, root_build_dir) ]
814 }
815 }
816}
817
mtkleinc04ff472016-06-23 10:29:30 -0700818component("skia") {
819 public_configs = [ ":skia_public" ]
820 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700821
822 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700823 ":arm64",
824 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700825 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700826 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500827 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700828 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700829 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500830 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700831 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700832 ":fontmgr_fuchsia",
Greg Danielda16cce2018-08-01 09:23:57 -0400833 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400834 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500835 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700836 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700837 ":none",
mtklein63213812016-08-24 09:55:56 -0700838 ":pdf",
839 ":png",
scroggof84ad642016-10-31 09:02:57 -0700840 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500841 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700842 ":sse2",
843 ":sse41",
844 ":sse42",
845 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700846 ":webp",
mtklein63213812016-08-24 09:55:56 -0700847 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700848 ]
849
Chinmay Garde43f115c2016-11-16 15:04:12 -0800850 # This file (and all GN files in Skia) are designed to work with an
851 # empty sources assignment filter; we handle all that explicitly.
852 # We clear the filter here for clients who may have set up a global filter.
853 set_sources_assignment_filter([])
854
mtkleinc04ff472016-06-23 10:29:30 -0700855 sources = []
brettwb9447282016-09-01 14:24:39 -0700856 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700857 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500858 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700859 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400860 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500861 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700862 "src/android/SkBitmapRegionCodec.cpp",
863 "src/android/SkBitmapRegionDecoder.cpp",
864 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400865 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700866 "src/codec/SkBmpCodec.cpp",
867 "src/codec/SkBmpMaskCodec.cpp",
868 "src/codec/SkBmpRLECodec.cpp",
869 "src/codec/SkBmpStandardCodec.cpp",
870 "src/codec/SkCodec.cpp",
871 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -0400872 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -0400873 "src/codec/SkEncodedInfo.cpp",
scroggo19b91532016-10-24 09:03:26 -0700874 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700875 "src/codec/SkMaskSwizzler.cpp",
876 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700877 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700878 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700879 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700880 "src/codec/SkSwizzler.cpp",
881 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700882 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700883 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700884 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700885 "src/ports/SkMemory_malloc.cpp",
886 "src/ports/SkOSFile_stdio.cpp",
887 "src/sfnt/SkOTTable_name.cpp",
888 "src/sfnt/SkOTUtils.cpp",
889 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700890 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700891 ]
brettwb9447282016-09-01 14:24:39 -0700892
mtklein7d6fb2c2016-08-25 14:50:44 -0700893 libs = []
894
mtkleinc04ff472016-06-23 10:29:30 -0700895 if (is_win) {
896 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400897 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700898 "src/ports/SkDebug_win.cpp",
899 "src/ports/SkFontHost_win.cpp",
900 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500901 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700902 "src/ports/SkImageEncoder_WIC.cpp",
903 "src/ports/SkImageGeneratorWIC.cpp",
904 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700905 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700906 "src/ports/SkScalerContext_win_dw.cpp",
907 "src/ports/SkTLS_win.cpp",
908 "src/ports/SkTypeface_win_dw.cpp",
909 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400910 libs += [
911 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500912 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400913 "Ole32.lib",
914 "OleAut32.lib",
915 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500916 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400917 ]
mtkleinc04ff472016-06-23 10:29:30 -0700918 } else {
919 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700920 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700921 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700922 "src/ports/SkTLS_pthread.cpp",
923 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400924 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700925 }
926
mtklein7d6fb2c2016-08-25 14:50:44 -0700927 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500928 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500929 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500930 deps += [ "//third_party/cpu-features" ]
931 }
mtklein06c35c02016-09-20 12:28:12 -0700932 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700933 libs += [
934 "EGL",
935 "GLESv2",
936 "log",
937 ]
938 }
939
Kevin Lubick217056c2018-09-20 17:39:31 -0400940 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -0700941 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400942 if (skia_use_egl) {
943 libs += [ "GLESv2" ]
944 }
mtkleinc04ff472016-06-23 10:29:30 -0700945 }
946
947 if (is_mac) {
948 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700949 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700950 "src/ports/SkFontHost_mac.cpp",
951 "src/ports/SkImageEncoder_CG.cpp",
952 "src/ports/SkImageGeneratorCG.cpp",
953 ]
mtklein09e61f72016-08-23 13:35:28 -0700954 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400955 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
956 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700957 "ApplicationServices.framework",
958 "OpenGL.framework",
959 ]
mtkleinc04ff472016-06-23 10:29:30 -0700960 }
abarth6fc8ff02016-07-15 15:15:15 -0700961
Mike Klein7d302882016-11-03 14:06:31 -0400962 if (is_ios) {
963 sources += [
964 "src/ports/SkDebug_stdio.cpp",
965 "src/ports/SkFontHost_mac.cpp",
966 "src/ports/SkImageEncoder_CG.cpp",
967 "src/ports/SkImageGeneratorCG.cpp",
968 ]
969 libs += [
970 "CoreFoundation.framework",
971 "CoreGraphics.framework",
972 "CoreText.framework",
973 "ImageIO.framework",
974 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400975
976 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
977 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400978 ]
979 }
980
abarth6fc8ff02016-07-15 15:15:15 -0700981 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700982 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700983 }
mtkleinc04ff472016-06-23 10:29:30 -0700984}
985
Kevin Lubickcbcff382018-10-02 09:02:18 -0400986static_library("pathkit") {
987 public_configs = [ ":skia_public" ]
988 configs += skia_library_configs
989
990 deps = [
991 ":arm64",
992 ":armv7",
993 ":avx",
994 ":crc32",
995 ":hsw",
996 ":none",
997 ":sse2",
998 ":sse41",
999 ":sse42",
1000 ":ssse3",
1001 ]
1002
1003 # This file (and all GN files in Skia) are designed to work with an
1004 # empty sources assignment filter; we handle all that explicitly.
1005 # We clear the filter here for clients who may have set up a global filter.
1006 set_sources_assignment_filter([])
1007
1008 sources = []
1009 sources += skia_pathops_sources
1010 sources += [
1011 "src/core/SkAnalyticEdge.cpp",
1012 "src/core/SkArenaAlloc.cpp",
1013 "src/core/SkCubicMap.cpp",
1014 "src/core/SkEdge.cpp",
1015 "src/core/SkEdgeBuilder.cpp",
1016 "src/core/SkEdgeClipper.cpp",
1017 "src/core/SkGeometry.cpp",
1018 "src/core/SkLineClipper.cpp",
1019 "src/core/SkMallocPixelRef.cpp",
1020 "src/core/SkMath.cpp",
1021 "src/core/SkMatrix.cpp",
1022 "src/core/SkOpts.cpp",
1023 "src/core/SkPaint.cpp",
1024 "src/core/SkPath.cpp",
1025 "src/core/SkPathEffect.cpp",
1026 "src/core/SkPathMeasure.cpp",
1027 "src/core/SkPathRef.cpp",
1028 "src/core/SkPoint.cpp",
1029 "src/core/SkRRect.cpp",
1030 "src/core/SkRect.cpp",
1031 "src/core/SkSemaphore.cpp",
1032 "src/core/SkStream.cpp",
1033 "src/core/SkString.cpp",
1034 "src/core/SkStringUtils.cpp",
1035 "src/core/SkStroke.cpp",
1036 "src/core/SkStrokeRec.cpp",
1037 "src/core/SkStrokerPriv.cpp",
1038 "src/core/SkThreadID.cpp",
1039 "src/core/SkUtils.cpp",
1040 "src/effects/SkDashPathEffect.cpp",
1041 "src/effects/SkTrimPathEffect.cpp",
1042 "src/ports/SkDebug_stdio.cpp",
1043 "src/ports/SkMemory_malloc.cpp",
1044 "src/utils/SkDashPath.cpp",
1045 "src/utils/SkParse.cpp",
1046 "src/utils/SkParsePath.cpp",
1047 "src/utils/SkUTF.cpp",
1048 ]
1049}
1050
mtkleinc095df52016-08-24 12:23:52 -07001051# Targets guarded by skia_enable_tools may use //third_party freely.
1052if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001053 # Used by gn_to_bp.py to list our public include dirs.
1054 source_set("public") {
1055 configs += [ ":skia_public" ]
1056 }
1057
Mike Kleinc36dedf2016-11-18 09:35:28 -05001058 config("skia.h_config") {
1059 include_dirs = [ "$target_gen_dir" ]
1060 }
1061 action("skia.h") {
1062 public_configs = [ ":skia.h_config" ]
1063 skia_h = "$target_gen_dir/skia.h"
1064 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001065
1066 # TODO: would be cool to not hard-code these here, but how?
1067 module_public_includes = [
1068 "modules/sksg/include",
1069 "modules/skottie/include",
1070 ]
1071 args =
1072 [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1073 [ rebase_path(skia_h, root_build_dir) ] +
1074 rebase_path(skia_public_includes) + rebase_path(module_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001075 depfile = "$skia_h.deps"
1076 outputs = [
1077 skia_h,
1078 ]
1079 }
1080
Brian Osmanc9a42472018-05-31 13:17:12 -04001081 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001082 executable("fiddle") {
1083 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001084 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001085 "tools/fiddle/draw.cpp",
1086 "tools/fiddle/fiddle_main.cpp",
1087 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001088
1089 if (skia_use_egl) {
1090 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001091 } else {
1092 sources += [ "tools/fiddle/null_context.cpp" ]
1093 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001094 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001095 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001096 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001097 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001098 ":skia",
1099 ":skia.h",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001100 "modules/skottie",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001101 ]
1102 }
1103 }
1104
Brian Osmanc9a42472018-05-31 13:17:12 -04001105 source_set("public_headers_warnings_check") {
1106 sources = [
1107 "tools/public_headers_warnings_check.cpp",
1108 ]
1109 configs -= [ "//gn:warnings_except_public_headers" ]
1110 deps = [
1111 ":skia",
1112 ":skia.h",
1113 "modules/skottie",
1114 ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001115 }
1116
mtkleinc095df52016-08-24 12:23:52 -07001117 template("test_lib") {
1118 config(target_name + "_config") {
1119 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001120 if (defined(invoker.public_defines)) {
1121 defines = invoker.public_defines
1122 }
mtklein25c81d42016-07-27 13:55:26 -07001123 }
mtkleinc095df52016-08-24 12:23:52 -07001124 source_set(target_name) {
1125 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1126 public_configs = [
1127 ":" + target_name + "_config",
1128 ":skia_private",
1129 ]
1130
1131 if (!defined(deps)) {
1132 deps = []
1133 }
1134 deps += [ ":skia" ]
1135 testonly = true
1136 }
mtklein25c81d42016-07-27 13:55:26 -07001137 }
mtklein25c81d42016-07-27 13:55:26 -07001138
Mike Kleine6682eb2017-01-05 10:54:57 -05001139 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001140 if (is_ios) {
1141 app_name = target_name
1142 gen_path = target_gen_dir
1143
1144 action("${app_name}_generate_info_plist") {
1145 script = "//gn/gen_plist_ios.py"
1146 outputs = [
1147 "$gen_path/${app_name}_Info.plist",
1148 ]
1149 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1150 }
1151
1152 bundle_data("${app_name}_bundle_info_plist") {
1153 public_deps = [
1154 ":${app_name}_generate_info_plist",
1155 ]
1156 sources = [
1157 "$gen_path/${app_name}_Info.plist",
1158 ]
1159 outputs = [
1160 "{{bundle_root_dir}}/Info.plist",
1161 ]
1162 }
1163
Jim Van Verth329c5a62017-11-29 11:42:33 -05001164 bundle_ios_data =
1165 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1166
1167 if (bundle_ios_data) {
1168 has_skps =
1169 "True" == exec_script("//gn/checkdir.py",
1170 [ rebase_path("skps", root_build_dir) ],
1171 "trim string")
1172 bundle_data("${app_name}_bundle_resources") {
1173 sources = [
1174 "resources",
1175 ]
1176 outputs = [
1177 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1178 "{{bundle_resources_dir}}/data/resources",
1179 ]
1180 }
1181
1182 if (has_skps) {
1183 bundle_data("${app_name}_bundle_skps") {
1184 sources = [
1185 "skps",
1186 ]
1187 outputs = [
1188 # Store in same folder as resources
1189 "{{bundle_resources_dir}}/data/skps",
1190 ]
1191 }
1192 }
1193 }
1194
Jim Van Verth443a9132017-11-28 09:45:26 -05001195 executable("${app_name}_generate_executable") {
1196 forward_variables_from(invoker,
1197 "*",
1198 [
1199 "output_name",
1200 "visibility",
1201 "is_shared_library",
1202 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001203 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001204 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001205 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1206 }
1207
1208 bundle_data("${app_name}_bundle_executable") {
1209 public_deps = [
1210 ":${app_name}_generate_executable",
1211 ]
1212 sources = [
1213 "$gen_path/$app_name",
1214 ]
1215 outputs = [
1216 "{{bundle_executable_dir}}/$app_name",
1217 ]
1218 testonly = true
1219 }
1220
1221 create_bundle("$app_name") {
1222 product_type = "com.apple.product-type.application"
1223 testonly = true
1224
1225 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1226 bundle_resources_dir = bundle_root_dir
1227 bundle_executable_dir = bundle_root_dir
1228 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1229
1230 deps = [
1231 ":${app_name}_bundle_executable",
1232 ":${app_name}_bundle_info_plist",
1233 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001234 if (bundle_ios_data) {
1235 deps += [ ":${app_name}_bundle_resources" ]
1236 if (has_skps) {
1237 deps += [ ":${app_name}_bundle_skps" ]
1238 }
1239 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001240
1241 # should only code sign when running on a device, not the simulator
1242 if (target_cpu != "x64") {
1243 code_signing_script = "//gn/codesign_ios.py"
1244 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1245 code_signing_outputs = [
1246 "$bundle_root_dir/_CodeSignature/CodeResources",
1247 "$bundle_root_dir/embedded.mobileprovision",
1248 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001249 code_signing_args = [
1250 rebase_path("$bundle_root_dir", root_build_dir),
1251 skia_ios_identity,
1252 skia_ios_profile,
1253 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001254 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001255 }
1256 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001257 # !is_ios
1258
1259 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1260 shared_library("lib" + target_name) {
1261 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1262 configs += [ ":skia_private" ]
1263 testonly = true
1264 }
1265 } else {
1266 _executable = target_name
1267 executable(_executable) {
1268 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1269 configs += [ ":skia_private" ]
1270 testonly = true
1271 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001272 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001273 if (is_android && skia_android_serial != "" && defined(_executable)) {
1274 action("push_" + target_name) {
1275 script = "gn/push_to_android.py"
1276 deps = [
1277 ":" + _executable,
1278 ]
1279 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1280 outputs = [
1281 _stamp,
1282 ]
1283 args = [
1284 rebase_path("$root_build_dir/$_executable"),
1285 skia_android_serial,
1286 rebase_path(_stamp),
1287 ]
1288 testonly = true
1289 }
Mike Klein7d921032017-01-05 12:20:41 -05001290 }
1291 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001292 }
1293
Greg Danielda16cce2018-08-01 09:23:57 -04001294 config("moltenvk_config") {
1295 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1296 if (is_ios) {
1297 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
1298 } else {
1299 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
1300 }
1301 cflags = [ "-F$moltenvk_framework_path" ]
1302 ldflags = [ "-F$moltenvk_framework_path" ]
1303 libs = [
1304 "MoltenVK.framework",
1305 "Metal.framework",
1306 "IOSurface.framework",
1307 "QuartzCore.framework",
1308 "Foundation.framework",
1309 ]
1310 if (is_ios) {
1311 libs += [ "UIKit.framework" ]
1312 } else {
1313 libs += [ "IOKit.framework" ]
1314 }
1315 defines = [ "SK_MOLTENVK" ]
1316 }
1317 }
1318
1319 source_set("moltenvk") {
1320 public_configs = [ ":moltenvk_config" ]
1321 }
1322
mtkleinc095df52016-08-24 12:23:52 -07001323 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001324 public_include_dirs = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001325 public_defines = []
1326 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001327
Brian Osmanc9a42472018-05-31 13:17:12 -04001328 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001329 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001330 sources = [
1331 "tools/gpu/GrContextFactory.cpp",
1332 "tools/gpu/GrTest.cpp",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001333 "tools/gpu/MemoryCache.cpp",
1334 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001335 "tools/gpu/ProxyUtils.cpp",
1336 "tools/gpu/TestContext.cpp",
1337 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
1338 "tools/gpu/gl/GLTestContext.cpp",
1339 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04001340 "tools/gpu/gl/null/NullGLTestContext.cpp",
1341 "tools/gpu/mock/MockTestContext.cpp",
1342 ]
1343 libs = []
1344
1345 if (is_android || skia_use_egl) {
1346 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1347 } else if (is_ios) {
1348 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1349 libs += [ "OpenGLES.framework" ]
1350 } else if (is_linux) {
1351 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -04001352 libs += [
1353 "GLU",
1354 "X11",
1355 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001356 } else if (is_mac) {
1357 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
1358 } else if (is_win) {
1359 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1360 libs += [
1361 "Gdi32.lib",
1362 "OpenGL32.lib",
mtklein38925aa2016-09-21 10:11:25 -07001363 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001364 }
mtklein25c81d42016-07-27 13:55:26 -07001365
Brian Osmanc9a42472018-05-31 13:17:12 -04001366 cflags_objcc = [ "-fobjc-arc" ]
mtklein6ef69992016-09-14 06:12:09 -07001367
Brian Osmanc9a42472018-05-31 13:17:12 -04001368 if (skia_use_angle) {
1369 deps += [ "//third_party/angle2" ]
1370 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1371 }
Greg Danielb4d89562018-10-03 18:44:49 +00001372 public_include_dirs += [ "third_party/vulkan" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001373 if (skia_use_vulkan) {
1374 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
1375 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Greg Danielda16cce2018-08-01 09:23:57 -04001376 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1377 public_deps += [ ":moltenvk" ]
1378 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001379 }
1380 if (skia_use_metal) {
1381 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001382 }
mtklein25c81d42016-07-27 13:55:26 -07001383 }
mtklein25c81d42016-07-27 13:55:26 -07001384
mtkleinc095df52016-08-24 12:23:52 -07001385 test_lib("flags") {
1386 public_include_dirs = [ "tools/flags" ]
1387 sources = [
1388 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001389 ]
1390 }
1391 test_lib("common_flags") {
1392 public_include_dirs = [ "tools/flags" ]
1393 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001394 "tools/flags/SkCommonFlags.cpp",
1395 "tools/flags/SkCommonFlagsConfig.cpp",
1396 ]
1397 deps = [
mtklein046cb562016-09-16 10:23:12 -07001398 ":flags",
Greg Danielda16cce2018-08-01 09:23:57 -04001399 ]
1400 public_deps = [
mtkleinc095df52016-08-24 12:23:52 -07001401 ":gpu_tool_utils",
1402 ]
1403 }
mtklein25c81d42016-07-27 13:55:26 -07001404
mtkleinc095df52016-08-24 12:23:52 -07001405 test_lib("tool_utils") {
1406 public_include_dirs = [
1407 "tools",
1408 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001409 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001410 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001411 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001412 ]
1413 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001414 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001415 "tools/CrashHandler.cpp",
Robert Phillips96601082018-05-29 16:13:26 -04001416 "tools/DDLPromiseImageHelper.cpp",
1417 "tools/DDLTileHelper.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001418 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001419 "tools/ProcStats.cpp",
1420 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001421 "tools/UrlDataManager.cpp",
1422 "tools/debugger/SkDebugCanvas.cpp",
1423 "tools/debugger/SkDrawCommand.cpp",
1424 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001425 "tools/fonts/SkRandomScalerContext.cpp",
Herb Derby33ac15e2018-08-29 12:36:22 -04001426 "tools/fonts/SkTestEmptyTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001427 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001428 "tools/fonts/SkTestFontMgr.h",
1429 "tools/fonts/SkTestSVGTypeface.cpp",
1430 "tools/fonts/SkTestSVGTypeface.h",
1431 "tools/fonts/SkTestTypeface.cpp",
1432 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001433 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001434 "tools/random_parse_path.cpp",
1435 "tools/sk_tool_utils.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001436 "tools/timer/SkAnimTimer.h",
mtkleinc095df52016-08-24 12:23:52 -07001437 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001438 "tools/trace/SkChromeTracingTracer.cpp",
1439 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001440 "tools/trace/SkDebugfTracer.cpp",
1441 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001442 "tools/trace/SkEventTracingPriv.cpp",
1443 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001444 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001445 libs = []
1446 if (is_ios) {
1447 sources += [ "tools/ios_utils.m" ]
1448 libs += [ "Foundation.framework" ]
1449 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001450 defines = []
1451 if (skia_tools_require_resources) {
1452 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1453 }
mtkleinc095df52016-08-24 12:23:52 -07001454 deps = [
Ben Wagner97182cc2018-02-15 10:20:04 -05001455 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001456 ":flags",
1457 "//third_party/libpng",
1458 ]
1459 public_deps = [
Greg Danielda16cce2018-08-01 09:23:57 -04001460 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001461 "//third_party/jsoncpp",
1462 ]
1463 }
mtklein25c81d42016-07-27 13:55:26 -07001464
Mike Klein6e744122016-10-27 12:21:40 -04001465 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001466 test_lib("gm") {
1467 public_include_dirs = [ "gm" ]
1468 sources = gm_sources
1469 deps = [
scroggo19b91532016-10-24 09:03:26 -07001470 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001471 ":skia",
1472 ":tool_utils",
Mike Reed2f0edd52018-05-31 14:22:30 -04001473 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001474 "modules/skottie:gm",
Florin Malita3b526b02018-05-25 12:43:51 -04001475 "modules/sksg",
mtkleinc095df52016-08-24 12:23:52 -07001476 ]
Greg Danielda16cce2018-08-01 09:23:57 -04001477 public_deps = [
1478 ":gpu_tool_utils",
1479 ]
mtkleinc095df52016-08-24 12:23:52 -07001480 }
mtklein25c81d42016-07-27 13:55:26 -07001481
Mike Klein6e744122016-10-27 12:21:40 -04001482 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001483 test_lib("tests") {
1484 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001485 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001486 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001487 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001488 }
Ben Wagner37a06c02018-06-22 21:11:00 +00001489 if (!(skia_use_freetype && skia_use_fontconfig)) {
1490 sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
1491 }
mtkleinc095df52016-08-24 12:23:52 -07001492 deps = [
Mike Klein60900b52018-09-21 11:19:45 -04001493 ":experimental_pipe",
Hal Canary0f666812018-03-22 15:21:12 -04001494 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001495 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001496 ":skia",
1497 ":tool_utils",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001498 "modules/skottie:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001499 "modules/sksg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001500 "//third_party/libpng",
1501 "//third_party/zlib",
1502 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001503 public_deps = [
1504 ":gpu_tool_utils", # Test.h #includes headers from this target.
1505 ]
mtkleinc095df52016-08-24 12:23:52 -07001506 }
mtklein2f3416d2016-08-02 16:02:05 -07001507
Mike Klein6e744122016-10-27 12:21:40 -04001508 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001509 test_lib("bench") {
1510 public_include_dirs = [ "bench" ]
1511 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001512 deps = [
1513 ":flags",
1514 ":gm",
1515 ":gpu_tool_utils",
1516 ":skia",
1517 ":tool_utils",
1518 ]
1519 }
mtklein2b6870c2016-07-28 14:17:33 -07001520
Mike Klein60900b52018-09-21 11:19:45 -04001521 test_lib("experimental_pipe") {
1522 public_include_dirs = [ "experimental/pipe" ]
1523 sources = [
1524 "experimental/pipe/SkPipe.h",
1525 "experimental/pipe/SkPipeCanvas.cpp",
1526 "experimental/pipe/SkPipeCanvas.h",
1527 "experimental/pipe/SkPipeFormat.h",
1528 "experimental/pipe/SkPipeReader.cpp",
1529 "experimental/pipe/SkRefSet.h",
1530 ]
1531 }
1532
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",
Mike Klein60900b52018-09-21 11:19:45 -04001684 ":experimental_pipe",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001685 ":experimental_svg_model",
1686 ":flags",
1687 ":gm",
1688 ":gpu_tool_utils",
1689 ":skia",
1690 ":tests",
1691 ":tool_utils",
Florin Malita3d856bd2018-05-26 09:49:28 -04001692 "modules/skottie",
Florin Malita3b526b02018-05-25 12:43:51 -04001693 "modules/sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001694 "//third_party/jsoncpp",
1695 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001696 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04001697
1698 # NIMA does not build on Windows clang
1699 if (!is_win || !is_clang) {
1700 deps += [ "//third_party/Nima-Cpp" ]
1701 }
Mike Klein38af9432016-11-11 11:39:44 -05001702 }
Brian Osman16adfa32016-10-18 14:42:44 -04001703 }
1704
Mike Kleina8a51ce2018-01-09 12:34:11 -05001705 if (!is_win) {
1706 test_app("remote_demo") {
1707 sources = [
1708 "tools/remote_demo.cpp",
1709 ]
1710 deps = [
1711 ":skia",
1712 ]
1713 }
1714 }
1715
Mike Kleine6682eb2017-01-05 10:54:57 -05001716 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001717 sources = [
1718 "bench/nanobench.cpp",
1719 ]
1720 deps = [
1721 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001722 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001723 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001724 ":flags",
1725 ":gm",
1726 ":gpu_tool_utils",
1727 ":skia",
1728 ":tool_utils",
Florin Malita3b526b02018-05-25 12:43:51 -04001729 "modules/sksg",
mtklein2b6870c2016-07-28 14:17:33 -07001730 "//third_party/jsoncpp",
1731 ]
mtklein2b6870c2016-07-28 14:17:33 -07001732 }
halcanary19a97202016-08-03 15:08:04 -07001733
Ravi Mistry10d36c52017-01-31 09:49:18 -05001734 test_app("skpinfo") {
1735 sources = [
1736 "tools/skpinfo.cpp",
1737 ]
1738 deps = [
1739 ":flags",
1740 ":skia",
1741 ]
1742 }
1743
Brian Osmanc9a42472018-05-31 13:17:12 -04001744 test_app("skpbench") {
1745 sources = [
1746 "tools/skpbench/skpbench.cpp",
1747 ]
1748 deps = [
1749 ":flags",
1750 ":gpu_tool_utils",
1751 ":skia",
1752 ":tool_utils",
1753 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07001754 }
1755
Mike Kleine6682eb2017-01-05 10:54:57 -05001756 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001757 sources = [
Herb Derby264182c2018-05-29 15:53:40 -04001758 "tools/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001759 ]
1760 deps = [
1761 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04001762 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001763 ]
halcanary3eee9d92016-09-10 07:01:53 -07001764 }
mtklein046cb562016-09-16 10:23:12 -07001765
Ben Wagner219f3622017-07-17 15:32:25 -04001766 test_app("create_test_font") {
1767 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001768 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001769 ]
1770 deps = [
1771 ":skia",
1772 ]
1773 assert_no_deps = [
1774 # tool_utils requires the output of this app.
1775 ":tool_utils",
1776 ]
1777 }
1778
Florin Malita5d3ff432018-07-31 16:38:43 -04001779 if (skia_use_expat) {
1780 test_app("create_test_font_color") {
1781 sources = [
1782 "tools/fonts/create_test_font_color.cpp",
1783 ]
1784 deps = [
1785 ":flags",
1786 ":skia",
1787 ":tool_utils",
1788 ]
1789 }
Ben Wagner97182cc2018-02-15 10:20:04 -05001790 }
1791
Mike Kleine6682eb2017-01-05 10:54:57 -05001792 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001793 sources = [
1794 "tools/get_images_from_skps.cpp",
1795 ]
1796 deps = [
1797 ":flags",
1798 ":skia",
mtklein046cb562016-09-16 10:23:12 -07001799 ]
mtklein046cb562016-09-16 10:23:12 -07001800 }
mtkleinecbc5262016-09-22 11:51:24 -07001801
Kevin Lubickebf648e2017-09-21 13:45:16 -04001802 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001803 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001804 sources = [
1805 "tools/skiaserve/Request.cpp",
1806 "tools/skiaserve/Response.cpp",
1807 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001808 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1809 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1810 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1811 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1812 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1813 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1814 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1815 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1816 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001817 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1818 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001819 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1820 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1821 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1822 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1823 ]
1824 deps = [
1825 ":flags",
1826 ":gpu_tool_utils",
1827 ":skia",
1828 ":tool_utils",
1829 "//third_party/jsoncpp",
1830 "//third_party/libmicrohttpd",
1831 "//third_party/libpng",
1832 ]
Mike Klein7d302882016-11-03 14:06:31 -04001833 }
mtkleinecbc5262016-09-22 11:51:24 -07001834 }
kjlubick14f984b2016-10-03 11:49:45 -07001835
Mike Kleine6682eb2017-01-05 10:54:57 -05001836 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001837 include_dirs = [
1838 "tools",
1839 "tools/debugger",
1840 ]
kjlubick14f984b2016-10-03 11:49:45 -07001841 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001842 "fuzz/Fuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001843 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001844 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001845 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001846 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001847 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001848 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001849 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001850 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001851 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04001852 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001853 "fuzz/FuzzRegionOp.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",
Florin Malita80452be2018-06-19 11:27:20 -04001857 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001858 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001859 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1860 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001861 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001862 "tools/UrlDataManager.cpp",
1863 "tools/debugger/SkDebugCanvas.cpp",
1864 "tools/debugger/SkDrawCommand.cpp",
1865 "tools/debugger/SkJsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001866 ]
1867 deps = [
1868 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001869 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001870 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04001871 "modules/skottie:fuzz",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001872 "//third_party/jsoncpp",
1873 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001874 ]
kjlubick14f984b2016-10-03 11:49:45 -07001875 }
Mike Klein38312422016-10-05 15:41:01 -04001876
Mike Kleine6682eb2017-01-05 10:54:57 -05001877 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001878 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001879 rebase_path("tests/skia_test.cpp"),
1880 rebase_path("tests/Test.cpp"),
1881 ]
caryclark9feb6322016-10-25 08:58:26 -07001882 deps = [
1883 ":flags",
1884 ":gpu_tool_utils",
1885 ":skia",
1886 ":tool_utils",
1887 ]
caryclark9feb6322016-10-25 08:58:26 -07001888 }
1889
Mike Kleine6682eb2017-01-05 10:54:57 -05001890 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001891 sources = [
1892 "tools/DumpRecord.cpp",
1893 "tools/dump_record.cpp",
1894 ]
1895 deps = [
1896 ":flags",
1897 ":skia",
1898 ]
Mike Klein38312422016-10-05 15:41:01 -04001899 }
bungemanfe917272016-10-13 17:36:40 -04001900
Mike Kleine6682eb2017-01-05 10:54:57 -05001901 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001902 sources = [
1903 "tools/skdiff/skdiff.cpp",
1904 "tools/skdiff/skdiff_html.cpp",
1905 "tools/skdiff/skdiff_main.cpp",
1906 "tools/skdiff/skdiff_utils.cpp",
1907 ]
1908 deps = [
1909 ":skia",
1910 ":tool_utils",
1911 ]
bungemanfe917272016-10-13 17:36:40 -04001912 }
halcanarya73d76a2016-10-17 13:19:02 -07001913
Mike Kleine6682eb2017-01-05 10:54:57 -05001914 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001915 sources = [
1916 "tools/skp_parser.cpp",
1917 ]
1918 deps = [
1919 ":skia",
1920 ":tool_utils",
1921 "//third_party/jsoncpp",
1922 ]
halcanarya73d76a2016-10-17 13:19:02 -07001923 }
Brian Osman16adfa32016-10-18 14:42:44 -04001924
Brian Osmanc9a42472018-05-31 13:17:12 -04001925 if (!is_win) {
Hal Canaryd7b38452017-12-11 17:46:26 -05001926 test_lib("skqp_lib") {
1927 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001928 defines =
1929 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001930 if (skia_skqp_enable_driver_correctness_workarounds) {
1931 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1932 }
Hal Canary75427132017-10-11 16:00:31 -04001933 sources = [
1934 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001935 "tools/skqp/gm_knowledge.cpp",
1936 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001937 ]
1938 deps = [
1939 ":gm",
1940 ":gpu_tool_utils",
1941 ":skia",
1942 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001943 ":tool_utils",
1944 ]
1945 }
1946 test_app("skqp") {
1947 sources = [
1948 "tools/skqp/skqp.cpp",
1949 ]
1950 deps = [
1951 ":skia",
1952 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001953 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001954 "//third_party/googletest",
1955 ]
1956 }
1957 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001958 if (is_android) {
Hal Canary28f89382017-12-12 09:42:14 -05001959 test_app("skqp_app") {
1960 is_shared_library = true
1961 sources = [
1962 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1963 ]
1964 deps = [
1965 ":skia",
1966 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001967 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001968 ]
1969 libs = [ "android" ]
1970 }
1971 }
Stan Iliev93151722018-08-02 11:10:52 -04001972 if (is_android && skia_enable_gpu) {
1973 test_app("skottie_android") {
1974 is_shared_library = true
1975
1976 sources = [
1977 "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
1978 "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
1979 ]
1980 libs = []
1981
1982 include_dirs = []
1983 deps = [
1984 ":skia",
1985 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04001986 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04001987 ]
1988 }
1989 }
Hal Canary75427132017-10-11 16:00:31 -04001990
Hal Canarya9de7602018-01-19 13:08:23 -05001991 test_app("list_gms") {
1992 sources = [
1993 "tools/list_gms.cpp",
1994 ]
1995 deps = [
1996 ":gm",
1997 ":skia",
1998 ]
1999 }
2000 test_app("list_gpu_unit_tests") {
2001 sources = [
2002 "dm/DMGpuTestProcs.cpp",
2003 "tools/list_gpu_unit_tests.cpp",
2004 ]
2005 deps = [
2006 ":skia",
2007 ":tests",
2008 ]
2009 }
2010
Brian Osmanc9a42472018-05-31 13:17:12 -04002011 test_lib("sk_app") {
2012 public_include_dirs = [ "tools/sk_app" ]
2013 sources = [
2014 "tools/sk_app/CommandSet.cpp",
2015 "tools/sk_app/GLWindowContext.cpp",
2016 "tools/sk_app/Window.cpp",
2017 ]
2018 libs = []
2019
2020 if (is_android) {
2021 sources += [
2022 "tools/sk_app/android/GLWindowContext_android.cpp",
2023 "tools/sk_app/android/RasterWindowContext_android.cpp",
2024 "tools/sk_app/android/Window_android.cpp",
2025 "tools/sk_app/android/main_android.cpp",
2026 "tools/sk_app/android/surface_glue_android.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002027 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002028 libs += [ "android" ]
2029 } else if (is_linux) {
2030 sources += [
2031 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2032 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2033 "tools/sk_app/unix/Window_unix.cpp",
2034 "tools/sk_app/unix/keysym2ucs.c",
2035 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002036 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002037 libs += [
2038 "GL",
2039 "X11",
2040 ]
2041 } else if (is_win) {
2042 sources += [
2043 "tools/sk_app/win/GLWindowContext_win.cpp",
2044 "tools/sk_app/win/RasterWindowContext_win.cpp",
2045 "tools/sk_app/win/Window_win.cpp",
2046 "tools/sk_app/win/main_win.cpp",
2047 ]
Brian Salomon194db172017-08-17 14:37:06 -04002048 if (skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002049 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002050 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002051 } else if (is_mac) {
2052 sources += [
2053 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2054 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2055 "tools/sk_app/mac/Window_mac.cpp",
2056 "tools/sk_app/mac/main_mac.cpp",
2057 ]
2058 libs += [
2059 "QuartzCore.framework",
2060 "Cocoa.framework",
2061 "Foundation.framework",
2062 ]
2063 } else if (is_ios) {
2064 sources += [
2065 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2066 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2067 "tools/sk_app/ios/Window_ios.cpp",
2068 "tools/sk_app/ios/main_ios.cpp",
2069 ]
2070 }
2071
2072 if (skia_use_vulkan) {
2073 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
2074 if (is_android) {
2075 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2076 } else if (is_linux) {
2077 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2078 libs += [ "X11-xcb" ]
2079 } else if (is_win) {
2080 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2081 }
2082 }
2083
2084 deps = [
2085 ":gpu_tool_utils",
2086 ":skia",
2087 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002088 ]
2089 if (is_android) {
2090 deps += [ "//third_party/native_app_glue" ]
2091 } else if (is_mac || is_ios) {
2092 deps += [ "//third_party/libsdl" ]
2093 }
2094 if (skia_use_angle) {
2095 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002096 }
Brian Osman16adfa32016-10-18 14:42:44 -04002097 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002098
Brian Osmanc9a42472018-05-31 13:17:12 -04002099 test_app("viewer") {
2100 is_shared_library = is_android
2101 if (is_ios) {
2102 bundle_ios_data = true
Brian Osmaneff04b52017-11-21 13:18:02 -05002103 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002104 sources = [
2105 "tools/viewer/BisectSlide.cpp",
2106 "tools/viewer/GMSlide.cpp",
2107 "tools/viewer/ImGuiLayer.cpp",
2108 "tools/viewer/ImageSlide.cpp",
2109 "tools/viewer/SKPSlide.cpp",
2110 "tools/viewer/SampleSlide.cpp",
2111 "tools/viewer/SkottieSlide.cpp",
2112 "tools/viewer/SlideDir.cpp",
2113 "tools/viewer/StatsLayer.cpp",
2114 "tools/viewer/SvgSlide.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002115 "tools/viewer/TouchGesture.cpp",
Leon Scroggins III81886e82018-08-22 11:18:08 -04002116 "tools/viewer/TouchGesture.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002117 "tools/viewer/Viewer.cpp",
2118 ]
2119 libs = []
2120
2121 include_dirs = []
2122 deps = [
2123 ":experimental_svg_model",
2124 ":flags",
2125 ":gm",
2126 ":gpu_tool_utils",
2127 ":samples",
2128 ":sk_app",
2129 ":skia",
2130 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002131 "modules/skottie",
2132 "modules/sksg",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002133 "modules/sksg:samples",
Brian Osmanc9a42472018-05-31 13:17:12 -04002134 "//third_party/imgui",
Brian Osmanc9a42472018-05-31 13:17:12 -04002135 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04002136
2137 # NIMA does not build on Windows clang
2138 if (!is_win || !is_clang) {
2139 sources += [ "tools/viewer/NIMASlide.cpp" ]
2140 deps += [ "//third_party/Nima-Cpp" ]
2141 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002142 }
2143
ziadbbceddbc2018-06-19 13:57:15 -04002144 if (is_android) {
2145 test_app("arcore") {
2146 is_shared_library = true
2147 configs = [
2148 ":skia_public",
2149 "gn:default",
2150 ]
2151
2152 # For internship expedience, yes, we're rebuilding Skia rather than depending on :skia.
2153 # At the moment there's no way to use Skia and Skottie/SkShaper unless they're in the same .so.
2154 sources = []
2155 sources += skia_core_sources
2156 sources += skia_utils_sources
2157 sources += skia_xps_sources
2158 sources += [
2159 "src/android/SkAndroidFrameworkUtils.cpp",
2160 "src/android/SkAnimatedImage.cpp",
2161 "src/android/SkBitmapRegionCodec.cpp",
2162 "src/android/SkBitmapRegionDecoder.cpp",
2163 "src/codec/SkAndroidCodec.cpp",
2164 "src/codec/SkBmpBaseCodec.cpp",
2165 "src/codec/SkBmpCodec.cpp",
2166 "src/codec/SkBmpMaskCodec.cpp",
2167 "src/codec/SkBmpRLECodec.cpp",
2168 "src/codec/SkBmpStandardCodec.cpp",
2169 "src/codec/SkCodec.cpp",
2170 "src/codec/SkCodecImageGenerator.cpp",
2171 "src/codec/SkColorTable.cpp",
2172 "src/codec/SkGifCodec.cpp",
2173 "src/codec/SkMaskSwizzler.cpp",
2174 "src/codec/SkMasks.cpp",
2175 "src/codec/SkSampledCodec.cpp",
2176 "src/codec/SkSampler.cpp",
2177 "src/codec/SkStreamBuffer.cpp",
2178 "src/codec/SkSwizzler.cpp",
2179 "src/codec/SkWbmpCodec.cpp",
2180 "src/images/SkImageEncoder.cpp",
2181 "src/ports/SkDiscardableMemory_none.cpp",
2182 "src/ports/SkImageGenerator_skia.cpp",
2183 "src/ports/SkMemory_malloc.cpp",
2184 "src/ports/SkOSFile_stdio.cpp",
2185 "src/sfnt/SkOTTable_name.cpp",
2186 "src/sfnt/SkOTUtils.cpp",
2187 "src/utils/mac/SkStream_mac.cpp",
2188 "third_party/gif/SkGifImageReader.cpp",
2189 ]
2190 deps = [
2191 ":tool_utils",
2192 "modules/skottie",
2193 "modules/skshaper",
2194 ]
2195 }
2196 }
2197
Brian Osmanc9a42472018-05-31 13:17:12 -04002198 if (!skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002199 test_app("HelloWorld") {
2200 sources = [
2201 "example/HelloWorld.cpp",
2202 ]
2203 libs = []
2204
2205 include_dirs = []
2206 deps = [
2207 ":flags",
2208 ":gpu_tool_utils",
2209 ":sk_app",
2210 ":skia",
2211 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002212 ]
2213 }
2214 }
2215
Brian Osmanc9a42472018-05-31 13:17:12 -04002216 if (is_linux || is_mac || is_ios) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002217 test_app("SkiaSDLExample") {
2218 sources = [
2219 "example/SkiaSDLExample.cpp",
2220 ]
2221 libs = []
2222 include_dirs = []
2223 deps = [
2224 ":gpu_tool_utils",
2225 ":skia",
2226 "//third_party/libsdl",
2227 ]
2228 }
2229 }
2230
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002231 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2232 action_foreach("generate_mocs") {
2233 script = "gn/call.py"
2234 sources = [
2235 "tools/mdbviz/MainWindow.h",
2236 ]
2237 outputs = [
2238 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2239 ]
2240 args = [
2241 "$skia_qt_path" + "/bin/moc",
2242 "{{source}}",
2243 "-o",
2244 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2245 ]
2246 }
2247 action_foreach("generate_resources") {
2248 script = "gn/call.py"
2249 sources = [
2250 "tools/mdbviz/resources.qrc",
2251 ]
2252 outputs = [
2253 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2254 ]
2255 args = [
2256 "$skia_qt_path" + "/bin/rcc",
2257 "{{source}}",
2258 "-o",
2259 "gen/mdbviz/{{source_name_part}}_res.cpp",
2260 ]
2261 }
2262 test_app("mdbviz") {
2263 if (is_win) {
2264 # on Windows we need to disable some exception handling warnings due to the Qt headers
2265 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2266 }
2267 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002268 "tools/UrlDataManager.cpp",
2269 "tools/debugger/SkDebugCanvas.cpp",
2270 "tools/debugger/SkDrawCommand.cpp",
2271 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002272 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002273 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002274 "tools/mdbviz/main.cpp",
2275
2276 # generated files
2277 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2278 "$target_gen_dir/mdbviz/resources_res.cpp",
2279 ]
2280 lib_dirs = [ "$skia_qt_path/lib" ]
2281 libs = [
2282 "Qt5Core.lib",
2283 "Qt5Gui.lib",
2284 "Qt5Widgets.lib",
2285 ]
2286 include_dirs = [
2287 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002288 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002289 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002290 "tools",
2291 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002292 ]
2293 deps = [
2294 ":generate_mocs",
2295 ":generate_resources",
2296 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002297 "//third_party/jsoncpp",
2298 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002299 ]
2300 }
2301 }
2302
Mike Kleine459afd2017-03-03 09:21:30 -05002303 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002304 copy("gdbserver") {
2305 sources = [
2306 "$ndk/$ndk_gdbserver",
2307 ]
2308 outputs = [
2309 "$root_out_dir/gdbserver",
2310 ]
2311 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002312 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002313
2314 if (skia_use_opencl) {
2315 test_app("hello-opencl") {
2316 sources = [
2317 "src/compute/common/cl/assert_cl.c",
2318 "src/compute/common/cl/find_cl.c",
2319 "tools/hello-opencl.cpp",
2320 ]
2321 include_dirs = [ "src/compute/common" ]
Ben Wagner30a4e3d2018-08-07 16:58:15 -04002322 if (is_linux) {
2323 libs = [ "OpenCL" ]
2324 } else if (is_win) {
2325 libs = [ "OpenCL.lib" ]
2326 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002327 }
2328 }
mtklein25c81d42016-07-27 13:55:26 -07002329}