blob: 6d141cabc216dc7d2ec5c45284e6aa1c8465b1b3 [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 = ""
Kevin Lubick93faa672018-10-10 15:54:53 -040037 skia_enable_ccpr = true
Kevin Lubick4bf2c262018-10-15 09:35:54 -040038 skia_enable_nvpr = true
Brian Osman3f375d02016-12-28 11:19:22 -050039 skia_enable_discrete_gpu = true
Mike Kleina04bb452017-02-09 12:24:07 -050040 skia_enable_effects = true
Mike Reed0917fad2018-06-19 10:17:30 -040041 skia_enable_effects_imagefilters = true
Brian Osmanf2c90142017-07-13 15:50:03 -040042 skia_enable_flutter_defines = false
Hal Canaryff2742e2018-01-30 11:35:47 -050043 skia_enable_fontmgr_empty = false
Brian Osman74511012018-04-02 20:13:46 +000044 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050045 skia_enable_pdf = true
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040046 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050047 skia_enable_tools = is_skia_dev_build
48 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Danielda16cce2018-08-01 09:23:57 -040049 skia_vulkan_header = "" # temporary as we remove the use from clients
Robert Phillipsa6d2d702017-09-01 12:17:03 -040050 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040051 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070052 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070053 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040054
Hal Canary4689b542018-01-31 11:54:14 -050055 skia_skqp_enable_driver_correctness_workarounds = false
Hal Canary2331c822018-02-01 14:06:13 -050056 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040057
58 skia_llvm_path = ""
59 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040060
61 skia_tools_require_resources = false
mtkleinc04ff472016-06-23 10:29:30 -070062}
Brian Salomon23d73ea2016-10-27 13:31:37 -040063declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040064 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040065 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050066 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Mike Klein10d665d2016-11-01 11:46:10 -040067
Mike Klein4d598a32016-10-31 13:44:49 -040068 if (is_android) {
69 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070070 } else if (is_fuchsia) {
71 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040072 } else {
Greg Daniel91dfa3b2018-05-22 13:25:15 -040073 skia_use_vulkan = (defined(skia_vulkan_sdk) && skia_vulkan_sdk != "") ||
74 (defined(skia_moltenvk_path) && skia_moltenvk_path != "")
Mike Klein4d598a32016-10-31 13:44:49 -040075 }
Jim Van Verth4e502972017-12-07 15:16:10 -050076
77 if (is_ios) {
78 skia_ios_identity = ".*Google.*"
79 skia_ios_profile = "Google Development"
80 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040081}
Brian Salomon789e25e2016-09-30 13:41:03 -040082
Adam Barth54ef74a2017-10-13 10:59:38 -070083if (defined(skia_settings)) {
84 import(skia_settings)
85}
86
Brian Osmanc9a42472018-05-31 13:17:12 -040087# Our tools require static linking (they use non-exported symbols), and the GPU backend.
88skia_enable_tools = skia_enable_tools && !is_component_build && skia_enable_gpu
mtklein06c35c02016-09-20 12:28:12 -070089
mtkleina45be612016-08-29 15:22:10 -070090fontmgr_android_enabled = skia_use_expat && skia_use_freetype
91
mtklein1211e0c2016-07-26 13:55:45 -070092skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070093 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070094 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070095 "include/codec",
96 "include/config",
97 "include/core",
Hal Canary23564b92018-09-07 14:33:14 -040098 "include/docs",
mtklein1211e0c2016-07-26 13:55:45 -070099 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -0400100 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -0700101 "include/gpu",
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500102 "include/atlastext",
mtklein1211e0c2016-07-26 13:55:45 -0700103 "include/pathops",
104 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -0700105 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700106 "include/utils",
107 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700108]
109
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500110if (skia_enable_atlas_text) {
111 skia_public_includes += [ "include/atlastext" ]
112}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000113
mtkleinc04ff472016-06-23 10:29:30 -0700114# Skia public API, generally provided by :skia.
115config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700116 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -0400117 defines = []
118 if (is_component_build) {
119 defines += [ "SKIA_DLL" ]
120 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400121 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700122 defines += [ "SK_SAMPLES_FOR_X" ]
123 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400124 if (skia_enable_flutter_defines) {
125 defines += flutter_defines
Kevin Lubickf4def342018-10-04 12:52:50 -0400126
127 # Flutter always wants this https://github.com/flutter/flutter/issues/11402
128 defines += [ "SK_ENABLE_DUMP_GPU" ]
Brian Osmanf2c90142017-07-13 15:50:03 -0400129 }
mtklein06c35c02016-09-20 12:28:12 -0700130 if (!skia_enable_gpu) {
131 defines += [ "SK_SUPPORT_GPU=0" ]
132 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500133 if (skia_enable_atlas_text) {
134 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
135 }
mtkleinc04ff472016-06-23 10:29:30 -0700136}
137
138# Skia internal APIs, used by Skia itself and a few test tools.
139config("skia_private") {
140 visibility = [ ":*" ]
141
142 include_dirs = [
143 "include/private",
144 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700145 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700146 "src/core",
147 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700148 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700149 "src/image",
150 "src/images",
151 "src/lazy",
152 "src/opts",
153 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700154 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700155 "src/ports",
156 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400157 "src/shaders",
158 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700159 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700160 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700161 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500162 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700163 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700164 ]
mtklein150d1132016-08-01 06:56:40 -0700165
Mike Reeda9e241d2017-05-03 10:52:00 -0400166 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700167 if (is_android) {
168 defines += [
169 "SK_GAMMA_EXPONENT=1.4",
170 "SK_GAMMA_CONTRAST=0.0",
171 ]
172 }
mtklein88a7ac02016-09-14 11:16:49 -0700173 if (is_official_build || is_android) {
174 # TODO(bsalomon): it'd be nice to make Android normal.
175 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
176 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400177 libs = []
178 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500179 if (skia_enable_gpu) {
180 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500181 if (is_skia_dev_build && skia_use_vulkan) {
182 include_dirs += [ "tools/gpu/vk" ]
183 }
Brian Salomon03e05842017-02-23 12:23:47 -0500184 }
Brian Osman34755e22016-12-05 09:46:02 -0500185 if (skia_use_angle) {
186 defines += [ "SK_ANGLE" ]
187 }
Brian Osman3f375d02016-12-28 11:19:22 -0500188 if (skia_enable_discrete_gpu) {
189 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
190 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400191 if (!is_official_build) {
192 defines += [ "GR_TEST_UTILS=1" ]
193 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400194 if (skia_llvm_path != "") {
195 defines += [ "SK_LLVM_AVAILABLE" ]
196 include_dirs += [ "$skia_llvm_path/include" ]
197 libs += [ skia_llvm_lib ]
198 lib_dirs += [ "$skia_llvm_path/lib/" ]
199 }
mtkleinc04ff472016-06-23 10:29:30 -0700200}
201
202# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
203config("skia_library") {
204 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700205 defines = [ "SKIA_IMPLEMENTATION=1" ]
206}
207
208skia_library_configs = [
209 ":skia_public",
210 ":skia_private",
211 ":skia_library",
212]
213
mtklein9b8583d2016-08-24 17:32:30 -0700214# Use for CPU-specific Skia code that needs particular compiler flags.
215template("opts") {
216 if (invoker.enabled) {
217 source_set(target_name) {
218 forward_variables_from(invoker, "*")
219 configs += skia_library_configs
220 }
221 } else {
222 # If not enabled, a phony empty target that swallows all otherwise unused variables.
223 source_set(target_name) {
224 forward_variables_from(invoker,
225 "*",
226 [
227 "sources",
228 "cflags",
229 ])
230 }
231 }
anmittala7eaf2e2016-08-17 13:57:26 -0700232}
233
mtklein422310d2016-08-16 18:28:43 -0700234is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700235
mtklein7d6fb2c2016-08-25 14:50:44 -0700236opts("none") {
237 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700238 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700239 cflags = []
240}
241
mtklein7d6fb2c2016-08-25 14:50:44 -0700242opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700243 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700244 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700245 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700246}
247
248opts("arm64") {
249 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700250 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700251 cflags = []
252}
253
254opts("crc32") {
255 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700256 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700257 cflags = [ "-march=armv8-a+crc" ]
258}
259
mtklein9b8583d2016-08-24 17:32:30 -0700260opts("sse2") {
261 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700262 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400263 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400264 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
265 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400266 cflags = [ "-msse2" ]
267 }
mtklein9b8583d2016-08-24 17:32:30 -0700268}
mtkleinc04ff472016-06-23 10:29:30 -0700269
mtklein9b8583d2016-08-24 17:32:30 -0700270opts("ssse3") {
271 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700272 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400273 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400274 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
275 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400276 cflags = [ "-mssse3" ]
277 }
mtklein9b8583d2016-08-24 17:32:30 -0700278}
mtkleinc04ff472016-06-23 10:29:30 -0700279
mtklein9b8583d2016-08-24 17:32:30 -0700280opts("sse41") {
281 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700282 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400283 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400284 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
285 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400286 cflags = [ "-msse4.1" ]
287 }
mtklein9b8583d2016-08-24 17:32:30 -0700288}
mtklein4e976072016-08-08 09:06:27 -0700289
mtklein9b8583d2016-08-24 17:32:30 -0700290opts("sse42") {
291 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700292 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400293 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400294 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
295 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400296 cflags = [ "-msse4.2" ]
297 }
mtklein9b8583d2016-08-24 17:32:30 -0700298}
299
300opts("avx") {
301 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700302 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400303 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000304 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400305 } else {
306 cflags = [ "-mavx" ]
307 }
mtkleinc04ff472016-06-23 10:29:30 -0700308}
309
Mike Klein1b9b7d52018-02-27 10:37:40 -0500310opts("hsw") {
311 enabled = is_x86
312 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400313 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500314 cflags = [ "/arch:AVX2" ]
315 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000316 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500317 }
318
319 # Oddly, clang-cl doesn't recognize this as a valid flag.
320 # If it ever does, it'd nice to move this up with -mavx2 and co.
321 if (is_clang && !is_win) {
322 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
323 # but nice to have, generating slightly better code for paths without explicit FMAs.
324 cflags += [ "-ffp-contract=fast" ]
325 }
326}
327
mtkleinc095df52016-08-24 12:23:52 -0700328# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700329template("optional") {
330 if (invoker.enabled) {
331 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700332 if (defined(invoker.public_defines)) {
333 defines = invoker.public_defines
334 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600335 if (defined(invoker.public_configs)) {
336 configs = invoker.public_configs
337 }
mtklein457b42a2016-08-23 13:56:37 -0700338 }
339 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700340 forward_variables_from(invoker,
341 "*",
342 [
343 "public_defines",
344 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700345 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700346 ])
mtklein457b42a2016-08-23 13:56:37 -0700347 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700348 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700349 if (defined(invoker.configs_to_remove)) {
350 configs -= invoker.configs_to_remove
351 }
mtklein457b42a2016-08-23 13:56:37 -0700352 }
353 } else {
mtklein457b42a2016-08-23 13:56:37 -0700354 source_set(target_name) {
355 forward_variables_from(invoker,
356 "*",
357 [
358 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400359 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700360 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700361 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700362 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700363 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700364 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700365 ])
mtkleincd01b032016-08-31 04:58:19 -0700366 if (defined(invoker.sources_when_disabled)) {
367 sources = invoker.sources_when_disabled
368 }
369 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700370 }
mtkleineb3c4252016-08-23 07:38:09 -0700371 }
mtklein457b42a2016-08-23 13:56:37 -0700372}
mtklein457b42a2016-08-23 13:56:37 -0700373
Mike Kleina04bb452017-02-09 12:24:07 -0500374optional("effects") {
375 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400376 deps = [
377 ":compile_processors",
378 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500379 sources =
380 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
Mike Reed0917fad2018-06-19 10:17:30 -0400381 if (skia_enable_effects_imagefilters) {
382 sources += skia_effects_imagefilter_sources
383 } else {
384 sources += [ "src/ports/SkGlobalInitialization_none_imagefilters.cpp" ]
385 }
386 sources_when_disabled = [
387 "src/ports/SkGlobalInitialization_none.cpp",
388 "src/ports/SkGlobalInitialization_none_imagefilters.cpp",
389 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500390}
391
mtkleina45be612016-08-29 15:22:10 -0700392optional("fontmgr_android") {
393 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700394
395 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500396 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700397 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700398 ]
399 sources = [
400 "src/ports/SkFontMgr_android.cpp",
401 "src/ports/SkFontMgr_android_factory.cpp",
402 "src/ports/SkFontMgr_android_parser.cpp",
403 ]
404}
405
mtkleind2e39db2016-09-07 07:52:55 -0700406optional("fontmgr_custom") {
Kevin Lubick217056c2018-09-20 17:39:31 -0400407 enabled = (is_linux || target_cpu == "wasm") && skia_use_freetype &&
408 !skia_use_fontconfig
mtkleind2e39db2016-09-07 07:52:55 -0700409
410 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500411 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700412 ]
413 sources = [
414 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500415 "src/ports/SkFontMgr_custom.h",
416 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700417 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500418 "src/ports/SkFontMgr_custom_embedded.cpp",
419 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700420 ]
421}
422
Hal Canaryff2742e2018-01-30 11:35:47 -0500423optional("fontmgr_empty") {
424 enabled = skia_enable_fontmgr_empty
425 sources = [
426 "src/ports/SkFontMgr_empty_factory.cpp",
427 ]
428}
429
mtklein3cc22182016-08-29 13:26:14 -0700430optional("fontmgr_fontconfig") {
431 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700432
433 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500434 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700435 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700436 ]
437 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700438 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700439 "src/ports/SkFontConfigInterface_direct.cpp",
440 "src/ports/SkFontConfigInterface_direct_factory.cpp",
441 "src/ports/SkFontMgr_FontConfigInterface.cpp",
442 "src/ports/SkFontMgr_fontconfig.cpp",
443 "src/ports/SkFontMgr_fontconfig_factory.cpp",
444 ]
445}
446
mtkleincdedd0e2016-09-12 15:15:44 -0700447optional("fontmgr_fuchsia") {
448 enabled = is_fuchsia && skia_use_freetype
449
450 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500451 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700452 ]
453 sources = [
454 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500455 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700456 "src/ports/SkFontMgr_custom_empty_factory.cpp",
457 ]
458}
459
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700460if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400461 executable("sksllex") {
462 sources = [
463 "src/sksl/lex/Main.cpp",
464 "src/sksl/lex/NFA.cpp",
465 "src/sksl/lex/RegexNode.cpp",
466 "src/sksl/lex/RegexParser.cpp",
467 ]
468 include_dirs = [ "src/sksl/lex" ]
469 }
470
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700471 action("run_sksllex") {
472 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400473 deps = [
474 ":sksllex(//gn/toolchain:$host_toolchain)",
475 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700476 sources = [
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700477 "src/sksl/lex/sksl.lex",
478 ]
479
480 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
481 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
482 outputs = [
483 "$target_out_dir/" +
484 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
485 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
486 # confused due to the same file being named by two different paths
487 ]
488 sksllex_path = "$root_out_dir/"
489 sksllex_path += "sksllex"
490 if (host_os == "win") {
491 sksllex_path += ".exe"
492 }
493 args = [
494 rebase_path(sksllex_path),
495 rebase_path("bin/clang-format"),
496 rebase_path("src"),
497 ]
498 }
499} else {
500 group("run_sksllex") {
501 }
502}
503
504if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400505 executable("skslc") {
506 defines = [ "SKSL_STANDALONE" ]
507 sources = [
508 "src/sksl/SkSLMain.cpp",
509 ]
510 sources += skia_sksl_sources
511 include_dirs = [
512 "src/gpu",
513 "src/sksl",
514 ]
515 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500516 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400517 "//third_party/spirv-tools",
518 ]
519 }
520
521 skia_gpu_processor_outputs = []
522 foreach(src, skia_gpu_processor_sources) {
523 dir = get_path_info(src, "dir")
524 name = get_path_info(src, "name")
525
526 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
527 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
528 skia_gpu_processor_outputs += [
529 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
530 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
531 # confused due to the same file being named by two different paths
532 ]
533 }
534
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500535 action("create_sksl_enums") {
536 script = "gn/create_sksl_enums.py"
537 sources = [
538 "include/private/GrSharedEnums.h",
539 ]
540 outputs = [
541 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500542 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500543 ]
544 args = [
545 rebase_path(sources[0]),
546 rebase_path(outputs[0]),
547 ]
548 }
549
Ethan Nicholas762466e2017-06-29 10:03:38 -0400550 action("compile_processors") {
551 script = "gn/compile_processors.py"
552 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500553 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400554 ":skslc(//gn/toolchain:$host_toolchain)",
555 ]
556 sources = skia_gpu_processor_sources
557 outputs = skia_gpu_processor_outputs
558 skslc_path = "$root_out_dir/"
559 if (host_toolchain != default_toolchain_name) {
560 skslc_path += "$host_toolchain/"
561 }
562 skslc_path += "skslc"
563 if (host_os == "win") {
564 skslc_path += ".exe"
565 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400566 args = [
567 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400568 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400569 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400570 args += rebase_path(skia_gpu_processor_sources)
571 }
572} else {
573 skia_gpu_processor_outputs = []
574 group("compile_processors") {
575 }
576}
577
mtklein06c35c02016-09-20 12:28:12 -0700578optional("gpu") {
579 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400580 deps = [
581 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700582 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400583 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700584 if (skia_generate_workarounds) {
585 deps += [ ":workaround_list" ]
586 }
mtkleine9fb3d52016-09-20 15:11:46 -0700587 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600588 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400589 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700590
Brian Salomon3d6801e2017-12-11 10:06:31 -0500591 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400592 if (!skia_enable_ccpr) {
593 sources -= skia_ccpr_sources
594 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
595 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400596 if (!skia_enable_nvpr) {
597 sources -= skia_nvpr_sources
598 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
599 }
mtklein06c35c02016-09-20 12:28:12 -0700600
601 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500602 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700603 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400604 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700605 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400606 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400607
608 # this lib is required to link against AHardwareBuffer
609 if (defined(ndk_api) && ndk_api >= 26) {
610 libs += [ "android" ]
611 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400612 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500613 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400614 libs += [ "EGL" ]
Chinmay Garded92d0352018-09-17 10:23:28 -0700615 } else if (is_linux && skia_use_x11) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500616 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -0400617 libs += [ "GL" ]
mtklein06c35c02016-09-20 12:28:12 -0700618 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500619 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800620 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500621 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400622 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500623 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400624 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700625 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500626 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700627 }
mtkleine9fb3d52016-09-20 15:11:46 -0700628
629 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400630 public_defines += [ "SK_VULKAN" ]
Greg Daniel18dbfd02018-05-29 10:46:51 -0400631 deps += [ "third_party/vulkanmemoryallocator" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700632 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700633 if (skia_enable_vulkan_debug_layers) {
634 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
635 }
mtkleine9fb3d52016-09-20 15:11:46 -0700636 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400637
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400638 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400639 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400640 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
641 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400642
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400643 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400644 if (skia_use_metal) {
645 public_defines += [ "SK_METAL" ]
646 sources += skia_metal_sources
647 libs += [ "Metal.framework" ]
Greg Daniel53956d92018-08-08 14:41:19 -0400648 libs += [ "Foundation.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400649 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400650 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500651
652 if (skia_enable_atlas_text) {
653 sources += skia_atlas_text_sources
654 }
Kevin Lubickf4def342018-10-04 12:52:50 -0400655
656 if (is_debug) {
657 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
658 }
mtklein06c35c02016-09-20 12:28:12 -0700659}
660
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400661optional("heif") {
662 enabled = skia_use_libheif
663 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
664
665 deps = []
666
667 sources = [
668 "src/codec/SkHeifCodec.cpp",
669 ]
670}
671
mtklein63213812016-08-24 09:55:56 -0700672optional("jpeg") {
673 enabled = skia_use_libjpeg_turbo
674 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
675
mtklein63213812016-08-24 09:55:56 -0700676 deps = [
677 "//third_party/libjpeg-turbo:libjpeg",
678 ]
Mike Kleinf105dc72018-06-05 15:22:54 -0400679 public = [
680 "include/encode/SkJpegEncoder.h",
681 ]
mtklein63213812016-08-24 09:55:56 -0700682 sources = [
683 "src/codec/SkJpegCodec.cpp",
684 "src/codec/SkJpegDecoderMgr.cpp",
685 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700686 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400687 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700688 ]
689}
690
691optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500692 enabled = skia_use_zlib && skia_enable_pdf
693 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700694
mtklein63213812016-08-24 09:55:56 -0700695 deps = [
696 "//third_party/zlib",
697 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400698 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700699 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400700 }
brettwb9447282016-09-01 14:24:39 -0700701 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700702 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700703
704 if (skia_use_sfntly) {
705 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500706 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700707 }
708}
709
710optional("png") {
711 enabled = skia_use_libpng
712 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
713
mtklein63213812016-08-24 09:55:56 -0700714 deps = [
715 "//third_party/libpng",
716 ]
717 sources = [
718 "src/codec/SkIcoCodec.cpp",
719 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400720 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700721 ]
722}
723
scroggof84ad642016-10-31 09:02:57 -0700724optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400725 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700726 public_defines = [ "SK_CODEC_DECODES_RAW" ]
727
728 deps = [
729 "//third_party/dng_sdk",
730 "//third_party/libjpeg-turbo:libjpeg",
731 "//third_party/piex",
732 ]
733
734 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
735 # Skia.
736 configs_to_remove = [ "//gn:no_exceptions" ]
737
738 sources = [
739 "src/codec/SkRawAdapterCodec.cpp",
740 "src/codec/SkRawCodec.cpp",
741 ]
742}
743
Mike Klein852a8cb2018-05-15 10:46:58 -0400744import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -0400745source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -0400746 cflags = []
747 if (!is_win || is_clang) {
748 cflags += [
749 "-w",
750 "-std=c11",
751 ]
752 }
753
754 public = [
755 "third_party/skcms/skcms.h",
756 ]
757 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
758}
759
mtklein3cc22182016-08-29 13:26:14 -0700760optional("typeface_freetype") {
761 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700762
763 deps = [
764 "//third_party/freetype2",
765 ]
766 sources = [
767 "src/ports/SkFontHost_FreeType.cpp",
768 "src/ports/SkFontHost_FreeType_common.cpp",
769 ]
770}
771
mtklein457b42a2016-08-23 13:56:37 -0700772optional("webp") {
773 enabled = skia_use_libwebp
774 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
775
mtklein457b42a2016-08-23 13:56:37 -0700776 deps = [
777 "//third_party/libwebp",
778 ]
779 sources = [
780 "src/codec/SkWebpAdapterCodec.cpp",
781 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400782 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700783 ]
mtkleineb3c4252016-08-23 07:38:09 -0700784}
785
mtklein63213812016-08-24 09:55:56 -0700786optional("xml") {
787 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000788 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700789
mtklein63213812016-08-24 09:55:56 -0700790 deps = [
791 "//third_party/expat",
792 ]
793 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500794 "src/svg/SkSVGCanvas.cpp",
795 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700796 "src/xml/SkDOM.cpp",
797 "src/xml/SkXMLParser.cpp",
798 "src/xml/SkXMLWriter.cpp",
799 ]
800}
801
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700802if (skia_enable_gpu && skia_generate_workarounds) {
803 action("workaround_list") {
804 script = "tools/build_workaround_header.py"
805
806 inputs = [
807 "src/gpu/gpu_workaround_list.txt",
808 ]
809
810 # see comments in skia_compile_processors about out dir path shenanigans.
811 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700812 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700813
814 outputs = [
815 "$root_out_dir/$output_file",
816 ]
817 args = [
818 "--output-file",
819 "$output_file",
820 ]
821
822 foreach(file, inputs) {
823 args += [ rebase_path(file, root_build_dir) ]
824 }
825 }
826}
827
mtkleinc04ff472016-06-23 10:29:30 -0700828component("skia") {
829 public_configs = [ ":skia_public" ]
830 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700831
832 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700833 ":arm64",
834 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700835 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700836 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500837 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700838 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700839 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500840 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700841 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700842 ":fontmgr_fuchsia",
Greg Danielda16cce2018-08-01 09:23:57 -0400843 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400844 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500845 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700846 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700847 ":none",
mtklein63213812016-08-24 09:55:56 -0700848 ":pdf",
849 ":png",
scroggof84ad642016-10-31 09:02:57 -0700850 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500851 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700852 ":sse2",
853 ":sse41",
854 ":sse42",
855 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700856 ":webp",
mtklein63213812016-08-24 09:55:56 -0700857 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700858 ]
859
Chinmay Garde43f115c2016-11-16 15:04:12 -0800860 # This file (and all GN files in Skia) are designed to work with an
861 # empty sources assignment filter; we handle all that explicitly.
862 # We clear the filter here for clients who may have set up a global filter.
863 set_sources_assignment_filter([])
864
mtkleinc04ff472016-06-23 10:29:30 -0700865 sources = []
brettwb9447282016-09-01 14:24:39 -0700866 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700867 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500868 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700869 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400870 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500871 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700872 "src/android/SkBitmapRegionCodec.cpp",
873 "src/android/SkBitmapRegionDecoder.cpp",
874 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400875 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700876 "src/codec/SkBmpCodec.cpp",
877 "src/codec/SkBmpMaskCodec.cpp",
878 "src/codec/SkBmpRLECodec.cpp",
879 "src/codec/SkBmpStandardCodec.cpp",
880 "src/codec/SkCodec.cpp",
881 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -0400882 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -0400883 "src/codec/SkEncodedInfo.cpp",
scroggo19b91532016-10-24 09:03:26 -0700884 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700885 "src/codec/SkMaskSwizzler.cpp",
886 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700887 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700888 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700889 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700890 "src/codec/SkSwizzler.cpp",
891 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700892 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700893 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700894 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700895 "src/ports/SkMemory_malloc.cpp",
896 "src/ports/SkOSFile_stdio.cpp",
897 "src/sfnt/SkOTTable_name.cpp",
898 "src/sfnt/SkOTUtils.cpp",
899 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700900 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700901 ]
brettwb9447282016-09-01 14:24:39 -0700902
mtklein7d6fb2c2016-08-25 14:50:44 -0700903 libs = []
904
mtkleinc04ff472016-06-23 10:29:30 -0700905 if (is_win) {
906 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400907 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700908 "src/ports/SkDebug_win.cpp",
909 "src/ports/SkFontHost_win.cpp",
910 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500911 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700912 "src/ports/SkImageEncoder_WIC.cpp",
913 "src/ports/SkImageGeneratorWIC.cpp",
914 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700915 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700916 "src/ports/SkScalerContext_win_dw.cpp",
917 "src/ports/SkTLS_win.cpp",
918 "src/ports/SkTypeface_win_dw.cpp",
919 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400920 libs += [
921 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500922 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400923 "Ole32.lib",
924 "OleAut32.lib",
925 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500926 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400927 ]
mtkleinc04ff472016-06-23 10:29:30 -0700928 } else {
929 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700930 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700931 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700932 "src/ports/SkTLS_pthread.cpp",
933 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400934 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700935 }
936
mtklein7d6fb2c2016-08-25 14:50:44 -0700937 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500938 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500939 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500940 deps += [ "//third_party/cpu-features" ]
941 }
mtklein06c35c02016-09-20 12:28:12 -0700942 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700943 libs += [
944 "EGL",
945 "GLESv2",
946 "log",
947 ]
948 }
949
Kevin Lubick217056c2018-09-20 17:39:31 -0400950 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -0700951 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400952 if (skia_use_egl) {
953 libs += [ "GLESv2" ]
954 }
mtkleinc04ff472016-06-23 10:29:30 -0700955 }
956
957 if (is_mac) {
958 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700959 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700960 "src/ports/SkFontHost_mac.cpp",
961 "src/ports/SkImageEncoder_CG.cpp",
962 "src/ports/SkImageGeneratorCG.cpp",
963 ]
mtklein09e61f72016-08-23 13:35:28 -0700964 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400965 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
966 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700967 "ApplicationServices.framework",
968 "OpenGL.framework",
969 ]
mtkleinc04ff472016-06-23 10:29:30 -0700970 }
abarth6fc8ff02016-07-15 15:15:15 -0700971
Mike Klein7d302882016-11-03 14:06:31 -0400972 if (is_ios) {
973 sources += [
974 "src/ports/SkDebug_stdio.cpp",
975 "src/ports/SkFontHost_mac.cpp",
976 "src/ports/SkImageEncoder_CG.cpp",
977 "src/ports/SkImageGeneratorCG.cpp",
978 ]
979 libs += [
980 "CoreFoundation.framework",
981 "CoreGraphics.framework",
982 "CoreText.framework",
983 "ImageIO.framework",
984 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400985
986 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
987 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400988 ]
989 }
990
abarth6fc8ff02016-07-15 15:15:15 -0700991 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700992 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700993 }
mtkleinc04ff472016-06-23 10:29:30 -0700994}
995
Kevin Lubickcbcff382018-10-02 09:02:18 -0400996static_library("pathkit") {
997 public_configs = [ ":skia_public" ]
998 configs += skia_library_configs
999
1000 deps = [
1001 ":arm64",
1002 ":armv7",
1003 ":avx",
1004 ":crc32",
1005 ":hsw",
1006 ":none",
1007 ":sse2",
1008 ":sse41",
1009 ":sse42",
1010 ":ssse3",
1011 ]
1012
1013 # This file (and all GN files in Skia) are designed to work with an
1014 # empty sources assignment filter; we handle all that explicitly.
1015 # We clear the filter here for clients who may have set up a global filter.
1016 set_sources_assignment_filter([])
1017
1018 sources = []
1019 sources += skia_pathops_sources
1020 sources += [
1021 "src/core/SkAnalyticEdge.cpp",
1022 "src/core/SkArenaAlloc.cpp",
1023 "src/core/SkCubicMap.cpp",
1024 "src/core/SkEdge.cpp",
1025 "src/core/SkEdgeBuilder.cpp",
1026 "src/core/SkEdgeClipper.cpp",
1027 "src/core/SkGeometry.cpp",
1028 "src/core/SkLineClipper.cpp",
1029 "src/core/SkMallocPixelRef.cpp",
1030 "src/core/SkMath.cpp",
1031 "src/core/SkMatrix.cpp",
1032 "src/core/SkOpts.cpp",
1033 "src/core/SkPaint.cpp",
1034 "src/core/SkPath.cpp",
1035 "src/core/SkPathEffect.cpp",
1036 "src/core/SkPathMeasure.cpp",
1037 "src/core/SkPathRef.cpp",
1038 "src/core/SkPoint.cpp",
1039 "src/core/SkRRect.cpp",
1040 "src/core/SkRect.cpp",
1041 "src/core/SkSemaphore.cpp",
1042 "src/core/SkStream.cpp",
1043 "src/core/SkString.cpp",
1044 "src/core/SkStringUtils.cpp",
1045 "src/core/SkStroke.cpp",
1046 "src/core/SkStrokeRec.cpp",
1047 "src/core/SkStrokerPriv.cpp",
1048 "src/core/SkThreadID.cpp",
1049 "src/core/SkUtils.cpp",
1050 "src/effects/SkDashPathEffect.cpp",
1051 "src/effects/SkTrimPathEffect.cpp",
1052 "src/ports/SkDebug_stdio.cpp",
1053 "src/ports/SkMemory_malloc.cpp",
1054 "src/utils/SkDashPath.cpp",
1055 "src/utils/SkParse.cpp",
1056 "src/utils/SkParsePath.cpp",
1057 "src/utils/SkUTF.cpp",
1058 ]
1059}
1060
mtkleinc095df52016-08-24 12:23:52 -07001061# Targets guarded by skia_enable_tools may use //third_party freely.
1062if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001063 # Used by gn_to_bp.py to list our public include dirs.
1064 source_set("public") {
1065 configs += [ ":skia_public" ]
1066 }
1067
Mike Kleinc36dedf2016-11-18 09:35:28 -05001068 config("skia.h_config") {
1069 include_dirs = [ "$target_gen_dir" ]
1070 }
1071 action("skia.h") {
1072 public_configs = [ ":skia.h_config" ]
1073 skia_h = "$target_gen_dir/skia.h"
1074 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001075
1076 # TODO: would be cool to not hard-code these here, but how?
1077 module_public_includes = [
1078 "modules/sksg/include",
1079 "modules/skottie/include",
1080 ]
1081 args =
1082 [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1083 [ rebase_path(skia_h, root_build_dir) ] +
1084 rebase_path(skia_public_includes) + rebase_path(module_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001085 depfile = "$skia_h.deps"
1086 outputs = [
1087 skia_h,
1088 ]
1089 }
1090
Brian Osmanc9a42472018-05-31 13:17:12 -04001091 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001092 executable("fiddle") {
1093 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001094 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001095 "tools/fiddle/draw.cpp",
1096 "tools/fiddle/fiddle_main.cpp",
1097 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001098
1099 if (skia_use_egl) {
1100 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001101 } else {
1102 sources += [ "tools/fiddle/null_context.cpp" ]
1103 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001104 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001105 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001106 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001107 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001108 ":skia",
1109 ":skia.h",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001110 "modules/skottie",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001111 ]
1112 }
1113 }
1114
Brian Osmanc9a42472018-05-31 13:17:12 -04001115 source_set("public_headers_warnings_check") {
1116 sources = [
1117 "tools/public_headers_warnings_check.cpp",
1118 ]
1119 configs -= [ "//gn:warnings_except_public_headers" ]
1120 deps = [
1121 ":skia",
1122 ":skia.h",
1123 "modules/skottie",
1124 ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001125 }
1126
mtkleinc095df52016-08-24 12:23:52 -07001127 template("test_lib") {
1128 config(target_name + "_config") {
1129 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001130 if (defined(invoker.public_defines)) {
1131 defines = invoker.public_defines
1132 }
mtklein25c81d42016-07-27 13:55:26 -07001133 }
mtkleinc095df52016-08-24 12:23:52 -07001134 source_set(target_name) {
1135 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1136 public_configs = [
1137 ":" + target_name + "_config",
1138 ":skia_private",
1139 ]
1140
1141 if (!defined(deps)) {
1142 deps = []
1143 }
1144 deps += [ ":skia" ]
1145 testonly = true
1146 }
mtklein25c81d42016-07-27 13:55:26 -07001147 }
mtklein25c81d42016-07-27 13:55:26 -07001148
Mike Kleine6682eb2017-01-05 10:54:57 -05001149 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001150 if (is_ios) {
1151 app_name = target_name
1152 gen_path = target_gen_dir
1153
1154 action("${app_name}_generate_info_plist") {
1155 script = "//gn/gen_plist_ios.py"
1156 outputs = [
1157 "$gen_path/${app_name}_Info.plist",
1158 ]
1159 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1160 }
1161
1162 bundle_data("${app_name}_bundle_info_plist") {
1163 public_deps = [
1164 ":${app_name}_generate_info_plist",
1165 ]
1166 sources = [
1167 "$gen_path/${app_name}_Info.plist",
1168 ]
1169 outputs = [
1170 "{{bundle_root_dir}}/Info.plist",
1171 ]
1172 }
1173
Jim Van Verth329c5a62017-11-29 11:42:33 -05001174 bundle_ios_data =
1175 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1176
1177 if (bundle_ios_data) {
1178 has_skps =
1179 "True" == exec_script("//gn/checkdir.py",
1180 [ rebase_path("skps", root_build_dir) ],
1181 "trim string")
1182 bundle_data("${app_name}_bundle_resources") {
1183 sources = [
1184 "resources",
1185 ]
1186 outputs = [
1187 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1188 "{{bundle_resources_dir}}/data/resources",
1189 ]
1190 }
1191
1192 if (has_skps) {
1193 bundle_data("${app_name}_bundle_skps") {
1194 sources = [
1195 "skps",
1196 ]
1197 outputs = [
1198 # Store in same folder as resources
1199 "{{bundle_resources_dir}}/data/skps",
1200 ]
1201 }
1202 }
1203 }
1204
Jim Van Verth443a9132017-11-28 09:45:26 -05001205 executable("${app_name}_generate_executable") {
1206 forward_variables_from(invoker,
1207 "*",
1208 [
1209 "output_name",
1210 "visibility",
1211 "is_shared_library",
1212 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001213 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001214 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001215 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1216 }
1217
1218 bundle_data("${app_name}_bundle_executable") {
1219 public_deps = [
1220 ":${app_name}_generate_executable",
1221 ]
1222 sources = [
1223 "$gen_path/$app_name",
1224 ]
1225 outputs = [
1226 "{{bundle_executable_dir}}/$app_name",
1227 ]
1228 testonly = true
1229 }
1230
1231 create_bundle("$app_name") {
1232 product_type = "com.apple.product-type.application"
1233 testonly = true
1234
1235 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1236 bundle_resources_dir = bundle_root_dir
1237 bundle_executable_dir = bundle_root_dir
1238 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1239
1240 deps = [
1241 ":${app_name}_bundle_executable",
1242 ":${app_name}_bundle_info_plist",
1243 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001244 if (bundle_ios_data) {
1245 deps += [ ":${app_name}_bundle_resources" ]
1246 if (has_skps) {
1247 deps += [ ":${app_name}_bundle_skps" ]
1248 }
1249 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001250
1251 # should only code sign when running on a device, not the simulator
1252 if (target_cpu != "x64") {
1253 code_signing_script = "//gn/codesign_ios.py"
1254 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1255 code_signing_outputs = [
1256 "$bundle_root_dir/_CodeSignature/CodeResources",
1257 "$bundle_root_dir/embedded.mobileprovision",
1258 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001259 code_signing_args = [
1260 rebase_path("$bundle_root_dir", root_build_dir),
1261 skia_ios_identity,
1262 skia_ios_profile,
1263 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001264 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001265 }
1266 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001267 # !is_ios
1268
1269 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1270 shared_library("lib" + target_name) {
1271 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1272 configs += [ ":skia_private" ]
1273 testonly = true
1274 }
1275 } else {
1276 _executable = target_name
1277 executable(_executable) {
1278 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1279 configs += [ ":skia_private" ]
1280 testonly = true
1281 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001282 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001283 if (is_android && skia_android_serial != "" && defined(_executable)) {
1284 action("push_" + target_name) {
1285 script = "gn/push_to_android.py"
1286 deps = [
1287 ":" + _executable,
1288 ]
1289 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1290 outputs = [
1291 _stamp,
1292 ]
1293 args = [
1294 rebase_path("$root_build_dir/$_executable"),
1295 skia_android_serial,
1296 rebase_path(_stamp),
1297 ]
1298 testonly = true
1299 }
Mike Klein7d921032017-01-05 12:20:41 -05001300 }
1301 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001302 }
1303
Greg Danielda16cce2018-08-01 09:23:57 -04001304 config("moltenvk_config") {
1305 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1306 if (is_ios) {
1307 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
1308 } else {
1309 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
1310 }
1311 cflags = [ "-F$moltenvk_framework_path" ]
1312 ldflags = [ "-F$moltenvk_framework_path" ]
1313 libs = [
1314 "MoltenVK.framework",
1315 "Metal.framework",
1316 "IOSurface.framework",
1317 "QuartzCore.framework",
1318 "Foundation.framework",
1319 ]
1320 if (is_ios) {
1321 libs += [ "UIKit.framework" ]
1322 } else {
1323 libs += [ "IOKit.framework" ]
1324 }
1325 defines = [ "SK_MOLTENVK" ]
1326 }
1327 }
1328
1329 source_set("moltenvk") {
1330 public_configs = [ ":moltenvk_config" ]
1331 }
1332
mtkleinc095df52016-08-24 12:23:52 -07001333 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001334 public_include_dirs = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001335 public_defines = []
1336 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001337
Brian Osmanc9a42472018-05-31 13:17:12 -04001338 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001339 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001340 sources = [
1341 "tools/gpu/GrContextFactory.cpp",
1342 "tools/gpu/GrTest.cpp",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001343 "tools/gpu/MemoryCache.cpp",
1344 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001345 "tools/gpu/ProxyUtils.cpp",
1346 "tools/gpu/TestContext.cpp",
1347 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
1348 "tools/gpu/gl/GLTestContext.cpp",
1349 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
Brian Osmanc9a42472018-05-31 13:17:12 -04001350 "tools/gpu/gl/null/NullGLTestContext.cpp",
1351 "tools/gpu/mock/MockTestContext.cpp",
1352 ]
1353 libs = []
1354
1355 if (is_android || skia_use_egl) {
1356 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1357 } else if (is_ios) {
1358 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1359 libs += [ "OpenGLES.framework" ]
1360 } else if (is_linux) {
1361 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina27f2692018-06-20 11:06:39 -04001362 libs += [
1363 "GLU",
1364 "X11",
1365 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001366 } else if (is_mac) {
1367 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
1368 } else if (is_win) {
1369 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1370 libs += [
1371 "Gdi32.lib",
1372 "OpenGL32.lib",
mtklein38925aa2016-09-21 10:11:25 -07001373 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001374 }
mtklein25c81d42016-07-27 13:55:26 -07001375
Brian Osmanc9a42472018-05-31 13:17:12 -04001376 cflags_objcc = [ "-fobjc-arc" ]
mtklein6ef69992016-09-14 06:12:09 -07001377
Brian Osmanc9a42472018-05-31 13:17:12 -04001378 if (skia_use_angle) {
1379 deps += [ "//third_party/angle2" ]
1380 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1381 }
Greg Danielb4d89562018-10-03 18:44:49 +00001382 public_include_dirs += [ "third_party/vulkan" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001383 if (skia_use_vulkan) {
1384 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
1385 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Greg Danielda16cce2018-08-01 09:23:57 -04001386 if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") {
1387 public_deps += [ ":moltenvk" ]
1388 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001389 }
1390 if (skia_use_metal) {
1391 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001392 }
mtklein25c81d42016-07-27 13:55:26 -07001393 }
mtklein25c81d42016-07-27 13:55:26 -07001394
mtkleinc095df52016-08-24 12:23:52 -07001395 test_lib("flags") {
1396 public_include_dirs = [ "tools/flags" ]
1397 sources = [
1398 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001399 ]
1400 }
1401 test_lib("common_flags") {
1402 public_include_dirs = [ "tools/flags" ]
1403 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001404 "tools/flags/SkCommonFlags.cpp",
1405 "tools/flags/SkCommonFlagsConfig.cpp",
1406 ]
1407 deps = [
mtklein046cb562016-09-16 10:23:12 -07001408 ":flags",
Greg Danielda16cce2018-08-01 09:23:57 -04001409 ]
1410 public_deps = [
mtkleinc095df52016-08-24 12:23:52 -07001411 ":gpu_tool_utils",
1412 ]
1413 }
mtklein25c81d42016-07-27 13:55:26 -07001414
mtkleinc095df52016-08-24 12:23:52 -07001415 test_lib("tool_utils") {
1416 public_include_dirs = [
1417 "tools",
1418 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001419 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001420 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001421 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001422 ]
1423 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001424 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001425 "tools/CrashHandler.cpp",
Robert Phillips96601082018-05-29 16:13:26 -04001426 "tools/DDLPromiseImageHelper.cpp",
1427 "tools/DDLTileHelper.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001428 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001429 "tools/ProcStats.cpp",
1430 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001431 "tools/UrlDataManager.cpp",
1432 "tools/debugger/SkDebugCanvas.cpp",
1433 "tools/debugger/SkDrawCommand.cpp",
1434 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001435 "tools/fonts/SkRandomScalerContext.cpp",
Herb Derby33ac15e2018-08-29 12:36:22 -04001436 "tools/fonts/SkTestEmptyTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001437 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001438 "tools/fonts/SkTestFontMgr.h",
1439 "tools/fonts/SkTestSVGTypeface.cpp",
1440 "tools/fonts/SkTestSVGTypeface.h",
1441 "tools/fonts/SkTestTypeface.cpp",
1442 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001443 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001444 "tools/random_parse_path.cpp",
1445 "tools/sk_tool_utils.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001446 "tools/timer/SkAnimTimer.h",
mtkleinc095df52016-08-24 12:23:52 -07001447 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001448 "tools/trace/SkChromeTracingTracer.cpp",
1449 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001450 "tools/trace/SkDebugfTracer.cpp",
1451 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001452 "tools/trace/SkEventTracingPriv.cpp",
1453 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001454 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001455 libs = []
1456 if (is_ios) {
1457 sources += [ "tools/ios_utils.m" ]
1458 libs += [ "Foundation.framework" ]
1459 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001460 defines = []
1461 if (skia_tools_require_resources) {
1462 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1463 }
mtkleinc095df52016-08-24 12:23:52 -07001464 deps = [
Ben Wagner97182cc2018-02-15 10:20:04 -05001465 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001466 ":flags",
1467 "//third_party/libpng",
1468 ]
1469 public_deps = [
Greg Danielda16cce2018-08-01 09:23:57 -04001470 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001471 "//third_party/jsoncpp",
1472 ]
1473 }
mtklein25c81d42016-07-27 13:55:26 -07001474
Mike Klein6e744122016-10-27 12:21:40 -04001475 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001476 test_lib("gm") {
1477 public_include_dirs = [ "gm" ]
1478 sources = gm_sources
1479 deps = [
scroggo19b91532016-10-24 09:03:26 -07001480 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001481 ":skia",
1482 ":tool_utils",
Mike Reed2f0edd52018-05-31 14:22:30 -04001483 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001484 "modules/skottie:gm",
Florin Malita3b526b02018-05-25 12:43:51 -04001485 "modules/sksg",
mtkleinc095df52016-08-24 12:23:52 -07001486 ]
Greg Danielda16cce2018-08-01 09:23:57 -04001487 public_deps = [
1488 ":gpu_tool_utils",
1489 ]
mtkleinc095df52016-08-24 12:23:52 -07001490 }
mtklein25c81d42016-07-27 13:55:26 -07001491
Mike Klein6e744122016-10-27 12:21:40 -04001492 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001493 test_lib("tests") {
1494 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001495 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001496 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001497 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001498 }
Ben Wagner37a06c02018-06-22 21:11:00 +00001499 if (!(skia_use_freetype && skia_use_fontconfig)) {
1500 sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
1501 }
mtkleinc095df52016-08-24 12:23:52 -07001502 deps = [
Hal Canary0f666812018-03-22 15:21:12 -04001503 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001504 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001505 ":skia",
1506 ":tool_utils",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001507 "modules/skottie:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001508 "modules/sksg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001509 "//third_party/libpng",
1510 "//third_party/zlib",
1511 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001512 public_deps = [
1513 ":gpu_tool_utils", # Test.h #includes headers from this target.
1514 ]
mtkleinc095df52016-08-24 12:23:52 -07001515 }
mtklein2f3416d2016-08-02 16:02:05 -07001516
Mike Klein6e744122016-10-27 12:21:40 -04001517 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001518 test_lib("bench") {
1519 public_include_dirs = [ "bench" ]
1520 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001521 deps = [
1522 ":flags",
1523 ":gm",
1524 ":gpu_tool_utils",
1525 ":skia",
1526 ":tool_utils",
1527 ]
1528 }
mtklein2b6870c2016-07-28 14:17:33 -07001529
mtkleinc095df52016-08-24 12:23:52 -07001530 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001531 public_include_dirs = []
1532 if (skia_use_expat) {
1533 public_include_dirs += [ "experimental/svg/model" ]
1534 sources = [
1535 "experimental/svg/model/SkSVGAttribute.cpp",
1536 "experimental/svg/model/SkSVGAttributeParser.cpp",
1537 "experimental/svg/model/SkSVGCircle.cpp",
1538 "experimental/svg/model/SkSVGClipPath.cpp",
1539 "experimental/svg/model/SkSVGContainer.cpp",
1540 "experimental/svg/model/SkSVGDOM.cpp",
1541 "experimental/svg/model/SkSVGEllipse.cpp",
1542 "experimental/svg/model/SkSVGGradient.cpp",
1543 "experimental/svg/model/SkSVGLine.cpp",
1544 "experimental/svg/model/SkSVGLinearGradient.cpp",
1545 "experimental/svg/model/SkSVGNode.cpp",
1546 "experimental/svg/model/SkSVGPath.cpp",
1547 "experimental/svg/model/SkSVGPattern.cpp",
1548 "experimental/svg/model/SkSVGPoly.cpp",
1549 "experimental/svg/model/SkSVGRadialGradient.cpp",
1550 "experimental/svg/model/SkSVGRect.cpp",
1551 "experimental/svg/model/SkSVGRenderContext.cpp",
1552 "experimental/svg/model/SkSVGSVG.cpp",
1553 "experimental/svg/model/SkSVGShape.cpp",
1554 "experimental/svg/model/SkSVGStop.cpp",
1555 "experimental/svg/model/SkSVGTransformableNode.cpp",
1556 "experimental/svg/model/SkSVGUse.cpp",
1557 "experimental/svg/model/SkSVGValue.cpp",
1558 ]
1559 deps = [
1560 ":skia",
1561 ":xml",
1562 ]
1563 }
mtkleinc095df52016-08-24 12:23:52 -07001564 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001565
Mike Klein38af9432016-11-11 11:39:44 -05001566 if (skia_use_lua) {
1567 test_lib("lua") {
1568 public_include_dirs = []
1569 sources = [
1570 "src/utils/SkLua.cpp",
1571 "src/utils/SkLuaCanvas.cpp",
1572 ]
1573 deps = [
Herb Derby264182c2018-05-29 15:53:40 -04001574 "modules/skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001575 "//third_party/lua",
1576 ]
1577 }
1578
Mike Kleine6682eb2017-01-05 10:54:57 -05001579 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001580 sources = [
1581 "tools/lua/lua_app.cpp",
1582 ]
1583 deps = [
1584 ":lua",
1585 ":skia",
1586 "//third_party/lua",
1587 ]
Mike Klein38af9432016-11-11 11:39:44 -05001588 }
1589
Mike Kleine6682eb2017-01-05 10:54:57 -05001590 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001591 sources = [
1592 "tools/lua/lua_pictures.cpp",
1593 ]
1594 deps = [
1595 ":flags",
1596 ":lua",
1597 ":skia",
1598 ":tool_utils",
1599 "//third_party/lua",
1600 ]
Mike Klein38af9432016-11-11 11:39:44 -05001601 }
1602 }
1603
Cary Clark8032b982017-07-28 11:04:54 -04001604 test_app("bookmaker") {
1605 sources = [
1606 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001607 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001608 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001609 "tools/bookmaker/fiddleParser.cpp",
1610 "tools/bookmaker/includeParser.cpp",
1611 "tools/bookmaker/includeWriter.cpp",
1612 "tools/bookmaker/mdOut.cpp",
1613 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001614 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001615 "tools/bookmaker/spellCheck.cpp",
1616 ]
1617 deps = [
1618 ":flags",
1619 ":skia",
1620 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001621 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001622 ]
1623 }
1624
Florin Malitabfe876a2018-09-02 12:33:59 -04001625 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04001626 test_app("skottie_tool") {
1627 deps = [
1628 "modules/skottie:tool",
1629 ]
1630 }
1631 }
1632
Kevin Lubickebf648e2017-09-21 13:45:16 -04001633 if (target_cpu != "wasm") {
1634 import("gn/samples.gni")
1635 test_lib("samples") {
1636 public_include_dirs = [ "samplecode" ]
1637 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001638 sources = samples_sources
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04001639 public_deps = [
1640 ":tool_utils",
1641 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001642 deps = [
1643 ":experimental_svg_model",
1644 ":flags",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001645 ":xml",
Herb Derby264182c2018-05-29 15:53:40 -04001646 "modules/skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001647 ]
Mike Klein38af9432016-11-11 11:39:44 -05001648
Ruiqi Maof5101492018-06-29 14:32:21 -04001649 # NIMA does not build on Windows clang
1650 if (!is_win || !is_clang) {
1651 deps += [ "//third_party/Nima-Cpp" ]
1652 }
1653
Kevin Lubickebf648e2017-09-21 13:45:16 -04001654 if (skia_use_lua) {
1655 sources += [ "samplecode/SampleLua.cpp" ]
1656 deps += [
1657 ":lua",
1658 "//third_party/lua",
1659 ]
1660 }
1661 }
Mike Klein7af351a2018-07-27 09:54:43 -04001662 test_app("imgcvt") {
1663 sources = [
1664 "tools/imgcvt.cpp",
1665 ]
1666 deps = [
1667 ":skcms",
1668 ":skia",
1669 ]
1670 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04001671 test_app("dm") {
1672 sources = [
1673 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001674 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001675 "dm/DMJsonWriter.cpp",
1676 "dm/DMSrcSink.cpp",
1677 ]
1678 include_dirs = [ "tests" ]
1679 deps = [
1680 ":common_flags",
1681 ":experimental_svg_model",
1682 ":flags",
1683 ":gm",
1684 ":gpu_tool_utils",
1685 ":skia",
1686 ":tests",
1687 ":tool_utils",
Florin Malita3d856bd2018-05-26 09:49:28 -04001688 "modules/skottie",
Florin Malita3b526b02018-05-25 12:43:51 -04001689 "modules/sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001690 "//third_party/jsoncpp",
1691 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001692 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04001693
1694 # NIMA does not build on Windows clang
1695 if (!is_win || !is_clang) {
1696 deps += [ "//third_party/Nima-Cpp" ]
1697 }
Mike Klein38af9432016-11-11 11:39:44 -05001698 }
Brian Osman16adfa32016-10-18 14:42:44 -04001699 }
1700
Mike Kleina8a51ce2018-01-09 12:34:11 -05001701 if (!is_win) {
1702 test_app("remote_demo") {
1703 sources = [
1704 "tools/remote_demo.cpp",
1705 ]
1706 deps = [
1707 ":skia",
1708 ]
1709 }
1710 }
1711
Mike Kleine6682eb2017-01-05 10:54:57 -05001712 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001713 sources = [
1714 "bench/nanobench.cpp",
1715 ]
1716 deps = [
1717 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001718 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001719 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001720 ":flags",
1721 ":gm",
1722 ":gpu_tool_utils",
1723 ":skia",
1724 ":tool_utils",
Florin Malita3b526b02018-05-25 12:43:51 -04001725 "modules/sksg",
mtklein2b6870c2016-07-28 14:17:33 -07001726 "//third_party/jsoncpp",
1727 ]
mtklein2b6870c2016-07-28 14:17:33 -07001728 }
halcanary19a97202016-08-03 15:08:04 -07001729
Ravi Mistry10d36c52017-01-31 09:49:18 -05001730 test_app("skpinfo") {
1731 sources = [
1732 "tools/skpinfo.cpp",
1733 ]
1734 deps = [
1735 ":flags",
1736 ":skia",
1737 ]
1738 }
1739
Brian Osmanc9a42472018-05-31 13:17:12 -04001740 test_app("skpbench") {
1741 sources = [
1742 "tools/skpbench/skpbench.cpp",
1743 ]
1744 deps = [
1745 ":flags",
1746 ":gpu_tool_utils",
1747 ":skia",
1748 ":tool_utils",
1749 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07001750 }
1751
Mike Kleine6682eb2017-01-05 10:54:57 -05001752 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001753 sources = [
Herb Derby264182c2018-05-29 15:53:40 -04001754 "tools/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001755 ]
1756 deps = [
1757 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04001758 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001759 ]
halcanary3eee9d92016-09-10 07:01:53 -07001760 }
mtklein046cb562016-09-16 10:23:12 -07001761
Ben Wagner219f3622017-07-17 15:32:25 -04001762 test_app("create_test_font") {
1763 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001764 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001765 ]
1766 deps = [
1767 ":skia",
1768 ]
1769 assert_no_deps = [
1770 # tool_utils requires the output of this app.
1771 ":tool_utils",
1772 ]
1773 }
1774
Florin Malita5d3ff432018-07-31 16:38:43 -04001775 if (skia_use_expat) {
1776 test_app("create_test_font_color") {
1777 sources = [
1778 "tools/fonts/create_test_font_color.cpp",
1779 ]
1780 deps = [
1781 ":flags",
1782 ":skia",
1783 ":tool_utils",
1784 ]
1785 }
Ben Wagner97182cc2018-02-15 10:20:04 -05001786 }
1787
Mike Kleine6682eb2017-01-05 10:54:57 -05001788 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001789 sources = [
1790 "tools/get_images_from_skps.cpp",
1791 ]
1792 deps = [
1793 ":flags",
1794 ":skia",
mtklein046cb562016-09-16 10:23:12 -07001795 ]
mtklein046cb562016-09-16 10:23:12 -07001796 }
mtkleinecbc5262016-09-22 11:51:24 -07001797
Kevin Lubickebf648e2017-09-21 13:45:16 -04001798 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001799 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001800 sources = [
1801 "tools/skiaserve/Request.cpp",
1802 "tools/skiaserve/Response.cpp",
1803 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001804 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1805 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1806 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1807 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1808 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1809 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1810 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1811 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1812 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001813 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1814 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001815 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1816 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1817 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1818 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1819 ]
1820 deps = [
1821 ":flags",
1822 ":gpu_tool_utils",
1823 ":skia",
1824 ":tool_utils",
1825 "//third_party/jsoncpp",
1826 "//third_party/libmicrohttpd",
1827 "//third_party/libpng",
1828 ]
Mike Klein7d302882016-11-03 14:06:31 -04001829 }
mtkleinecbc5262016-09-22 11:51:24 -07001830 }
kjlubick14f984b2016-10-03 11:49:45 -07001831
Mike Kleine6682eb2017-01-05 10:54:57 -05001832 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001833 include_dirs = [
1834 "tools",
1835 "tools/debugger",
1836 ]
kjlubick14f984b2016-10-03 11:49:45 -07001837 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001838 "fuzz/Fuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001839 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001840 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001841 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001842 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001843 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04001844 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001845 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001846 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001847 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04001848 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001849 "fuzz/FuzzRegionOp.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001850 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1851 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001852 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04001853 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001854 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001855 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1856 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001857 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001858 "tools/UrlDataManager.cpp",
1859 "tools/debugger/SkDebugCanvas.cpp",
1860 "tools/debugger/SkDrawCommand.cpp",
1861 "tools/debugger/SkJsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001862 ]
1863 deps = [
1864 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001865 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001866 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04001867 "modules/skottie:fuzz",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001868 "//third_party/jsoncpp",
1869 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001870 ]
kjlubick14f984b2016-10-03 11:49:45 -07001871 }
Mike Klein38312422016-10-05 15:41:01 -04001872
Mike Kleine6682eb2017-01-05 10:54:57 -05001873 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001874 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001875 rebase_path("tests/skia_test.cpp"),
1876 rebase_path("tests/Test.cpp"),
1877 ]
caryclark9feb6322016-10-25 08:58:26 -07001878 deps = [
1879 ":flags",
1880 ":gpu_tool_utils",
1881 ":skia",
1882 ":tool_utils",
1883 ]
caryclark9feb6322016-10-25 08:58:26 -07001884 }
1885
Mike Kleine6682eb2017-01-05 10:54:57 -05001886 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001887 sources = [
1888 "tools/DumpRecord.cpp",
1889 "tools/dump_record.cpp",
1890 ]
1891 deps = [
1892 ":flags",
1893 ":skia",
1894 ]
Mike Klein38312422016-10-05 15:41:01 -04001895 }
bungemanfe917272016-10-13 17:36:40 -04001896
Mike Kleine6682eb2017-01-05 10:54:57 -05001897 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001898 sources = [
1899 "tools/skdiff/skdiff.cpp",
1900 "tools/skdiff/skdiff_html.cpp",
1901 "tools/skdiff/skdiff_main.cpp",
1902 "tools/skdiff/skdiff_utils.cpp",
1903 ]
1904 deps = [
1905 ":skia",
1906 ":tool_utils",
1907 ]
bungemanfe917272016-10-13 17:36:40 -04001908 }
halcanarya73d76a2016-10-17 13:19:02 -07001909
Mike Kleine6682eb2017-01-05 10:54:57 -05001910 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001911 sources = [
1912 "tools/skp_parser.cpp",
1913 ]
1914 deps = [
1915 ":skia",
1916 ":tool_utils",
1917 "//third_party/jsoncpp",
1918 ]
halcanarya73d76a2016-10-17 13:19:02 -07001919 }
Brian Osman16adfa32016-10-18 14:42:44 -04001920
Brian Osmanc9a42472018-05-31 13:17:12 -04001921 if (!is_win) {
Hal Canaryd7b38452017-12-11 17:46:26 -05001922 test_lib("skqp_lib") {
1923 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001924 defines =
1925 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001926 if (skia_skqp_enable_driver_correctness_workarounds) {
1927 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1928 }
Hal Canary75427132017-10-11 16:00:31 -04001929 sources = [
1930 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001931 "tools/skqp/gm_knowledge.cpp",
1932 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001933 ]
1934 deps = [
1935 ":gm",
1936 ":gpu_tool_utils",
1937 ":skia",
1938 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001939 ":tool_utils",
1940 ]
1941 }
1942 test_app("skqp") {
1943 sources = [
1944 "tools/skqp/skqp.cpp",
1945 ]
1946 deps = [
1947 ":skia",
1948 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001949 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001950 "//third_party/googletest",
1951 ]
1952 }
1953 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001954 if (is_android) {
Hal Canary28f89382017-12-12 09:42:14 -05001955 test_app("skqp_app") {
1956 is_shared_library = true
1957 sources = [
1958 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1959 ]
1960 deps = [
1961 ":skia",
1962 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001963 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001964 ]
1965 libs = [ "android" ]
1966 }
1967 }
Stan Iliev93151722018-08-02 11:10:52 -04001968 if (is_android && skia_enable_gpu) {
1969 test_app("skottie_android") {
1970 is_shared_library = true
1971
1972 sources = [
1973 "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp",
1974 "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp",
1975 ]
1976 libs = []
1977
1978 include_dirs = []
1979 deps = [
1980 ":skia",
1981 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04001982 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04001983 ]
1984 }
1985 }
Hal Canary75427132017-10-11 16:00:31 -04001986
Hal Canarya9de7602018-01-19 13:08:23 -05001987 test_app("list_gms") {
1988 sources = [
1989 "tools/list_gms.cpp",
1990 ]
1991 deps = [
1992 ":gm",
1993 ":skia",
1994 ]
1995 }
1996 test_app("list_gpu_unit_tests") {
1997 sources = [
1998 "dm/DMGpuTestProcs.cpp",
1999 "tools/list_gpu_unit_tests.cpp",
2000 ]
2001 deps = [
2002 ":skia",
2003 ":tests",
2004 ]
2005 }
2006
Brian Osmanc9a42472018-05-31 13:17:12 -04002007 test_lib("sk_app") {
2008 public_include_dirs = [ "tools/sk_app" ]
2009 sources = [
2010 "tools/sk_app/CommandSet.cpp",
2011 "tools/sk_app/GLWindowContext.cpp",
2012 "tools/sk_app/Window.cpp",
2013 ]
2014 libs = []
2015
2016 if (is_android) {
2017 sources += [
2018 "tools/sk_app/android/GLWindowContext_android.cpp",
2019 "tools/sk_app/android/RasterWindowContext_android.cpp",
2020 "tools/sk_app/android/Window_android.cpp",
2021 "tools/sk_app/android/main_android.cpp",
2022 "tools/sk_app/android/surface_glue_android.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002023 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002024 libs += [ "android" ]
2025 } else if (is_linux) {
2026 sources += [
2027 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2028 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2029 "tools/sk_app/unix/Window_unix.cpp",
2030 "tools/sk_app/unix/keysym2ucs.c",
2031 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002032 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002033 libs += [
2034 "GL",
2035 "X11",
2036 ]
2037 } else if (is_win) {
2038 sources += [
2039 "tools/sk_app/win/GLWindowContext_win.cpp",
2040 "tools/sk_app/win/RasterWindowContext_win.cpp",
2041 "tools/sk_app/win/Window_win.cpp",
2042 "tools/sk_app/win/main_win.cpp",
2043 ]
Brian Salomon194db172017-08-17 14:37:06 -04002044 if (skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002045 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002046 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002047 } else if (is_mac) {
2048 sources += [
2049 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2050 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2051 "tools/sk_app/mac/Window_mac.cpp",
2052 "tools/sk_app/mac/main_mac.cpp",
2053 ]
2054 libs += [
2055 "QuartzCore.framework",
2056 "Cocoa.framework",
2057 "Foundation.framework",
2058 ]
2059 } else if (is_ios) {
2060 sources += [
2061 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2062 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2063 "tools/sk_app/ios/Window_ios.cpp",
2064 "tools/sk_app/ios/main_ios.cpp",
2065 ]
2066 }
2067
2068 if (skia_use_vulkan) {
2069 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
2070 if (is_android) {
2071 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2072 } else if (is_linux) {
2073 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2074 libs += [ "X11-xcb" ]
2075 } else if (is_win) {
2076 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2077 }
2078 }
2079
2080 deps = [
2081 ":gpu_tool_utils",
2082 ":skia",
2083 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002084 ]
2085 if (is_android) {
2086 deps += [ "//third_party/native_app_glue" ]
2087 } else if (is_mac || is_ios) {
2088 deps += [ "//third_party/libsdl" ]
2089 }
2090 if (skia_use_angle) {
2091 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002092 }
Brian Osman16adfa32016-10-18 14:42:44 -04002093 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002094
Brian Osmanc9a42472018-05-31 13:17:12 -04002095 test_app("viewer") {
2096 is_shared_library = is_android
2097 if (is_ios) {
2098 bundle_ios_data = true
Brian Osmaneff04b52017-11-21 13:18:02 -05002099 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002100 sources = [
2101 "tools/viewer/BisectSlide.cpp",
2102 "tools/viewer/GMSlide.cpp",
2103 "tools/viewer/ImGuiLayer.cpp",
2104 "tools/viewer/ImageSlide.cpp",
2105 "tools/viewer/SKPSlide.cpp",
2106 "tools/viewer/SampleSlide.cpp",
2107 "tools/viewer/SkottieSlide.cpp",
2108 "tools/viewer/SlideDir.cpp",
2109 "tools/viewer/StatsLayer.cpp",
2110 "tools/viewer/SvgSlide.cpp",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002111 "tools/viewer/TouchGesture.cpp",
Leon Scroggins III81886e82018-08-22 11:18:08 -04002112 "tools/viewer/TouchGesture.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002113 "tools/viewer/Viewer.cpp",
2114 ]
2115 libs = []
2116
2117 include_dirs = []
2118 deps = [
2119 ":experimental_svg_model",
2120 ":flags",
2121 ":gm",
2122 ":gpu_tool_utils",
2123 ":samples",
2124 ":sk_app",
2125 ":skia",
2126 ":tool_utils",
Brian Osmanc9a42472018-05-31 13:17:12 -04002127 "modules/skottie",
2128 "modules/sksg",
Ben Wagnerb2c4ea62018-08-08 11:36:17 -04002129 "modules/sksg:samples",
Brian Osmanc9a42472018-05-31 13:17:12 -04002130 "//third_party/imgui",
Brian Osmanc9a42472018-05-31 13:17:12 -04002131 ]
Ruiqi Maof5101492018-06-29 14:32:21 -04002132
2133 # NIMA does not build on Windows clang
2134 if (!is_win || !is_clang) {
2135 sources += [ "tools/viewer/NIMASlide.cpp" ]
2136 deps += [ "//third_party/Nima-Cpp" ]
2137 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002138 }
2139
ziadbbceddbc2018-06-19 13:57:15 -04002140 if (is_android) {
2141 test_app("arcore") {
2142 is_shared_library = true
2143 configs = [
2144 ":skia_public",
2145 "gn:default",
2146 ]
2147
2148 # For internship expedience, yes, we're rebuilding Skia rather than depending on :skia.
2149 # At the moment there's no way to use Skia and Skottie/SkShaper unless they're in the same .so.
2150 sources = []
2151 sources += skia_core_sources
2152 sources += skia_utils_sources
2153 sources += skia_xps_sources
2154 sources += [
2155 "src/android/SkAndroidFrameworkUtils.cpp",
2156 "src/android/SkAnimatedImage.cpp",
2157 "src/android/SkBitmapRegionCodec.cpp",
2158 "src/android/SkBitmapRegionDecoder.cpp",
2159 "src/codec/SkAndroidCodec.cpp",
2160 "src/codec/SkBmpBaseCodec.cpp",
2161 "src/codec/SkBmpCodec.cpp",
2162 "src/codec/SkBmpMaskCodec.cpp",
2163 "src/codec/SkBmpRLECodec.cpp",
2164 "src/codec/SkBmpStandardCodec.cpp",
2165 "src/codec/SkCodec.cpp",
2166 "src/codec/SkCodecImageGenerator.cpp",
2167 "src/codec/SkColorTable.cpp",
2168 "src/codec/SkGifCodec.cpp",
2169 "src/codec/SkMaskSwizzler.cpp",
2170 "src/codec/SkMasks.cpp",
2171 "src/codec/SkSampledCodec.cpp",
2172 "src/codec/SkSampler.cpp",
2173 "src/codec/SkStreamBuffer.cpp",
2174 "src/codec/SkSwizzler.cpp",
2175 "src/codec/SkWbmpCodec.cpp",
2176 "src/images/SkImageEncoder.cpp",
2177 "src/ports/SkDiscardableMemory_none.cpp",
2178 "src/ports/SkImageGenerator_skia.cpp",
2179 "src/ports/SkMemory_malloc.cpp",
2180 "src/ports/SkOSFile_stdio.cpp",
2181 "src/sfnt/SkOTTable_name.cpp",
2182 "src/sfnt/SkOTUtils.cpp",
2183 "src/utils/mac/SkStream_mac.cpp",
2184 "third_party/gif/SkGifImageReader.cpp",
2185 ]
2186 deps = [
2187 ":tool_utils",
2188 "modules/skottie",
2189 "modules/skshaper",
2190 ]
2191 }
2192 }
2193
Brian Osmanc9a42472018-05-31 13:17:12 -04002194 if (!skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002195 test_app("HelloWorld") {
2196 sources = [
2197 "example/HelloWorld.cpp",
2198 ]
2199 libs = []
2200
2201 include_dirs = []
2202 deps = [
2203 ":flags",
2204 ":gpu_tool_utils",
2205 ":sk_app",
2206 ":skia",
2207 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002208 ]
2209 }
2210 }
2211
Brian Osmanc9a42472018-05-31 13:17:12 -04002212 if (is_linux || is_mac || is_ios) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002213 test_app("SkiaSDLExample") {
2214 sources = [
2215 "example/SkiaSDLExample.cpp",
2216 ]
2217 libs = []
2218 include_dirs = []
2219 deps = [
2220 ":gpu_tool_utils",
2221 ":skia",
2222 "//third_party/libsdl",
2223 ]
2224 }
2225 }
2226
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002227 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2228 action_foreach("generate_mocs") {
2229 script = "gn/call.py"
2230 sources = [
2231 "tools/mdbviz/MainWindow.h",
2232 ]
2233 outputs = [
2234 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2235 ]
2236 args = [
2237 "$skia_qt_path" + "/bin/moc",
2238 "{{source}}",
2239 "-o",
2240 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2241 ]
2242 }
2243 action_foreach("generate_resources") {
2244 script = "gn/call.py"
2245 sources = [
2246 "tools/mdbviz/resources.qrc",
2247 ]
2248 outputs = [
2249 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2250 ]
2251 args = [
2252 "$skia_qt_path" + "/bin/rcc",
2253 "{{source}}",
2254 "-o",
2255 "gen/mdbviz/{{source_name_part}}_res.cpp",
2256 ]
2257 }
2258 test_app("mdbviz") {
2259 if (is_win) {
2260 # on Windows we need to disable some exception handling warnings due to the Qt headers
2261 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2262 }
2263 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002264 "tools/UrlDataManager.cpp",
2265 "tools/debugger/SkDebugCanvas.cpp",
2266 "tools/debugger/SkDrawCommand.cpp",
2267 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002268 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002269 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002270 "tools/mdbviz/main.cpp",
2271
2272 # generated files
2273 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2274 "$target_gen_dir/mdbviz/resources_res.cpp",
2275 ]
2276 lib_dirs = [ "$skia_qt_path/lib" ]
2277 libs = [
2278 "Qt5Core.lib",
2279 "Qt5Gui.lib",
2280 "Qt5Widgets.lib",
2281 ]
2282 include_dirs = [
2283 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002284 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002285 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002286 "tools",
2287 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002288 ]
2289 deps = [
2290 ":generate_mocs",
2291 ":generate_resources",
2292 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002293 "//third_party/jsoncpp",
2294 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002295 ]
2296 }
2297 }
2298
Mike Kleine459afd2017-03-03 09:21:30 -05002299 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002300 copy("gdbserver") {
2301 sources = [
2302 "$ndk/$ndk_gdbserver",
2303 ]
2304 outputs = [
2305 "$root_out_dir/gdbserver",
2306 ]
2307 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002308 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002309
2310 if (skia_use_opencl) {
2311 test_app("hello-opencl") {
2312 sources = [
2313 "src/compute/common/cl/assert_cl.c",
2314 "src/compute/common/cl/find_cl.c",
2315 "tools/hello-opencl.cpp",
2316 ]
2317 include_dirs = [ "src/compute/common" ]
Ben Wagner30a4e3d2018-08-07 16:58:15 -04002318 if (is_linux) {
2319 libs = [ "OpenCL" ]
2320 } else if (is_win) {
2321 libs = [ "OpenCL.lib" ]
2322 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002323 }
2324 }
mtklein25c81d42016-07-27 13:55:26 -07002325}