blob: 3e8b2400934d092d7cac39682917a78ca66c4260 [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
124 }
mtklein06c35c02016-09-20 12:28:12 -0700125 if (!skia_enable_gpu) {
126 defines += [ "SK_SUPPORT_GPU=0" ]
127 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500128 if (skia_enable_atlas_text) {
129 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
130 }
mtkleinc04ff472016-06-23 10:29:30 -0700131}
132
133# Skia internal APIs, used by Skia itself and a few test tools.
134config("skia_private") {
135 visibility = [ ":*" ]
136
137 include_dirs = [
138 "include/private",
139 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700140 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700141 "src/core",
142 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700143 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700144 "src/image",
145 "src/images",
146 "src/lazy",
147 "src/opts",
148 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700149 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700150 "src/ports",
151 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400152 "src/shaders",
153 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700154 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700155 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700156 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500157 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700158 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700159 ]
mtklein150d1132016-08-01 06:56:40 -0700160
Mike Reeda9e241d2017-05-03 10:52:00 -0400161 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700162 if (is_android) {
163 defines += [
164 "SK_GAMMA_EXPONENT=1.4",
165 "SK_GAMMA_CONTRAST=0.0",
166 ]
167 }
mtklein88a7ac02016-09-14 11:16:49 -0700168 if (is_official_build || is_android) {
169 # TODO(bsalomon): it'd be nice to make Android normal.
170 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
171 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400172 libs = []
173 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500174 if (skia_enable_gpu) {
175 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500176 if (is_skia_dev_build && skia_use_vulkan) {
177 include_dirs += [ "tools/gpu/vk" ]
178 }
Brian Salomon03e05842017-02-23 12:23:47 -0500179 }
Brian Osman34755e22016-12-05 09:46:02 -0500180 if (skia_use_angle) {
181 defines += [ "SK_ANGLE" ]
182 }
Brian Osman3f375d02016-12-28 11:19:22 -0500183 if (skia_enable_discrete_gpu) {
184 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
185 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400186 if (!is_official_build) {
187 defines += [ "GR_TEST_UTILS=1" ]
188 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400189 if (skia_llvm_path != "") {
190 defines += [ "SK_LLVM_AVAILABLE" ]
191 include_dirs += [ "$skia_llvm_path/include" ]
192 libs += [ skia_llvm_lib ]
193 lib_dirs += [ "$skia_llvm_path/lib/" ]
194 }
mtkleinc04ff472016-06-23 10:29:30 -0700195}
196
197# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
198config("skia_library") {
199 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700200 defines = [ "SKIA_IMPLEMENTATION=1" ]
201}
202
203skia_library_configs = [
204 ":skia_public",
205 ":skia_private",
206 ":skia_library",
207]
208
mtklein9b8583d2016-08-24 17:32:30 -0700209# Use for CPU-specific Skia code that needs particular compiler flags.
210template("opts") {
211 if (invoker.enabled) {
212 source_set(target_name) {
213 forward_variables_from(invoker, "*")
214 configs += skia_library_configs
215 }
216 } else {
217 # If not enabled, a phony empty target that swallows all otherwise unused variables.
218 source_set(target_name) {
219 forward_variables_from(invoker,
220 "*",
221 [
222 "sources",
223 "cflags",
224 ])
225 }
226 }
anmittala7eaf2e2016-08-17 13:57:26 -0700227}
228
mtklein422310d2016-08-16 18:28:43 -0700229is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700230
mtklein7d6fb2c2016-08-25 14:50:44 -0700231opts("none") {
232 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700233 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700234 cflags = []
235}
236
mtklein7d6fb2c2016-08-25 14:50:44 -0700237opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700238 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700239 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700240 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700241}
242
243opts("arm64") {
244 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700245 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700246 cflags = []
247}
248
249opts("crc32") {
250 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700251 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700252 cflags = [ "-march=armv8-a+crc" ]
253}
254
mtklein9b8583d2016-08-24 17:32:30 -0700255opts("sse2") {
256 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700257 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400258 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400259 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
260 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400261 cflags = [ "-msse2" ]
262 }
mtklein9b8583d2016-08-24 17:32:30 -0700263}
mtkleinc04ff472016-06-23 10:29:30 -0700264
mtklein9b8583d2016-08-24 17:32:30 -0700265opts("ssse3") {
266 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700267 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400268 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400269 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
270 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400271 cflags = [ "-mssse3" ]
272 }
mtklein9b8583d2016-08-24 17:32:30 -0700273}
mtkleinc04ff472016-06-23 10:29:30 -0700274
mtklein9b8583d2016-08-24 17:32:30 -0700275opts("sse41") {
276 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700277 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400278 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400279 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
280 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400281 cflags = [ "-msse4.1" ]
282 }
mtklein9b8583d2016-08-24 17:32:30 -0700283}
mtklein4e976072016-08-08 09:06:27 -0700284
mtklein9b8583d2016-08-24 17:32:30 -0700285opts("sse42") {
286 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700287 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400288 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400289 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
290 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400291 cflags = [ "-msse4.2" ]
292 }
mtklein9b8583d2016-08-24 17:32:30 -0700293}
294
295opts("avx") {
296 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700297 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400298 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000299 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400300 } else {
301 cflags = [ "-mavx" ]
302 }
mtkleinc04ff472016-06-23 10:29:30 -0700303}
304
Mike Klein1b9b7d52018-02-27 10:37:40 -0500305opts("hsw") {
306 enabled = is_x86
307 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400308 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500309 cflags = [ "/arch:AVX2" ]
310 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000311 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500312 }
313
314 # Oddly, clang-cl doesn't recognize this as a valid flag.
315 # If it ever does, it'd nice to move this up with -mavx2 and co.
316 if (is_clang && !is_win) {
317 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
318 # but nice to have, generating slightly better code for paths without explicit FMAs.
319 cflags += [ "-ffp-contract=fast" ]
320 }
321}
322
mtkleinc095df52016-08-24 12:23:52 -0700323# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700324template("optional") {
325 if (invoker.enabled) {
326 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700327 if (defined(invoker.public_defines)) {
328 defines = invoker.public_defines
329 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600330 if (defined(invoker.public_configs)) {
331 configs = invoker.public_configs
332 }
mtklein457b42a2016-08-23 13:56:37 -0700333 }
334 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700335 forward_variables_from(invoker,
336 "*",
337 [
338 "public_defines",
339 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700340 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700341 ])
mtklein457b42a2016-08-23 13:56:37 -0700342 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700343 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700344 if (defined(invoker.configs_to_remove)) {
345 configs -= invoker.configs_to_remove
346 }
mtklein457b42a2016-08-23 13:56:37 -0700347 }
348 } else {
mtklein457b42a2016-08-23 13:56:37 -0700349 source_set(target_name) {
350 forward_variables_from(invoker,
351 "*",
352 [
353 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400354 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700355 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700356 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700357 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700358 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700359 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700360 ])
mtkleincd01b032016-08-31 04:58:19 -0700361 if (defined(invoker.sources_when_disabled)) {
362 sources = invoker.sources_when_disabled
363 }
364 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700365 }
mtkleineb3c4252016-08-23 07:38:09 -0700366 }
mtklein457b42a2016-08-23 13:56:37 -0700367}
mtklein457b42a2016-08-23 13:56:37 -0700368
Mike Kleina04bb452017-02-09 12:24:07 -0500369optional("effects") {
370 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400371 deps = [
372 ":compile_processors",
373 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500374 sources =
375 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
Mike Reed0917fad2018-06-19 10:17:30 -0400376 if (skia_enable_effects_imagefilters) {
377 sources += skia_effects_imagefilter_sources
378 } else {
379 sources += [ "src/ports/SkGlobalInitialization_none_imagefilters.cpp" ]
380 }
381 sources_when_disabled = [
382 "src/ports/SkGlobalInitialization_none.cpp",
383 "src/ports/SkGlobalInitialization_none_imagefilters.cpp",
384 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500385}
386
mtkleina45be612016-08-29 15:22:10 -0700387optional("fontmgr_android") {
388 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700389
390 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500391 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700392 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700393 ]
394 sources = [
395 "src/ports/SkFontMgr_android.cpp",
396 "src/ports/SkFontMgr_android_factory.cpp",
397 "src/ports/SkFontMgr_android_parser.cpp",
398 ]
399}
400
mtkleind2e39db2016-09-07 07:52:55 -0700401optional("fontmgr_custom") {
Kevin Lubick217056c2018-09-20 17:39:31 -0400402 enabled = (is_linux || target_cpu == "wasm") && skia_use_freetype &&
403 !skia_use_fontconfig
mtkleind2e39db2016-09-07 07:52:55 -0700404
405 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500406 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700407 ]
408 sources = [
409 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500410 "src/ports/SkFontMgr_custom.h",
411 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700412 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500413 "src/ports/SkFontMgr_custom_embedded.cpp",
414 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700415 ]
416}
417
Hal Canaryff2742e2018-01-30 11:35:47 -0500418optional("fontmgr_empty") {
419 enabled = skia_enable_fontmgr_empty
420 sources = [
421 "src/ports/SkFontMgr_empty_factory.cpp",
422 ]
423}
424
mtklein3cc22182016-08-29 13:26:14 -0700425optional("fontmgr_fontconfig") {
426 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700427
428 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500429 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700430 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700431 ]
432 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700433 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700434 "src/ports/SkFontConfigInterface_direct.cpp",
435 "src/ports/SkFontConfigInterface_direct_factory.cpp",
436 "src/ports/SkFontMgr_FontConfigInterface.cpp",
437 "src/ports/SkFontMgr_fontconfig.cpp",
438 "src/ports/SkFontMgr_fontconfig_factory.cpp",
439 ]
440}
441
mtkleincdedd0e2016-09-12 15:15:44 -0700442optional("fontmgr_fuchsia") {
443 enabled = is_fuchsia && skia_use_freetype
444
445 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500446 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700447 ]
448 sources = [
449 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500450 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700451 "src/ports/SkFontMgr_custom_empty_factory.cpp",
452 ]
453}
454
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700455if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400456 executable("sksllex") {
457 sources = [
458 "src/sksl/lex/Main.cpp",
459 "src/sksl/lex/NFA.cpp",
460 "src/sksl/lex/RegexNode.cpp",
461 "src/sksl/lex/RegexParser.cpp",
462 ]
463 include_dirs = [ "src/sksl/lex" ]
464 }
465
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700466 action("run_sksllex") {
467 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400468 deps = [
469 ":sksllex(//gn/toolchain:$host_toolchain)",
470 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700471 sources = [
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700472 "src/sksl/lex/sksl.lex",
473 ]
474
475 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
476 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
477 outputs = [
478 "$target_out_dir/" +
479 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
480 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
481 # confused due to the same file being named by two different paths
482 ]
483 sksllex_path = "$root_out_dir/"
484 sksllex_path += "sksllex"
485 if (host_os == "win") {
486 sksllex_path += ".exe"
487 }
488 args = [
489 rebase_path(sksllex_path),
490 rebase_path("bin/clang-format"),
491 rebase_path("src"),
492 ]
493 }
494} else {
495 group("run_sksllex") {
496 }
497}
498
499if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400500 executable("skslc") {
501 defines = [ "SKSL_STANDALONE" ]
502 sources = [
503 "src/sksl/SkSLMain.cpp",
504 ]
505 sources += skia_sksl_sources
506 include_dirs = [
507 "src/gpu",
508 "src/sksl",
509 ]
510 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500511 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400512 "//third_party/spirv-tools",
513 ]
514 }
515
516 skia_gpu_processor_outputs = []
517 foreach(src, skia_gpu_processor_sources) {
518 dir = get_path_info(src, "dir")
519 name = get_path_info(src, "name")
520
521 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
522 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
523 skia_gpu_processor_outputs += [
524 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
525 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
526 # confused due to the same file being named by two different paths
527 ]
528 }
529
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500530 action("create_sksl_enums") {
531 script = "gn/create_sksl_enums.py"
532 sources = [
533 "include/private/GrSharedEnums.h",
534 ]
535 outputs = [
536 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500537 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500538 ]
539 args = [
540 rebase_path(sources[0]),
541 rebase_path(outputs[0]),
542 ]
543 }
544
Ethan Nicholas762466e2017-06-29 10:03:38 -0400545 action("compile_processors") {
546 script = "gn/compile_processors.py"
547 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500548 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400549 ":skslc(//gn/toolchain:$host_toolchain)",
550 ]
551 sources = skia_gpu_processor_sources
552 outputs = skia_gpu_processor_outputs
553 skslc_path = "$root_out_dir/"
554 if (host_toolchain != default_toolchain_name) {
555 skslc_path += "$host_toolchain/"
556 }
557 skslc_path += "skslc"
558 if (host_os == "win") {
559 skslc_path += ".exe"
560 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400561 args = [
562 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400563 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400564 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400565 args += rebase_path(skia_gpu_processor_sources)
566 }
567} else {
568 skia_gpu_processor_outputs = []
569 group("compile_processors") {
570 }
571}
572
mtklein06c35c02016-09-20 12:28:12 -0700573optional("gpu") {
574 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400575 deps = [
576 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700577 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400578 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700579 if (skia_generate_workarounds) {
580 deps += [ ":workaround_list" ]
581 }
mtkleine9fb3d52016-09-20 15:11:46 -0700582 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600583 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400584 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700585
Brian Salomon3d6801e2017-12-11 10:06:31 -0500586 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700587
588 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500589 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700590 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400591 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700592 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400593 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400594
595 # this lib is required to link against AHardwareBuffer
596 if (defined(ndk_api) && ndk_api >= 26) {
597 libs += [ "android" ]
598 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400599 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500600 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400601 libs += [ "EGL" ]
Chinmay Garded92d0352018-09-17 10:23:28 -0700602 } else if (is_linux && skia_use_x11) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500603 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -0400604 libs += [ "GL" ]
mtklein06c35c02016-09-20 12:28:12 -0700605 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500606 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800607 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500608 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400609 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500610 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400611 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700612 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500613 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700614 }
mtkleine9fb3d52016-09-20 15:11:46 -0700615
616 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400617 public_defines += [ "SK_VULKAN" ]
Greg Daniel18dbfd02018-05-29 10:46:51 -0400618 deps += [ "third_party/vulkanmemoryallocator" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700619 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700620 if (skia_enable_vulkan_debug_layers) {
621 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
622 }
mtkleine9fb3d52016-09-20 15:11:46 -0700623 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400624
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400625 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400626 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400627 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
628 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400629
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400630 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400631 if (skia_use_metal) {
632 public_defines += [ "SK_METAL" ]
633 sources += skia_metal_sources
634 libs += [ "Metal.framework" ]
Greg Daniel53956d92018-08-08 14:41:19 -0400635 libs += [ "Foundation.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400636 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400637 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500638
639 if (skia_enable_atlas_text) {
640 sources += skia_atlas_text_sources
641 }
mtklein06c35c02016-09-20 12:28:12 -0700642}
643
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400644optional("heif") {
645 enabled = skia_use_libheif
646 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
647
648 deps = []
649
650 sources = [
651 "src/codec/SkHeifCodec.cpp",
652 ]
653}
654
mtklein63213812016-08-24 09:55:56 -0700655optional("jpeg") {
656 enabled = skia_use_libjpeg_turbo
657 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
658
mtklein63213812016-08-24 09:55:56 -0700659 deps = [
660 "//third_party/libjpeg-turbo:libjpeg",
661 ]
Mike Kleinf105dc72018-06-05 15:22:54 -0400662 public = [
663 "include/encode/SkJpegEncoder.h",
664 ]
mtklein63213812016-08-24 09:55:56 -0700665 sources = [
666 "src/codec/SkJpegCodec.cpp",
667 "src/codec/SkJpegDecoderMgr.cpp",
668 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700669 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400670 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700671 ]
672}
673
674optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500675 enabled = skia_use_zlib && skia_enable_pdf
676 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700677
mtklein63213812016-08-24 09:55:56 -0700678 deps = [
679 "//third_party/zlib",
680 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400681 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700682 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400683 }
brettwb9447282016-09-01 14:24:39 -0700684 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700685 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700686
687 if (skia_use_sfntly) {
688 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500689 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700690 }
691}
692
693optional("png") {
694 enabled = skia_use_libpng
695 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
696
mtklein63213812016-08-24 09:55:56 -0700697 deps = [
698 "//third_party/libpng",
699 ]
700 sources = [
701 "src/codec/SkIcoCodec.cpp",
702 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400703 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700704 ]
705}
706
scroggof84ad642016-10-31 09:02:57 -0700707optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400708 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700709 public_defines = [ "SK_CODEC_DECODES_RAW" ]
710
711 deps = [
712 "//third_party/dng_sdk",
713 "//third_party/libjpeg-turbo:libjpeg",
714 "//third_party/piex",
715 ]
716
717 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
718 # Skia.
719 configs_to_remove = [ "//gn:no_exceptions" ]
720
721 sources = [
722 "src/codec/SkRawAdapterCodec.cpp",
723 "src/codec/SkRawCodec.cpp",
724 ]
725}
726
Mike Klein852a8cb2018-05-15 10:46:58 -0400727import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -0400728source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -0400729 cflags = []
730 if (!is_win || is_clang) {
731 cflags += [
732 "-w",
733 "-std=c11",
734 ]
735 }
736
737 public = [
738 "third_party/skcms/skcms.h",
739 ]
740 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
741}
742
mtklein3cc22182016-08-29 13:26:14 -0700743optional("typeface_freetype") {
744 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700745
746 deps = [
747 "//third_party/freetype2",
748 ]
749 sources = [
750 "src/ports/SkFontHost_FreeType.cpp",
751 "src/ports/SkFontHost_FreeType_common.cpp",
752 ]
753}
754
mtklein457b42a2016-08-23 13:56:37 -0700755optional("webp") {
756 enabled = skia_use_libwebp
757 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
758
mtklein457b42a2016-08-23 13:56:37 -0700759 deps = [
760 "//third_party/libwebp",
761 ]
762 sources = [
763 "src/codec/SkWebpAdapterCodec.cpp",
764 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400765 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700766 ]
mtkleineb3c4252016-08-23 07:38:09 -0700767}
768
mtklein63213812016-08-24 09:55:56 -0700769optional("xml") {
770 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000771 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700772
mtklein63213812016-08-24 09:55:56 -0700773 deps = [
774 "//third_party/expat",
775 ]
776 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500777 "src/svg/SkSVGCanvas.cpp",
778 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700779 "src/xml/SkDOM.cpp",
780 "src/xml/SkXMLParser.cpp",
781 "src/xml/SkXMLWriter.cpp",
782 ]
783}
784
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700785if (skia_enable_gpu && skia_generate_workarounds) {
786 action("workaround_list") {
787 script = "tools/build_workaround_header.py"
788
789 inputs = [
790 "src/gpu/gpu_workaround_list.txt",
791 ]
792
793 # see comments in skia_compile_processors about out dir path shenanigans.
794 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700795 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700796
797 outputs = [
798 "$root_out_dir/$output_file",
799 ]
800 args = [
801 "--output-file",
802 "$output_file",
803 ]
804
805 foreach(file, inputs) {
806 args += [ rebase_path(file, root_build_dir) ]
807 }
808 }
809}
810
mtkleinc04ff472016-06-23 10:29:30 -0700811component("skia") {
812 public_configs = [ ":skia_public" ]
813 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700814
815 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700816 ":arm64",
817 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700818 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700819 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500820 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700821 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700822 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500823 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700824 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700825 ":fontmgr_fuchsia",
Greg Danielda16cce2018-08-01 09:23:57 -0400826 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400827 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500828 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700829 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700830 ":none",
mtklein63213812016-08-24 09:55:56 -0700831 ":pdf",
832 ":png",
scroggof84ad642016-10-31 09:02:57 -0700833 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500834 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700835 ":sse2",
836 ":sse41",
837 ":sse42",
838 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700839 ":webp",
mtklein63213812016-08-24 09:55:56 -0700840 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700841 ]
842
Chinmay Garde43f115c2016-11-16 15:04:12 -0800843 # This file (and all GN files in Skia) are designed to work with an
844 # empty sources assignment filter; we handle all that explicitly.
845 # We clear the filter here for clients who may have set up a global filter.
846 set_sources_assignment_filter([])
847
mtkleinc04ff472016-06-23 10:29:30 -0700848 sources = []
brettwb9447282016-09-01 14:24:39 -0700849 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700850 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500851 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700852 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400853 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500854 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700855 "src/android/SkBitmapRegionCodec.cpp",
856 "src/android/SkBitmapRegionDecoder.cpp",
857 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400858 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700859 "src/codec/SkBmpCodec.cpp",
860 "src/codec/SkBmpMaskCodec.cpp",
861 "src/codec/SkBmpRLECodec.cpp",
862 "src/codec/SkBmpStandardCodec.cpp",
863 "src/codec/SkCodec.cpp",
864 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -0400865 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -0400866 "src/codec/SkEncodedInfo.cpp",
scroggo19b91532016-10-24 09:03:26 -0700867 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700868 "src/codec/SkMaskSwizzler.cpp",
869 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700870 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700871 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700872 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700873 "src/codec/SkSwizzler.cpp",
874 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700875 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700876 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700877 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700878 "src/ports/SkMemory_malloc.cpp",
879 "src/ports/SkOSFile_stdio.cpp",
880 "src/sfnt/SkOTTable_name.cpp",
881 "src/sfnt/SkOTUtils.cpp",
882 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700883 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700884 ]
brettwb9447282016-09-01 14:24:39 -0700885
mtklein7d6fb2c2016-08-25 14:50:44 -0700886 libs = []
887
mtkleinc04ff472016-06-23 10:29:30 -0700888 if (is_win) {
889 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400890 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700891 "src/ports/SkDebug_win.cpp",
892 "src/ports/SkFontHost_win.cpp",
893 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500894 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700895 "src/ports/SkImageEncoder_WIC.cpp",
896 "src/ports/SkImageGeneratorWIC.cpp",
897 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700898 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700899 "src/ports/SkScalerContext_win_dw.cpp",
900 "src/ports/SkTLS_win.cpp",
901 "src/ports/SkTypeface_win_dw.cpp",
902 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400903 libs += [
904 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500905 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400906 "Ole32.lib",
907 "OleAut32.lib",
908 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500909 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400910 ]
mtkleinc04ff472016-06-23 10:29:30 -0700911 } else {
912 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700913 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700914 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700915 "src/ports/SkTLS_pthread.cpp",
916 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400917 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700918 }
919
mtklein7d6fb2c2016-08-25 14:50:44 -0700920 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500921 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500922 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500923 deps += [ "//third_party/cpu-features" ]
924 }
mtklein06c35c02016-09-20 12:28:12 -0700925 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700926 libs += [
927 "EGL",
928 "GLESv2",
929 "log",
930 ]
931 }
932
Kevin Lubick217056c2018-09-20 17:39:31 -0400933 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -0700934 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400935 if (skia_use_egl) {
936 libs += [ "GLESv2" ]
937 }
mtkleinc04ff472016-06-23 10:29:30 -0700938 }
939
940 if (is_mac) {
941 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700942 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700943 "src/ports/SkFontHost_mac.cpp",
944 "src/ports/SkImageEncoder_CG.cpp",
945 "src/ports/SkImageGeneratorCG.cpp",
946 ]
mtklein09e61f72016-08-23 13:35:28 -0700947 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400948 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
949 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700950 "ApplicationServices.framework",
951 "OpenGL.framework",
952 ]
mtkleinc04ff472016-06-23 10:29:30 -0700953 }
abarth6fc8ff02016-07-15 15:15:15 -0700954
Mike Klein7d302882016-11-03 14:06:31 -0400955 if (is_ios) {
956 sources += [
957 "src/ports/SkDebug_stdio.cpp",
958 "src/ports/SkFontHost_mac.cpp",
959 "src/ports/SkImageEncoder_CG.cpp",
960 "src/ports/SkImageGeneratorCG.cpp",
961 ]
962 libs += [
963 "CoreFoundation.framework",
964 "CoreGraphics.framework",
965 "CoreText.framework",
966 "ImageIO.framework",
967 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400968
969 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
970 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400971 ]
972 }
973
abarth6fc8ff02016-07-15 15:15:15 -0700974 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700975 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700976 }
mtkleinc04ff472016-06-23 10:29:30 -0700977}
978
Kevin Lubickcbcff382018-10-02 09:02:18 -0400979static_library("pathkit") {
980 public_configs = [ ":skia_public" ]
981 configs += skia_library_configs
982
983 deps = [
984 ":arm64",
985 ":armv7",
986 ":avx",
987 ":crc32",
988 ":hsw",
989 ":none",
990 ":sse2",
991 ":sse41",
992 ":sse42",
993 ":ssse3",
994 ]
995
996 # This file (and all GN files in Skia) are designed to work with an
997 # empty sources assignment filter; we handle all that explicitly.
998 # We clear the filter here for clients who may have set up a global filter.
999 set_sources_assignment_filter([])
1000
1001 sources = []
1002 sources += skia_pathops_sources
1003 sources += [
1004 "src/core/SkAnalyticEdge.cpp",
1005 "src/core/SkArenaAlloc.cpp",
1006 "src/core/SkCubicMap.cpp",
1007 "src/core/SkEdge.cpp",
1008 "src/core/SkEdgeBuilder.cpp",
1009 "src/core/SkEdgeClipper.cpp",
1010 "src/core/SkGeometry.cpp",
1011 "src/core/SkLineClipper.cpp",
1012 "src/core/SkMallocPixelRef.cpp",
1013 "src/core/SkMath.cpp",
1014 "src/core/SkMatrix.cpp",
1015 "src/core/SkOpts.cpp",
1016 "src/core/SkPaint.cpp",
1017 "src/core/SkPath.cpp",
1018 "src/core/SkPathEffect.cpp",
1019 "src/core/SkPathMeasure.cpp",
1020 "src/core/SkPathRef.cpp",
1021 "src/core/SkPoint.cpp",
1022 "src/core/SkRRect.cpp",
1023 "src/core/SkRect.cpp",
1024 "src/core/SkSemaphore.cpp",
1025 "src/core/SkStream.cpp",
1026 "src/core/SkString.cpp",
1027 "src/core/SkStringUtils.cpp",
1028 "src/core/SkStroke.cpp",
1029 "src/core/SkStrokeRec.cpp",
1030 "src/core/SkStrokerPriv.cpp",
1031 "src/core/SkThreadID.cpp",
1032 "src/core/SkUtils.cpp",
1033 "src/effects/SkDashPathEffect.cpp",
1034 "src/effects/SkTrimPathEffect.cpp",
1035 "src/ports/SkDebug_stdio.cpp",
1036 "src/ports/SkMemory_malloc.cpp",
1037 "src/utils/SkDashPath.cpp",
1038 "src/utils/SkParse.cpp",
1039 "src/utils/SkParsePath.cpp",
1040 "src/utils/SkUTF.cpp",
1041 ]
1042}
1043
mtkleinc095df52016-08-24 12:23:52 -07001044# Targets guarded by skia_enable_tools may use //third_party freely.
1045if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001046 # Used by gn_to_bp.py to list our public include dirs.
1047 source_set("public") {
1048 configs += [ ":skia_public" ]
1049 }
1050
Mike Kleinc36dedf2016-11-18 09:35:28 -05001051 config("skia.h_config") {
1052 include_dirs = [ "$target_gen_dir" ]
1053 }
1054 action("skia.h") {
1055 public_configs = [ ":skia.h_config" ]
1056 skia_h = "$target_gen_dir/skia.h"
1057 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001058
1059 # TODO: would be cool to not hard-code these here, but how?
1060 module_public_includes = [
1061 "modules/sksg/include",
1062 "modules/skottie/include",
1063 ]
1064 args =
1065 [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1066 [ rebase_path(skia_h, root_build_dir) ] +
1067 rebase_path(skia_public_includes) + rebase_path(module_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001068 depfile = "$skia_h.deps"
1069 outputs = [
1070 skia_h,
1071 ]
1072 }
1073
Brian Osmanc9a42472018-05-31 13:17:12 -04001074 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001075 executable("fiddle") {
1076 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001077 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001078 "tools/fiddle/draw.cpp",
1079 "tools/fiddle/fiddle_main.cpp",
1080 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001081
1082 if (skia_use_egl) {
1083 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001084 } else {
1085 sources += [ "tools/fiddle/null_context.cpp" ]
1086 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001087 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001088 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001089 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001090 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001091 ":skia",
1092 ":skia.h",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001093 "modules/skottie",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001094 ]
1095 }
1096 }
1097
Brian Osmanc9a42472018-05-31 13:17:12 -04001098 source_set("public_headers_warnings_check") {
1099 sources = [
1100 "tools/public_headers_warnings_check.cpp",
1101 ]
1102 configs -= [ "//gn:warnings_except_public_headers" ]
1103 deps = [
1104 ":skia",
1105 ":skia.h",
1106 "modules/skottie",
1107 ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001108 }
1109
mtkleinc095df52016-08-24 12:23:52 -07001110 template("test_lib") {
1111 config(target_name + "_config") {
1112 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001113 if (defined(invoker.public_defines)) {
1114 defines = invoker.public_defines
1115 }
mtklein25c81d42016-07-27 13:55:26 -07001116 }
mtkleinc095df52016-08-24 12:23:52 -07001117 source_set(target_name) {
1118 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1119 public_configs = [
1120 ":" + target_name + "_config",
1121 ":skia_private",
1122 ]
1123
1124 if (!defined(deps)) {
1125 deps = []
1126 }
1127 deps += [ ":skia" ]
1128 testonly = true
1129 }
mtklein25c81d42016-07-27 13:55:26 -07001130 }
mtklein25c81d42016-07-27 13:55:26 -07001131
Mike Kleine6682eb2017-01-05 10:54:57 -05001132 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001133 if (is_ios) {
1134 app_name = target_name
1135 gen_path = target_gen_dir
1136
1137 action("${app_name}_generate_info_plist") {
1138 script = "//gn/gen_plist_ios.py"
1139 outputs = [
1140 "$gen_path/${app_name}_Info.plist",
1141 ]
1142 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1143 }
1144
1145 bundle_data("${app_name}_bundle_info_plist") {
1146 public_deps = [
1147 ":${app_name}_generate_info_plist",
1148 ]
1149 sources = [
1150 "$gen_path/${app_name}_Info.plist",
1151 ]
1152 outputs = [
1153 "{{bundle_root_dir}}/Info.plist",
1154 ]
1155 }
1156
Jim Van Verth329c5a62017-11-29 11:42:33 -05001157 bundle_ios_data =
1158 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1159
1160 if (bundle_ios_data) {
1161 has_skps =
1162 "True" == exec_script("//gn/checkdir.py",
1163 [ rebase_path("skps", root_build_dir) ],
1164 "trim string")
1165 bundle_data("${app_name}_bundle_resources") {
1166 sources = [
1167 "resources",
1168 ]
1169 outputs = [
1170 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1171 "{{bundle_resources_dir}}/data/resources",
1172 ]
1173 }
1174
1175 if (has_skps) {
1176 bundle_data("${app_name}_bundle_skps") {
1177 sources = [
1178 "skps",
1179 ]
1180 outputs = [
1181 # Store in same folder as resources
1182 "{{bundle_resources_dir}}/data/skps",
1183 ]
1184 }
1185 }
1186 }
1187
Jim Van Verth443a9132017-11-28 09:45:26 -05001188 executable("${app_name}_generate_executable") {
1189 forward_variables_from(invoker,
1190 "*",
1191 [
1192 "output_name",
1193 "visibility",
1194 "is_shared_library",
1195 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001196 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001197 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001198 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1199 }
1200
1201 bundle_data("${app_name}_bundle_executable") {
1202 public_deps = [
1203 ":${app_name}_generate_executable",
1204 ]
1205 sources = [
1206 "$gen_path/$app_name",
1207 ]
1208 outputs = [
1209 "{{bundle_executable_dir}}/$app_name",
1210 ]
1211 testonly = true
1212 }
1213
1214 create_bundle("$app_name") {
1215 product_type = "com.apple.product-type.application"
1216 testonly = true
1217
1218 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1219 bundle_resources_dir = bundle_root_dir
1220 bundle_executable_dir = bundle_root_dir
1221 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1222
1223 deps = [
1224 ":${app_name}_bundle_executable",
1225 ":${app_name}_bundle_info_plist",
1226 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001227 if (bundle_ios_data) {
1228 deps += [ ":${app_name}_bundle_resources" ]
1229 if (has_skps) {
1230 deps += [ ":${app_name}_bundle_skps" ]
1231 }
1232 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001233
1234 # should only code sign when running on a device, not the simulator
1235 if (target_cpu != "x64") {
1236 code_signing_script = "//gn/codesign_ios.py"
1237 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1238 code_signing_outputs = [
1239 "$bundle_root_dir/_CodeSignature/CodeResources",
1240 "$bundle_root_dir/embedded.mobileprovision",
1241 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001242 code_signing_args = [
1243 rebase_path("$bundle_root_dir", root_build_dir),
1244 skia_ios_identity,
1245 skia_ios_profile,
1246 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001247 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001248 }
1249 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001250 # !is_ios
1251
1252 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1253 shared_library("lib" + target_name) {
1254 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1255 configs += [ ":skia_private" ]
1256 testonly = true
1257 }
1258 } else {
1259 _executable = target_name
1260 executable(_executable) {
1261 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1262 configs += [ ":skia_private" ]
1263 testonly = true
1264 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001265 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001266 if (is_android && skia_android_serial != "" && defined(_executable)) {
1267 action("push_" + target_name) {
1268 script = "gn/push_to_android.py"
1269 deps = [
1270 ":" + _executable,
1271 ]
1272 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1273 outputs = [
1274 _stamp,
1275 ]
1276 args = [
1277 rebase_path("$root_build_dir/$_executable"),
1278 skia_android_serial,
1279 rebase_path(_stamp),
1280 ]
1281 testonly = true
1282 }
Mike Klein7d921032017-01-05 12:20:41 -05001283 }
1284 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001285 }
1286
Greg Danielda16cce2018-08-01 09:23:57 -04001287 config("moltenvk_config") {
1288 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1289 if (is_ios) {
1290 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
1291 } else {
1292 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
1293 }
1294 cflags = [ "-F$moltenvk_framework_path" ]
1295 ldflags = [ "-F$moltenvk_framework_path" ]
1296 libs = [
1297 "MoltenVK.framework",
1298 "Metal.framework",
1299 "IOSurface.framework",
1300 "QuartzCore.framework",
1301 "Foundation.framework",
1302 ]
1303 if (is_ios) {
1304 libs += [ "UIKit.framework" ]
1305 } else {
1306 libs += [ "IOKit.framework" ]
1307 }
1308 defines = [ "SK_MOLTENVK" ]
1309 }
1310 }
1311
1312 source_set("moltenvk") {
1313 public_configs = [ ":moltenvk_config" ]
1314 }
1315
mtkleinc095df52016-08-24 12:23:52 -07001316 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001317 public_include_dirs = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001318 public_defines = []
1319 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001320
Brian Osmanc9a42472018-05-31 13:17:12 -04001321 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001322 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001323 sources = [
1324 "tools/gpu/GrContextFactory.cpp",
1325 "tools/gpu/GrTest.cpp",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001326 "tools/gpu/MemoryCache.cpp",
1327 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001328 "tools/gpu/ProxyUtils.cpp",
1329 "tools/gpu/TestContext.cpp",
1330 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
1331 "tools/gpu/gl/GLTestContext.cpp",
1332 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04001333 "tools/gpu/gl/null/NullGLTestContext.cpp",
1334 "tools/gpu/mock/MockTestContext.cpp",
1335 ]
1336 libs = []
1337
1338 if (is_android || skia_use_egl) {
1339 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1340 } else if (is_ios) {
1341 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1342 libs += [ "OpenGLES.framework" ]
1343 } else if (is_linux) {
1344 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -04001345 libs += [
1346 "GLU",
1347 "X11",
1348 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001349 } else if (is_mac) {
1350 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
1351 } else if (is_win) {
1352 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1353 libs += [
1354 "Gdi32.lib",
1355 "OpenGL32.lib",
mtklein38925aa2016-09-21 10:11:25 -07001356 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001357 }
mtklein25c81d42016-07-27 13:55:26 -07001358
Brian Osmanc9a42472018-05-31 13:17:12 -04001359 cflags_objcc = [ "-fobjc-arc" ]
mtklein6ef69992016-09-14 06:12:09 -07001360
Brian Osmanc9a42472018-05-31 13:17:12 -04001361 if (skia_use_angle) {
1362 deps += [ "//third_party/angle2" ]
1363 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1364 }
1365 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -04001366 public_include_dirs += [ "third_party/vulkan" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001367 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
1368 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Greg Danielda16cce2018-08-01 09:23:57 -04001369 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1370 public_deps += [ ":moltenvk" ]
1371 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001372 }
1373 if (skia_use_metal) {
1374 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001375 }
mtklein25c81d42016-07-27 13:55:26 -07001376 }
mtklein25c81d42016-07-27 13:55:26 -07001377
mtkleinc095df52016-08-24 12:23:52 -07001378 test_lib("flags") {
1379 public_include_dirs = [ "tools/flags" ]
1380 sources = [
1381 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001382 ]
1383 }
1384 test_lib("common_flags") {
1385 public_include_dirs = [ "tools/flags" ]
1386 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001387 "tools/flags/SkCommonFlags.cpp",
1388 "tools/flags/SkCommonFlagsConfig.cpp",
1389 ]
1390 deps = [
mtklein046cb562016-09-16 10:23:12 -07001391 ":flags",
Greg Danielda16cce2018-08-01 09:23:57 -04001392 ]
1393 public_deps = [
mtkleinc095df52016-08-24 12:23:52 -07001394 ":gpu_tool_utils",
1395 ]
1396 }
mtklein25c81d42016-07-27 13:55:26 -07001397
mtkleinc095df52016-08-24 12:23:52 -07001398 test_lib("tool_utils") {
1399 public_include_dirs = [
1400 "tools",
1401 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001402 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001403 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001404 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001405 ]
1406 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001407 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001408 "tools/CrashHandler.cpp",
Robert Phillips96601082018-05-29 16:13:26 -04001409 "tools/DDLPromiseImageHelper.cpp",
1410 "tools/DDLTileHelper.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001411 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001412 "tools/ProcStats.cpp",
1413 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001414 "tools/UrlDataManager.cpp",
1415 "tools/debugger/SkDebugCanvas.cpp",
1416 "tools/debugger/SkDrawCommand.cpp",
1417 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001418 "tools/fonts/SkRandomScalerContext.cpp",
Herb Derby33ac15e2018-08-29 12:36:22 -04001419 "tools/fonts/SkTestEmptyTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001420 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001421 "tools/fonts/SkTestFontMgr.h",
1422 "tools/fonts/SkTestSVGTypeface.cpp",
1423 "tools/fonts/SkTestSVGTypeface.h",
1424 "tools/fonts/SkTestTypeface.cpp",
1425 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001426 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001427 "tools/random_parse_path.cpp",
1428 "tools/sk_tool_utils.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001429 "tools/timer/SkAnimTimer.h",
mtkleinc095df52016-08-24 12:23:52 -07001430 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001431 "tools/trace/SkChromeTracingTracer.cpp",
1432 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001433 "tools/trace/SkDebugfTracer.cpp",
1434 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001435 "tools/trace/SkEventTracingPriv.cpp",
1436 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001437 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001438 libs = []
1439 if (is_ios) {
1440 sources += [ "tools/ios_utils.m" ]
1441 libs += [ "Foundation.framework" ]
1442 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001443 defines = []
1444 if (skia_tools_require_resources) {
1445 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1446 }
mtkleinc095df52016-08-24 12:23:52 -07001447 deps = [
Ben Wagner97182cc2018-02-15 10:20:04 -05001448 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001449 ":flags",
1450 "//third_party/libpng",
1451 ]
1452 public_deps = [
Greg Danielda16cce2018-08-01 09:23:57 -04001453 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001454 "//third_party/jsoncpp",
1455 ]
1456 }
mtklein25c81d42016-07-27 13:55:26 -07001457
Mike Klein6e744122016-10-27 12:21:40 -04001458 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001459 test_lib("gm") {
1460 public_include_dirs = [ "gm" ]
1461 sources = gm_sources
1462 deps = [
scroggo19b91532016-10-24 09:03:26 -07001463 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001464 ":skia",
1465 ":tool_utils",
Mike Reed2f0edd52018-05-31 14:22:30 -04001466 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001467 "modules/skottie:gm",
Florin Malita3b526b02018-05-25 12:43:51 -04001468 "modules/sksg",
mtkleinc095df52016-08-24 12:23:52 -07001469 ]
Greg Danielda16cce2018-08-01 09:23:57 -04001470 public_deps = [
1471 ":gpu_tool_utils",
1472 ]
mtkleinc095df52016-08-24 12:23:52 -07001473 }
mtklein25c81d42016-07-27 13:55:26 -07001474
Mike Klein6e744122016-10-27 12:21:40 -04001475 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001476 test_lib("tests") {
1477 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001478 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001479 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001480 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001481 }
Ben Wagner37a06c02018-06-22 21:11:00 +00001482 if (!(skia_use_freetype && skia_use_fontconfig)) {
1483 sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
1484 }
mtkleinc095df52016-08-24 12:23:52 -07001485 deps = [
Mike Klein60900b52018-09-21 11:19:45 -04001486 ":experimental_pipe",
Hal Canary0f666812018-03-22 15:21:12 -04001487 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001488 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001489 ":skia",
1490 ":tool_utils",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001491 "modules/skottie:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001492 "modules/sksg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001493 "//third_party/libpng",
1494 "//third_party/zlib",
1495 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001496 public_deps = [
1497 ":gpu_tool_utils", # Test.h #includes headers from this target.
1498 ]
mtkleinc095df52016-08-24 12:23:52 -07001499 }
mtklein2f3416d2016-08-02 16:02:05 -07001500
Mike Klein6e744122016-10-27 12:21:40 -04001501 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001502 test_lib("bench") {
1503 public_include_dirs = [ "bench" ]
1504 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001505 deps = [
1506 ":flags",
1507 ":gm",
1508 ":gpu_tool_utils",
1509 ":skia",
1510 ":tool_utils",
1511 ]
1512 }
mtklein2b6870c2016-07-28 14:17:33 -07001513
Mike Klein60900b52018-09-21 11:19:45 -04001514 test_lib("experimental_pipe") {
1515 public_include_dirs = [ "experimental/pipe" ]
1516 sources = [
1517 "experimental/pipe/SkPipe.h",
1518 "experimental/pipe/SkPipeCanvas.cpp",
1519 "experimental/pipe/SkPipeCanvas.h",
1520 "experimental/pipe/SkPipeFormat.h",
1521 "experimental/pipe/SkPipeReader.cpp",
1522 "experimental/pipe/SkRefSet.h",
1523 ]
1524 }
1525
mtkleinc095df52016-08-24 12:23:52 -07001526 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001527 public_include_dirs = []
1528 if (skia_use_expat) {
1529 public_include_dirs += [ "experimental/svg/model" ]
1530 sources = [
1531 "experimental/svg/model/SkSVGAttribute.cpp",
1532 "experimental/svg/model/SkSVGAttributeParser.cpp",
1533 "experimental/svg/model/SkSVGCircle.cpp",
1534 "experimental/svg/model/SkSVGClipPath.cpp",
1535 "experimental/svg/model/SkSVGContainer.cpp",
1536 "experimental/svg/model/SkSVGDOM.cpp",
1537 "experimental/svg/model/SkSVGEllipse.cpp",
1538 "experimental/svg/model/SkSVGGradient.cpp",
1539 "experimental/svg/model/SkSVGLine.cpp",
1540 "experimental/svg/model/SkSVGLinearGradient.cpp",
1541 "experimental/svg/model/SkSVGNode.cpp",
1542 "experimental/svg/model/SkSVGPath.cpp",
1543 "experimental/svg/model/SkSVGPattern.cpp",
1544 "experimental/svg/model/SkSVGPoly.cpp",
1545 "experimental/svg/model/SkSVGRadialGradient.cpp",
1546 "experimental/svg/model/SkSVGRect.cpp",
1547 "experimental/svg/model/SkSVGRenderContext.cpp",
1548 "experimental/svg/model/SkSVGSVG.cpp",
1549 "experimental/svg/model/SkSVGShape.cpp",
1550 "experimental/svg/model/SkSVGStop.cpp",
1551 "experimental/svg/model/SkSVGTransformableNode.cpp",
1552 "experimental/svg/model/SkSVGUse.cpp",
1553 "experimental/svg/model/SkSVGValue.cpp",
1554 ]
1555 deps = [
1556 ":skia",
1557 ":xml",
1558 ]
1559 }
mtkleinc095df52016-08-24 12:23:52 -07001560 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001561
Mike Klein38af9432016-11-11 11:39:44 -05001562 if (skia_use_lua) {
1563 test_lib("lua") {
1564 public_include_dirs = []
1565 sources = [
1566 "src/utils/SkLua.cpp",
1567 "src/utils/SkLuaCanvas.cpp",
1568 ]
1569 deps = [
Herb Derby264182c2018-05-29 15:53:40 -04001570 "modules/skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001571 "//third_party/lua",
1572 ]
1573 }
1574
Mike Kleine6682eb2017-01-05 10:54:57 -05001575 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001576 sources = [
1577 "tools/lua/lua_app.cpp",
1578 ]
1579 deps = [
1580 ":lua",
1581 ":skia",
1582 "//third_party/lua",
1583 ]
Mike Klein38af9432016-11-11 11:39:44 -05001584 }
1585
Mike Kleine6682eb2017-01-05 10:54:57 -05001586 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001587 sources = [
1588 "tools/lua/lua_pictures.cpp",
1589 ]
1590 deps = [
1591 ":flags",
1592 ":lua",
1593 ":skia",
1594 ":tool_utils",
1595 "//third_party/lua",
1596 ]
Mike Klein38af9432016-11-11 11:39:44 -05001597 }
1598 }
1599
Cary Clark8032b982017-07-28 11:04:54 -04001600 test_app("bookmaker") {
1601 sources = [
1602 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001603 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001604 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001605 "tools/bookmaker/fiddleParser.cpp",
1606 "tools/bookmaker/includeParser.cpp",
1607 "tools/bookmaker/includeWriter.cpp",
1608 "tools/bookmaker/mdOut.cpp",
1609 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001610 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001611 "tools/bookmaker/spellCheck.cpp",
1612 ]
1613 deps = [
1614 ":flags",
1615 ":skia",
1616 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001617 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001618 ]
1619 }
1620
Florin Malitabfe876a2018-09-02 12:33:59 -04001621 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04001622 test_app("skottie_tool") {
1623 deps = [
1624 "modules/skottie:tool",
1625 ]
1626 }
1627 }
1628
Kevin Lubickebf648e2017-09-21 13:45:16 -04001629 if (target_cpu != "wasm") {
1630 import("gn/samples.gni")
1631 test_lib("samples") {
1632 public_include_dirs = [ "samplecode" ]
1633 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001634 sources = samples_sources
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001635 public_deps = [
1636 ":tool_utils",
1637 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001638 deps = [
1639 ":experimental_svg_model",
1640 ":flags",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001641 ":xml",
Herb Derby264182c2018-05-29 15:53:40 -04001642 "modules/skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001643 ]
Mike Klein38af9432016-11-11 11:39:44 -05001644
Ruiqi Maof5101492018-06-29 14:32:21 -04001645 # NIMA does not build on Windows clang
1646 if (!is_win || !is_clang) {
1647 deps += [ "//third_party/Nima-Cpp" ]
1648 }
1649
Kevin Lubickebf648e2017-09-21 13:45:16 -04001650 if (skia_use_lua) {
1651 sources += [ "samplecode/SampleLua.cpp" ]
1652 deps += [
1653 ":lua",
1654 "//third_party/lua",
1655 ]
1656 }
1657 }
Mike Klein7af351a2018-07-27 09:54:43 -04001658 test_app("imgcvt") {
1659 sources = [
1660 "tools/imgcvt.cpp",
1661 ]
1662 deps = [
1663 ":skcms",
1664 ":skia",
1665 ]
1666 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04001667 test_app("dm") {
1668 sources = [
1669 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001670 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001671 "dm/DMJsonWriter.cpp",
1672 "dm/DMSrcSink.cpp",
1673 ]
1674 include_dirs = [ "tests" ]
1675 deps = [
1676 ":common_flags",
Mike Klein60900b52018-09-21 11:19:45 -04001677 ":experimental_pipe",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001678 ":experimental_svg_model",
1679 ":flags",
1680 ":gm",
1681 ":gpu_tool_utils",
1682 ":skia",
1683 ":tests",
1684 ":tool_utils",
Florin Malita3d856bd2018-05-26 09:49:28 -04001685 "modules/skottie",
Florin Malita3b526b02018-05-25 12:43:51 -04001686 "modules/sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001687 "//third_party/jsoncpp",
1688 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001689 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04001690
1691 # NIMA does not build on Windows clang
1692 if (!is_win || !is_clang) {
1693 deps += [ "//third_party/Nima-Cpp" ]
1694 }
Mike Klein38af9432016-11-11 11:39:44 -05001695 }
Brian Osman16adfa32016-10-18 14:42:44 -04001696 }
1697
Mike Kleina8a51ce2018-01-09 12:34:11 -05001698 if (!is_win) {
1699 test_app("remote_demo") {
1700 sources = [
1701 "tools/remote_demo.cpp",
1702 ]
1703 deps = [
1704 ":skia",
1705 ]
1706 }
1707 }
1708
Mike Kleine6682eb2017-01-05 10:54:57 -05001709 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001710 sources = [
1711 "bench/nanobench.cpp",
1712 ]
1713 deps = [
1714 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001715 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001716 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001717 ":flags",
1718 ":gm",
1719 ":gpu_tool_utils",
1720 ":skia",
1721 ":tool_utils",
Florin Malita3b526b02018-05-25 12:43:51 -04001722 "modules/sksg",
mtklein2b6870c2016-07-28 14:17:33 -07001723 "//third_party/jsoncpp",
1724 ]
mtklein2b6870c2016-07-28 14:17:33 -07001725 }
halcanary19a97202016-08-03 15:08:04 -07001726
Ravi Mistry10d36c52017-01-31 09:49:18 -05001727 test_app("skpinfo") {
1728 sources = [
1729 "tools/skpinfo.cpp",
1730 ]
1731 deps = [
1732 ":flags",
1733 ":skia",
1734 ]
1735 }
1736
Brian Osmanc9a42472018-05-31 13:17:12 -04001737 test_app("skpbench") {
1738 sources = [
1739 "tools/skpbench/skpbench.cpp",
1740 ]
1741 deps = [
1742 ":flags",
1743 ":gpu_tool_utils",
1744 ":skia",
1745 ":tool_utils",
1746 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07001747 }
1748
Mike Kleine6682eb2017-01-05 10:54:57 -05001749 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001750 sources = [
Herb Derby264182c2018-05-29 15:53:40 -04001751 "tools/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001752 ]
1753 deps = [
1754 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04001755 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001756 ]
halcanary3eee9d92016-09-10 07:01:53 -07001757 }
mtklein046cb562016-09-16 10:23:12 -07001758
Ben Wagner219f3622017-07-17 15:32:25 -04001759 test_app("create_test_font") {
1760 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001761 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001762 ]
1763 deps = [
1764 ":skia",
1765 ]
1766 assert_no_deps = [
1767 # tool_utils requires the output of this app.
1768 ":tool_utils",
1769 ]
1770 }
1771
Florin Malita5d3ff432018-07-31 16:38:43 -04001772 if (skia_use_expat) {
1773 test_app("create_test_font_color") {
1774 sources = [
1775 "tools/fonts/create_test_font_color.cpp",
1776 ]
1777 deps = [
1778 ":flags",
1779 ":skia",
1780 ":tool_utils",
1781 ]
1782 }
Ben Wagner97182cc2018-02-15 10:20:04 -05001783 }
1784
Mike Kleine6682eb2017-01-05 10:54:57 -05001785 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001786 sources = [
1787 "tools/get_images_from_skps.cpp",
1788 ]
1789 deps = [
1790 ":flags",
1791 ":skia",
mtklein046cb562016-09-16 10:23:12 -07001792 ]
mtklein046cb562016-09-16 10:23:12 -07001793 }
mtkleinecbc5262016-09-22 11:51:24 -07001794
Kevin Lubickebf648e2017-09-21 13:45:16 -04001795 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001796 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001797 sources = [
1798 "tools/skiaserve/Request.cpp",
1799 "tools/skiaserve/Response.cpp",
1800 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001801 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1802 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1803 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1804 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1805 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1806 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1807 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1808 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1809 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001810 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1811 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001812 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1813 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1814 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1815 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1816 ]
1817 deps = [
1818 ":flags",
1819 ":gpu_tool_utils",
1820 ":skia",
1821 ":tool_utils",
1822 "//third_party/jsoncpp",
1823 "//third_party/libmicrohttpd",
1824 "//third_party/libpng",
1825 ]
Mike Klein7d302882016-11-03 14:06:31 -04001826 }
mtkleinecbc5262016-09-22 11:51:24 -07001827 }
kjlubick14f984b2016-10-03 11:49:45 -07001828
Mike Kleine6682eb2017-01-05 10:54:57 -05001829 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001830 include_dirs = [
1831 "tools",
1832 "tools/debugger",
1833 ]
kjlubick14f984b2016-10-03 11:49:45 -07001834 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001835 "fuzz/Fuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001836 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001837 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001838 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001839 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001840 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001841 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001842 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001843 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001844 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04001845 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001846 "fuzz/FuzzRegionOp.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001847 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1848 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001849 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04001850 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001851 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001852 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1853 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001854 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001855 "tools/UrlDataManager.cpp",
1856 "tools/debugger/SkDebugCanvas.cpp",
1857 "tools/debugger/SkDrawCommand.cpp",
1858 "tools/debugger/SkJsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001859 ]
1860 deps = [
1861 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001862 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001863 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04001864 "modules/skottie:fuzz",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001865 "//third_party/jsoncpp",
1866 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001867 ]
kjlubick14f984b2016-10-03 11:49:45 -07001868 }
Mike Klein38312422016-10-05 15:41:01 -04001869
Mike Kleine6682eb2017-01-05 10:54:57 -05001870 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001871 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001872 rebase_path("tests/skia_test.cpp"),
1873 rebase_path("tests/Test.cpp"),
1874 ]
caryclark9feb6322016-10-25 08:58:26 -07001875 deps = [
1876 ":flags",
1877 ":gpu_tool_utils",
1878 ":skia",
1879 ":tool_utils",
1880 ]
caryclark9feb6322016-10-25 08:58:26 -07001881 }
1882
Mike Kleine6682eb2017-01-05 10:54:57 -05001883 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001884 sources = [
1885 "tools/DumpRecord.cpp",
1886 "tools/dump_record.cpp",
1887 ]
1888 deps = [
1889 ":flags",
1890 ":skia",
1891 ]
Mike Klein38312422016-10-05 15:41:01 -04001892 }
bungemanfe917272016-10-13 17:36:40 -04001893
Mike Kleine6682eb2017-01-05 10:54:57 -05001894 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001895 sources = [
1896 "tools/skdiff/skdiff.cpp",
1897 "tools/skdiff/skdiff_html.cpp",
1898 "tools/skdiff/skdiff_main.cpp",
1899 "tools/skdiff/skdiff_utils.cpp",
1900 ]
1901 deps = [
1902 ":skia",
1903 ":tool_utils",
1904 ]
bungemanfe917272016-10-13 17:36:40 -04001905 }
halcanarya73d76a2016-10-17 13:19:02 -07001906
Mike Kleine6682eb2017-01-05 10:54:57 -05001907 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001908 sources = [
1909 "tools/skp_parser.cpp",
1910 ]
1911 deps = [
1912 ":skia",
1913 ":tool_utils",
1914 "//third_party/jsoncpp",
1915 ]
halcanarya73d76a2016-10-17 13:19:02 -07001916 }
Brian Osman16adfa32016-10-18 14:42:44 -04001917
Brian Osmanc9a42472018-05-31 13:17:12 -04001918 if (!is_win) {
Hal Canaryd7b38452017-12-11 17:46:26 -05001919 test_lib("skqp_lib") {
1920 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001921 defines =
1922 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001923 if (skia_skqp_enable_driver_correctness_workarounds) {
1924 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1925 }
Hal Canary75427132017-10-11 16:00:31 -04001926 sources = [
1927 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001928 "tools/skqp/gm_knowledge.cpp",
1929 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001930 ]
1931 deps = [
1932 ":gm",
1933 ":gpu_tool_utils",
1934 ":skia",
1935 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001936 ":tool_utils",
1937 ]
1938 }
1939 test_app("skqp") {
1940 sources = [
1941 "tools/skqp/skqp.cpp",
1942 ]
1943 deps = [
1944 ":skia",
1945 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001946 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001947 "//third_party/googletest",
1948 ]
1949 }
1950 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001951 if (is_android) {
Hal Canary28f89382017-12-12 09:42:14 -05001952 test_app("skqp_app") {
1953 is_shared_library = true
1954 sources = [
1955 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1956 ]
1957 deps = [
1958 ":skia",
1959 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001960 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001961 ]
1962 libs = [ "android" ]
1963 }
1964 }
Stan Iliev93151722018-08-02 11:10:52 -04001965 if (is_android && skia_enable_gpu) {
1966 test_app("skottie_android") {
1967 is_shared_library = true
1968
1969 sources = [
1970 "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
1971 "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
1972 ]
1973 libs = []
1974
1975 include_dirs = []
1976 deps = [
1977 ":skia",
1978 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04001979 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04001980 ]
1981 }
1982 }
Hal Canary75427132017-10-11 16:00:31 -04001983
Hal Canarya9de7602018-01-19 13:08:23 -05001984 test_app("list_gms") {
1985 sources = [
1986 "tools/list_gms.cpp",
1987 ]
1988 deps = [
1989 ":gm",
1990 ":skia",
1991 ]
1992 }
1993 test_app("list_gpu_unit_tests") {
1994 sources = [
1995 "dm/DMGpuTestProcs.cpp",
1996 "tools/list_gpu_unit_tests.cpp",
1997 ]
1998 deps = [
1999 ":skia",
2000 ":tests",
2001 ]
2002 }
2003
Brian Osmanc9a42472018-05-31 13:17:12 -04002004 test_lib("sk_app") {
2005 public_include_dirs = [ "tools/sk_app" ]
2006 sources = [
2007 "tools/sk_app/CommandSet.cpp",
2008 "tools/sk_app/GLWindowContext.cpp",
2009 "tools/sk_app/Window.cpp",
2010 ]
2011 libs = []
2012
2013 if (is_android) {
2014 sources += [
2015 "tools/sk_app/android/GLWindowContext_android.cpp",
2016 "tools/sk_app/android/RasterWindowContext_android.cpp",
2017 "tools/sk_app/android/Window_android.cpp",
2018 "tools/sk_app/android/main_android.cpp",
2019 "tools/sk_app/android/surface_glue_android.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002020 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002021 libs += [ "android" ]
2022 } else if (is_linux) {
2023 sources += [
2024 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2025 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2026 "tools/sk_app/unix/Window_unix.cpp",
2027 "tools/sk_app/unix/keysym2ucs.c",
2028 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002029 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002030 libs += [
2031 "GL",
2032 "X11",
2033 ]
2034 } else if (is_win) {
2035 sources += [
2036 "tools/sk_app/win/GLWindowContext_win.cpp",
2037 "tools/sk_app/win/RasterWindowContext_win.cpp",
2038 "tools/sk_app/win/Window_win.cpp",
2039 "tools/sk_app/win/main_win.cpp",
2040 ]
Brian Salomon194db172017-08-17 14:37:06 -04002041 if (skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002042 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002043 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002044 } else if (is_mac) {
2045 sources += [
2046 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2047 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2048 "tools/sk_app/mac/Window_mac.cpp",
2049 "tools/sk_app/mac/main_mac.cpp",
2050 ]
2051 libs += [
2052 "QuartzCore.framework",
2053 "Cocoa.framework",
2054 "Foundation.framework",
2055 ]
2056 } else if (is_ios) {
2057 sources += [
2058 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2059 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2060 "tools/sk_app/ios/Window_ios.cpp",
2061 "tools/sk_app/ios/main_ios.cpp",
2062 ]
2063 }
2064
2065 if (skia_use_vulkan) {
2066 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
2067 if (is_android) {
2068 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2069 } else if (is_linux) {
2070 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2071 libs += [ "X11-xcb" ]
2072 } else if (is_win) {
2073 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2074 }
2075 }
2076
2077 deps = [
2078 ":gpu_tool_utils",
2079 ":skia",
2080 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002081 ]
2082 if (is_android) {
2083 deps += [ "//third_party/native_app_glue" ]
2084 } else if (is_mac || is_ios) {
2085 deps += [ "//third_party/libsdl" ]
2086 }
2087 if (skia_use_angle) {
2088 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002089 }
Brian Osman16adfa32016-10-18 14:42:44 -04002090 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002091
Brian Osmanc9a42472018-05-31 13:17:12 -04002092 test_app("viewer") {
2093 is_shared_library = is_android
2094 if (is_ios) {
2095 bundle_ios_data = true
Brian Osmaneff04b52017-11-21 13:18:02 -05002096 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002097 sources = [
2098 "tools/viewer/BisectSlide.cpp",
2099 "tools/viewer/GMSlide.cpp",
2100 "tools/viewer/ImGuiLayer.cpp",
2101 "tools/viewer/ImageSlide.cpp",
2102 "tools/viewer/SKPSlide.cpp",
2103 "tools/viewer/SampleSlide.cpp",
2104 "tools/viewer/SkottieSlide.cpp",
2105 "tools/viewer/SlideDir.cpp",
2106 "tools/viewer/StatsLayer.cpp",
2107 "tools/viewer/SvgSlide.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002108 "tools/viewer/TouchGesture.cpp",
Leon Scroggins III81886e82018-08-22 11:18:08 -04002109 "tools/viewer/TouchGesture.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002110 "tools/viewer/Viewer.cpp",
2111 ]
2112 libs = []
2113
2114 include_dirs = []
2115 deps = [
2116 ":experimental_svg_model",
2117 ":flags",
2118 ":gm",
2119 ":gpu_tool_utils",
2120 ":samples",
2121 ":sk_app",
2122 ":skia",
2123 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002124 "modules/skottie",
2125 "modules/sksg",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002126 "modules/sksg:samples",
Brian Osmanc9a42472018-05-31 13:17:12 -04002127 "//third_party/imgui",
Brian Osmanc9a42472018-05-31 13:17:12 -04002128 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04002129
2130 # NIMA does not build on Windows clang
2131 if (!is_win || !is_clang) {
2132 sources += [ "tools/viewer/NIMASlide.cpp" ]
2133 deps += [ "//third_party/Nima-Cpp" ]
2134 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002135 }
2136
ziadbbceddbc2018-06-19 13:57:15 -04002137 if (is_android) {
2138 test_app("arcore") {
2139 is_shared_library = true
2140 configs = [
2141 ":skia_public",
2142 "gn:default",
2143 ]
2144
2145 # For internship expedience, yes, we're rebuilding Skia rather than depending on :skia.
2146 # At the moment there's no way to use Skia and Skottie/SkShaper unless they're in the same .so.
2147 sources = []
2148 sources += skia_core_sources
2149 sources += skia_utils_sources
2150 sources += skia_xps_sources
2151 sources += [
2152 "src/android/SkAndroidFrameworkUtils.cpp",
2153 "src/android/SkAnimatedImage.cpp",
2154 "src/android/SkBitmapRegionCodec.cpp",
2155 "src/android/SkBitmapRegionDecoder.cpp",
2156 "src/codec/SkAndroidCodec.cpp",
2157 "src/codec/SkBmpBaseCodec.cpp",
2158 "src/codec/SkBmpCodec.cpp",
2159 "src/codec/SkBmpMaskCodec.cpp",
2160 "src/codec/SkBmpRLECodec.cpp",
2161 "src/codec/SkBmpStandardCodec.cpp",
2162 "src/codec/SkCodec.cpp",
2163 "src/codec/SkCodecImageGenerator.cpp",
2164 "src/codec/SkColorTable.cpp",
2165 "src/codec/SkGifCodec.cpp",
2166 "src/codec/SkMaskSwizzler.cpp",
2167 "src/codec/SkMasks.cpp",
2168 "src/codec/SkSampledCodec.cpp",
2169 "src/codec/SkSampler.cpp",
2170 "src/codec/SkStreamBuffer.cpp",
2171 "src/codec/SkSwizzler.cpp",
2172 "src/codec/SkWbmpCodec.cpp",
2173 "src/images/SkImageEncoder.cpp",
2174 "src/ports/SkDiscardableMemory_none.cpp",
2175 "src/ports/SkImageGenerator_skia.cpp",
2176 "src/ports/SkMemory_malloc.cpp",
2177 "src/ports/SkOSFile_stdio.cpp",
2178 "src/sfnt/SkOTTable_name.cpp",
2179 "src/sfnt/SkOTUtils.cpp",
2180 "src/utils/mac/SkStream_mac.cpp",
2181 "third_party/gif/SkGifImageReader.cpp",
2182 ]
2183 deps = [
2184 ":tool_utils",
2185 "modules/skottie",
2186 "modules/skshaper",
2187 ]
2188 }
2189 }
2190
Brian Osmanc9a42472018-05-31 13:17:12 -04002191 if (!skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002192 test_app("HelloWorld") {
2193 sources = [
2194 "example/HelloWorld.cpp",
2195 ]
2196 libs = []
2197
2198 include_dirs = []
2199 deps = [
2200 ":flags",
2201 ":gpu_tool_utils",
2202 ":sk_app",
2203 ":skia",
2204 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002205 ]
2206 }
2207 }
2208
Brian Osmanc9a42472018-05-31 13:17:12 -04002209 if (is_linux || is_mac || is_ios) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002210 test_app("SkiaSDLExample") {
2211 sources = [
2212 "example/SkiaSDLExample.cpp",
2213 ]
2214 libs = []
2215 include_dirs = []
2216 deps = [
2217 ":gpu_tool_utils",
2218 ":skia",
2219 "//third_party/libsdl",
2220 ]
2221 }
2222 }
2223
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002224 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2225 action_foreach("generate_mocs") {
2226 script = "gn/call.py"
2227 sources = [
2228 "tools/mdbviz/MainWindow.h",
2229 ]
2230 outputs = [
2231 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2232 ]
2233 args = [
2234 "$skia_qt_path" + "/bin/moc",
2235 "{{source}}",
2236 "-o",
2237 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2238 ]
2239 }
2240 action_foreach("generate_resources") {
2241 script = "gn/call.py"
2242 sources = [
2243 "tools/mdbviz/resources.qrc",
2244 ]
2245 outputs = [
2246 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2247 ]
2248 args = [
2249 "$skia_qt_path" + "/bin/rcc",
2250 "{{source}}",
2251 "-o",
2252 "gen/mdbviz/{{source_name_part}}_res.cpp",
2253 ]
2254 }
2255 test_app("mdbviz") {
2256 if (is_win) {
2257 # on Windows we need to disable some exception handling warnings due to the Qt headers
2258 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2259 }
2260 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002261 "tools/UrlDataManager.cpp",
2262 "tools/debugger/SkDebugCanvas.cpp",
2263 "tools/debugger/SkDrawCommand.cpp",
2264 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002265 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002266 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002267 "tools/mdbviz/main.cpp",
2268
2269 # generated files
2270 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2271 "$target_gen_dir/mdbviz/resources_res.cpp",
2272 ]
2273 lib_dirs = [ "$skia_qt_path/lib" ]
2274 libs = [
2275 "Qt5Core.lib",
2276 "Qt5Gui.lib",
2277 "Qt5Widgets.lib",
2278 ]
2279 include_dirs = [
2280 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002281 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002282 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002283 "tools",
2284 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002285 ]
2286 deps = [
2287 ":generate_mocs",
2288 ":generate_resources",
2289 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002290 "//third_party/jsoncpp",
2291 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002292 ]
2293 }
2294 }
2295
Mike Kleine459afd2017-03-03 09:21:30 -05002296 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002297 copy("gdbserver") {
2298 sources = [
2299 "$ndk/$ndk_gdbserver",
2300 ]
2301 outputs = [
2302 "$root_out_dir/gdbserver",
2303 ]
2304 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002305 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002306
2307 if (skia_use_opencl) {
2308 test_app("hello-opencl") {
2309 sources = [
2310 "src/compute/common/cl/assert_cl.c",
2311 "src/compute/common/cl/find_cl.c",
2312 "tools/hello-opencl.cpp",
2313 ]
2314 include_dirs = [ "src/compute/common" ]
Ben Wagner30a4e3d2018-08-07 16:58:15 -04002315 if (is_linux) {
2316 libs = [ "OpenCL" ]
2317 } else if (is_win) {
2318 libs = [ "OpenCL.lib" ]
2319 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002320 }
2321 }
mtklein25c81d42016-07-27 13:55:26 -07002322}