blob: 65b73993eb2f96bd69a93baedd4b5024fa0e2805 [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 Klein10d665d2016-11-01 11:46:10 -040029 skia_use_piex = !is_win
mtklein63213812016-08-24 09:55:56 -070030 skia_use_zlib = true
Greg Daniele5ddff52017-07-05 16:49:36 -040031 skia_use_metal = false
Mike Klein36f182f2017-10-20 12:33:53 -040032 skia_use_libheif = is_skia_dev_build
Brian Osman670a2902018-04-23 13:31:56 -040033 skia_use_skcms = true
mtklein1bd72ba2016-09-16 07:45:52 -070034
Mike Klein7d921032017-01-05 12:20:41 -050035 skia_android_serial = ""
Brian Osman3f375d02016-12-28 11:19:22 -050036 skia_enable_discrete_gpu = true
Mike Kleina04bb452017-02-09 12:24:07 -050037 skia_enable_effects = true
Brian Osmanf2c90142017-07-13 15:50:03 -040038 skia_enable_flutter_defines = false
Hal Canaryff2742e2018-01-30 11:35:47 -050039 skia_enable_fontmgr_empty = false
Brian Osman74511012018-04-02 20:13:46 +000040 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050041 skia_enable_pdf = true
Florin Malita87ccf332018-05-04 12:23:24 -040042 skia_enable_skottie = true
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040043 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050044 skia_enable_tools = is_skia_dev_build
45 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Mike Klein2c2a1192018-05-22 12:25:43 +000046 skia_vulkan_header = ""
47 skia_vulkan_sdk = getenv("VULKAN_SDK")
48 skia_moltenvk_path = ""
Robert Phillipsa6d2d702017-09-01 12:17:03 -040049 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040050 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070051 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070052 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040053
Hal Canary4689b542018-01-31 11:54:14 -050054 skia_skqp_enable_driver_correctness_workarounds = false
Hal Canary2331c822018-02-01 14:06:13 -050055 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040056
57 skia_llvm_path = ""
58 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040059
60 skia_tools_require_resources = false
mtkleinc04ff472016-06-23 10:29:30 -070061}
Brian Salomon23d73ea2016-10-27 13:31:37 -040062declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040063 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040064 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050065 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Mike Klein10d665d2016-11-01 11:46:10 -040066
Brian Salomon5f33a8c2018-02-26 14:32:39 -050067 skia_use_legacy_gpu_pixel_ops = is_skia_dev_build && is_win # Arbitrary to keep old code path tested until deletion.
68
Mike Klein4d598a32016-10-31 13:44:49 -040069 if (is_android) {
70 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070071 } else if (is_fuchsia) {
72 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040073 } else {
Chris Dalton3a67b8e2018-05-03 09:30:29 -060074 skia_use_vulkan = skia_vulkan_sdk != "" || 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}
Mike Klein2c2a1192018-05-22 12:25:43 +000082declare_args() {
83 skia_tools_vulkan_header_dir = ""
84 if (skia_use_vulkan) {
85 # When buliding on Android we get the header via the NDK so no need for any extra path.
86 if (is_fuchsia) {
87 skia_tools_vulkan_header_dir = "$fuchsia_vulkan_sdk/include"
88 } else if (is_linux || is_win) {
89 skia_tools_vulkan_header_dir = "$skia_vulkan_sdk/include"
90 }
91 }
92}
Brian Salomon789e25e2016-09-30 13:41:03 -040093
Adam Barth54ef74a2017-10-13 10:59:38 -070094if (defined(skia_settings)) {
95 import(skia_settings)
96}
97
mtklein38925aa2016-09-21 10:11:25 -070098# Our tools require static linking (they use non-exported symbols).
99skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -0700100
mtkleina45be612016-08-29 15:22:10 -0700101fontmgr_android_enabled = skia_use_expat && skia_use_freetype
102
mtklein1211e0c2016-07-26 13:55:45 -0700103skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -0700104 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -0700105 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -0700106 "include/codec",
107 "include/config",
108 "include/core",
109 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -0400110 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -0700111 "include/gpu",
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500112 "include/atlastext",
mtklein1211e0c2016-07-26 13:55:45 -0700113 "include/pathops",
114 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -0700115 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700116 "include/utils",
117 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700118]
119
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000120if (skia_use_vulkan) {
121 skia_public_includes += [ "include/gpu/vk" ]
122}
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500123if (skia_enable_atlas_text) {
124 skia_public_includes += [ "include/atlastext" ]
125}
Greg Daniele5ddff52017-07-05 16:49:36 -0400126if (skia_use_metal) {
127 skia_public_includes += [ "include/gpu/mtl" ]
128}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000129
mtkleinc04ff472016-06-23 10:29:30 -0700130# Skia public API, generally provided by :skia.
131config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700132 include_dirs = skia_public_includes
Mike Klein2c2a1192018-05-22 12:25:43 +0000133 if (skia_tools_vulkan_header_dir != "") {
134 include_dirs += [ skia_tools_vulkan_header_dir ]
135 }
Mike Kleinae7e6712016-10-11 17:49:33 -0400136 defines = []
137 if (is_component_build) {
138 defines += [ "SKIA_DLL" ]
139 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400140 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700141 defines += [ "SK_SAMPLES_FOR_X" ]
142 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400143 if (skia_enable_flutter_defines) {
144 defines += flutter_defines
145 }
mtklein06c35c02016-09-20 12:28:12 -0700146 if (!skia_enable_gpu) {
147 defines += [ "SK_SUPPORT_GPU=0" ]
148 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500149 if (skia_enable_atlas_text) {
150 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
151 }
mtkleinc04ff472016-06-23 10:29:30 -0700152}
153
154# Skia internal APIs, used by Skia itself and a few test tools.
155config("skia_private") {
156 visibility = [ ":*" ]
157
158 include_dirs = [
159 "include/private",
160 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700161 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700162 "src/core",
163 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700164 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700165 "src/image",
166 "src/images",
167 "src/lazy",
168 "src/opts",
169 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700170 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700171 "src/ports",
172 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400173 "src/shaders",
174 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700175 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700176 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700177 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500178 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700179 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700180 ]
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400181 if (skia_llvm_path != "") {
182 include_dirs += [ "$skia_llvm_path/include" ]
183 }
mtklein150d1132016-08-01 06:56:40 -0700184
Mike Reeda9e241d2017-05-03 10:52:00 -0400185 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700186 if (is_android) {
187 defines += [
188 "SK_GAMMA_EXPONENT=1.4",
189 "SK_GAMMA_CONTRAST=0.0",
190 ]
191 }
mtklein88a7ac02016-09-14 11:16:49 -0700192 if (is_official_build || is_android) {
193 # TODO(bsalomon): it'd be nice to make Android normal.
194 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
195 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400196 libs = []
197 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500198 if (skia_enable_gpu) {
199 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500200 if (is_skia_dev_build && skia_use_vulkan) {
201 include_dirs += [ "tools/gpu/vk" ]
202 }
Brian Salomon03e05842017-02-23 12:23:47 -0500203 }
Brian Osman34755e22016-12-05 09:46:02 -0500204 if (skia_use_angle) {
205 defines += [ "SK_ANGLE" ]
206 }
Brian Osman3f375d02016-12-28 11:19:22 -0500207 if (skia_enable_discrete_gpu) {
208 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
209 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400210 if (!is_official_build) {
211 defines += [ "GR_TEST_UTILS=1" ]
212 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400213 if (skia_llvm_path != "") {
214 defines += [ "SK_LLVM_AVAILABLE" ]
215 include_dirs += [ "$skia_llvm_path/include" ]
216 libs += [ skia_llvm_lib ]
217 lib_dirs += [ "$skia_llvm_path/lib/" ]
218 }
mtkleinc04ff472016-06-23 10:29:30 -0700219}
220
221# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
222config("skia_library") {
223 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700224 defines = [ "SKIA_IMPLEMENTATION=1" ]
225}
226
Mike Klein2c2a1192018-05-22 12:25:43 +0000227config("moltenvk") {
228 if (is_ios) {
229 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
230 } else {
231 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
232 }
233 cflags = [
234 "-F$moltenvk_framework_path",
235 "-isystem$skia_moltenvk_path/MoltenVK/include", # for <vulkan/vulkan.h>
236 ]
237 ldflags = [ "-F$moltenvk_framework_path" ]
238 libs = [
239 "MoltenVK.framework",
240 "Metal.framework",
241 "IOSurface.framework",
242 "QuartzCore.framework",
243 "Foundation.framework",
244 ]
245 if (is_ios) {
246 libs += [ "UIKit.framework" ]
247 } else {
248 libs += [ "IOKit.framework" ]
249 }
250 defines = [ "SK_MOLTENVK" ]
251}
252
mtkleinc04ff472016-06-23 10:29:30 -0700253skia_library_configs = [
254 ":skia_public",
255 ":skia_private",
256 ":skia_library",
257]
258
mtklein9b8583d2016-08-24 17:32:30 -0700259# Use for CPU-specific Skia code that needs particular compiler flags.
260template("opts") {
261 if (invoker.enabled) {
262 source_set(target_name) {
263 forward_variables_from(invoker, "*")
264 configs += skia_library_configs
265 }
266 } else {
267 # If not enabled, a phony empty target that swallows all otherwise unused variables.
268 source_set(target_name) {
269 forward_variables_from(invoker,
270 "*",
271 [
272 "sources",
273 "cflags",
274 ])
275 }
276 }
anmittala7eaf2e2016-08-17 13:57:26 -0700277}
278
mtklein422310d2016-08-16 18:28:43 -0700279is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700280
mtklein7d6fb2c2016-08-25 14:50:44 -0700281opts("none") {
282 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700283 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700284 cflags = []
285}
286
mtklein7d6fb2c2016-08-25 14:50:44 -0700287opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700288 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700289 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700290 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700291}
292
293opts("arm64") {
294 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700295 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700296 cflags = []
297}
298
299opts("crc32") {
300 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700301 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700302 cflags = [ "-march=armv8-a+crc" ]
303}
304
mtklein9b8583d2016-08-24 17:32:30 -0700305opts("sse2") {
306 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700307 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400308 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400309 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
310 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400311 cflags = [ "-msse2" ]
312 }
mtklein9b8583d2016-08-24 17:32:30 -0700313}
mtkleinc04ff472016-06-23 10:29:30 -0700314
mtklein9b8583d2016-08-24 17:32:30 -0700315opts("ssse3") {
316 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700317 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400318 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400319 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
320 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400321 cflags = [ "-mssse3" ]
322 }
mtklein9b8583d2016-08-24 17:32:30 -0700323}
mtkleinc04ff472016-06-23 10:29:30 -0700324
mtklein9b8583d2016-08-24 17:32:30 -0700325opts("sse41") {
326 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700327 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400328 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400329 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
330 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400331 cflags = [ "-msse4.1" ]
332 }
mtklein9b8583d2016-08-24 17:32:30 -0700333}
mtklein4e976072016-08-08 09:06:27 -0700334
mtklein9b8583d2016-08-24 17:32:30 -0700335opts("sse42") {
336 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700337 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400338 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400339 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
340 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400341 cflags = [ "-msse4.2" ]
342 }
mtklein9b8583d2016-08-24 17:32:30 -0700343}
344
345opts("avx") {
346 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700347 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400348 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000349 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400350 } else {
351 cflags = [ "-mavx" ]
352 }
mtkleinc04ff472016-06-23 10:29:30 -0700353}
354
Mike Klein1b9b7d52018-02-27 10:37:40 -0500355opts("hsw") {
356 enabled = is_x86
357 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400358 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500359 cflags = [ "/arch:AVX2" ]
360 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000361 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500362 }
363
364 # Oddly, clang-cl doesn't recognize this as a valid flag.
365 # If it ever does, it'd nice to move this up with -mavx2 and co.
366 if (is_clang && !is_win) {
367 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
368 # but nice to have, generating slightly better code for paths without explicit FMAs.
369 cflags += [ "-ffp-contract=fast" ]
370 }
371}
372
mtkleinc095df52016-08-24 12:23:52 -0700373# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700374template("optional") {
375 if (invoker.enabled) {
376 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700377 if (defined(invoker.public_defines)) {
378 defines = invoker.public_defines
379 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600380 if (defined(invoker.public_configs)) {
381 configs = invoker.public_configs
382 }
mtklein457b42a2016-08-23 13:56:37 -0700383 }
384 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700385 forward_variables_from(invoker,
386 "*",
387 [
388 "public_defines",
389 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700390 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700391 ])
mtklein457b42a2016-08-23 13:56:37 -0700392 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700393 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700394 if (defined(invoker.configs_to_remove)) {
395 configs -= invoker.configs_to_remove
396 }
mtklein457b42a2016-08-23 13:56:37 -0700397 }
398 } else {
mtklein457b42a2016-08-23 13:56:37 -0700399 source_set(target_name) {
400 forward_variables_from(invoker,
401 "*",
402 [
403 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700404 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700405 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700406 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700407 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700408 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700409 ])
mtkleincd01b032016-08-31 04:58:19 -0700410 if (defined(invoker.sources_when_disabled)) {
411 sources = invoker.sources_when_disabled
412 }
413 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700414 }
mtkleineb3c4252016-08-23 07:38:09 -0700415 }
mtklein457b42a2016-08-23 13:56:37 -0700416}
mtklein457b42a2016-08-23 13:56:37 -0700417
Mike Kleina04bb452017-02-09 12:24:07 -0500418optional("effects") {
419 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400420 deps = [
421 ":compile_processors",
422 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500423 sources =
424 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
425 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
426}
427
mtkleina45be612016-08-29 15:22:10 -0700428optional("fontmgr_android") {
429 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700430
431 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500432 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700433 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700434 ]
435 sources = [
436 "src/ports/SkFontMgr_android.cpp",
437 "src/ports/SkFontMgr_android_factory.cpp",
438 "src/ports/SkFontMgr_android_parser.cpp",
439 ]
440}
441
mtkleind2e39db2016-09-07 07:52:55 -0700442optional("fontmgr_custom") {
443 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
444
445 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500446 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700447 ]
448 sources = [
449 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500450 "src/ports/SkFontMgr_custom.h",
451 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700452 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500453 "src/ports/SkFontMgr_custom_embedded.cpp",
454 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700455 ]
456}
457
Hal Canaryff2742e2018-01-30 11:35:47 -0500458optional("fontmgr_empty") {
459 enabled = skia_enable_fontmgr_empty
460 sources = [
461 "src/ports/SkFontMgr_empty_factory.cpp",
462 ]
463}
464
mtklein3cc22182016-08-29 13:26:14 -0700465optional("fontmgr_fontconfig") {
466 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700467
468 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500469 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700470 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700471 ]
472 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700473 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700474 "src/ports/SkFontConfigInterface_direct.cpp",
475 "src/ports/SkFontConfigInterface_direct_factory.cpp",
476 "src/ports/SkFontMgr_FontConfigInterface.cpp",
477 "src/ports/SkFontMgr_fontconfig.cpp",
478 "src/ports/SkFontMgr_fontconfig_factory.cpp",
479 ]
480}
481
mtkleincdedd0e2016-09-12 15:15:44 -0700482optional("fontmgr_fuchsia") {
483 enabled = is_fuchsia && skia_use_freetype
484
485 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500486 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700487 ]
488 sources = [
489 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500490 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700491 "src/ports/SkFontMgr_custom_empty_factory.cpp",
492 ]
493}
494
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700495if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400496 executable("sksllex") {
497 sources = [
498 "src/sksl/lex/Main.cpp",
499 "src/sksl/lex/NFA.cpp",
500 "src/sksl/lex/RegexNode.cpp",
501 "src/sksl/lex/RegexParser.cpp",
502 ]
503 include_dirs = [ "src/sksl/lex" ]
504 }
505
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700506 action("run_sksllex") {
507 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400508 deps = [
509 ":sksllex(//gn/toolchain:$host_toolchain)",
510 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700511 sources = [
512 "src/sksl/lex/layout.lex",
513 "src/sksl/lex/sksl.lex",
514 ]
515
516 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
517 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
518 outputs = [
519 "$target_out_dir/" +
520 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
521 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
522 # confused due to the same file being named by two different paths
523 ]
524 sksllex_path = "$root_out_dir/"
525 sksllex_path += "sksllex"
526 if (host_os == "win") {
527 sksllex_path += ".exe"
528 }
529 args = [
530 rebase_path(sksllex_path),
531 rebase_path("bin/clang-format"),
532 rebase_path("src"),
533 ]
534 }
535} else {
536 group("run_sksllex") {
537 }
538}
539
540if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400541 executable("skslc") {
542 defines = [ "SKSL_STANDALONE" ]
543 sources = [
544 "src/sksl/SkSLMain.cpp",
545 ]
546 sources += skia_sksl_sources
547 include_dirs = [
548 "src/gpu",
549 "src/sksl",
550 ]
551 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500552 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400553 "//third_party/spirv-tools",
554 ]
555 }
556
557 skia_gpu_processor_outputs = []
558 foreach(src, skia_gpu_processor_sources) {
559 dir = get_path_info(src, "dir")
560 name = get_path_info(src, "name")
561
562 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
563 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
564 skia_gpu_processor_outputs += [
565 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
566 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
567 # confused due to the same file being named by two different paths
568 ]
569 }
570
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500571 action("create_sksl_enums") {
572 script = "gn/create_sksl_enums.py"
573 sources = [
574 "include/private/GrSharedEnums.h",
575 ]
576 outputs = [
577 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500578 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500579 ]
580 args = [
581 rebase_path(sources[0]),
582 rebase_path(outputs[0]),
583 ]
584 }
585
Ethan Nicholas762466e2017-06-29 10:03:38 -0400586 action("compile_processors") {
587 script = "gn/compile_processors.py"
588 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500589 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400590 ":skslc(//gn/toolchain:$host_toolchain)",
591 ]
592 sources = skia_gpu_processor_sources
593 outputs = skia_gpu_processor_outputs
594 skslc_path = "$root_out_dir/"
595 if (host_toolchain != default_toolchain_name) {
596 skslc_path += "$host_toolchain/"
597 }
598 skslc_path += "skslc"
599 if (host_os == "win") {
600 skslc_path += ".exe"
601 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400602 args = [
603 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400604 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400605 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400606 args += rebase_path(skia_gpu_processor_sources)
607 }
608} else {
609 skia_gpu_processor_outputs = []
610 group("compile_processors") {
611 }
612}
613
mtklein06c35c02016-09-20 12:28:12 -0700614optional("gpu") {
615 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400616 deps = [
617 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700618 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400619 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700620 if (skia_generate_workarounds) {
621 deps += [ ":workaround_list" ]
622 }
mtkleine9fb3d52016-09-20 15:11:46 -0700623 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600624 public_configs = []
mtkleine9fb3d52016-09-20 15:11:46 -0700625
Brian Salomon3d6801e2017-12-11 10:06:31 -0500626 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700627
628 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500629 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700630 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400631 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700632 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400633 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400634
635 # this lib is required to link against AHardwareBuffer
636 if (defined(ndk_api) && ndk_api >= 26) {
637 libs += [ "android" ]
638 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400639 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500640 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400641 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700642 } else if (is_linux) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500643 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500644 libs += [
645 "GL",
646 "GLU",
647 ]
mtklein06c35c02016-09-20 12:28:12 -0700648 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500649 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800650 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500651 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400652 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500653 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400654 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700655 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500656 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700657 }
mtkleine9fb3d52016-09-20 15:11:46 -0700658
659 if (skia_use_vulkan) {
Mike Klein2c2a1192018-05-22 12:25:43 +0000660 public_defines += [ "SK_VULKAN" ]
mtkleine9fb3d52016-09-20 15:11:46 -0700661 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700662 if (skia_enable_vulkan_debug_layers) {
663 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
664 }
Mike Klein2c2a1192018-05-22 12:25:43 +0000665 if (skia_vulkan_header != "") {
666 public_defines += [ "SK_VULKAN_HEADER=\"$skia_vulkan_header\"" ]
667 } else if (skia_moltenvk_path != "") {
668 public_defines += [ "SK_VULKAN_HEADER=<MoltenVK/mvk_vulkan.h>" ]
669 } else if (is_skia_dev_build) {
670 public_defines += [ "SK_VULKAN_HEADER=\"GrVulkanDefines.h\"" ]
671 }
672 if (skia_moltenvk_path != "") {
673 public_configs += [ ":moltenvk" ]
674 }
mtkleine9fb3d52016-09-20 15:11:46 -0700675 }
Brian Salomon5f33a8c2018-02-26 14:32:39 -0500676 if (skia_use_legacy_gpu_pixel_ops) {
677 public_defines += [ "SK_LEGACY_GPU_PIXEL_OPS" ]
678 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400679 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400680 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400681 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
682 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400683
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400684 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400685 if (skia_use_metal) {
686 public_defines += [ "SK_METAL" ]
687 sources += skia_metal_sources
688 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400689 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400690 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500691
692 if (skia_enable_atlas_text) {
693 sources += skia_atlas_text_sources
694 }
mtklein06c35c02016-09-20 12:28:12 -0700695}
696
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400697optional("heif") {
698 enabled = skia_use_libheif
699 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
700
701 deps = []
702
703 sources = [
704 "src/codec/SkHeifCodec.cpp",
705 ]
706}
707
mtklein63213812016-08-24 09:55:56 -0700708optional("jpeg") {
709 enabled = skia_use_libjpeg_turbo
710 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
711
mtklein63213812016-08-24 09:55:56 -0700712 deps = [
713 "//third_party/libjpeg-turbo:libjpeg",
714 ]
715 sources = [
716 "src/codec/SkJpegCodec.cpp",
717 "src/codec/SkJpegDecoderMgr.cpp",
718 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700719 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400720 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700721 ]
722}
723
724optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500725 enabled = skia_use_zlib && skia_enable_pdf
726 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700727
mtklein63213812016-08-24 09:55:56 -0700728 deps = [
729 "//third_party/zlib",
730 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400731 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700732 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400733 }
brettwb9447282016-09-01 14:24:39 -0700734 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700735 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700736
737 if (skia_use_sfntly) {
738 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500739 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700740 }
741}
742
743optional("png") {
744 enabled = skia_use_libpng
745 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
746
mtklein63213812016-08-24 09:55:56 -0700747 deps = [
748 "//third_party/libpng",
749 ]
750 sources = [
751 "src/codec/SkIcoCodec.cpp",
752 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400753 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700754 ]
755}
756
scroggof84ad642016-10-31 09:02:57 -0700757optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400758 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700759 public_defines = [ "SK_CODEC_DECODES_RAW" ]
760
761 deps = [
762 "//third_party/dng_sdk",
763 "//third_party/libjpeg-turbo:libjpeg",
764 "//third_party/piex",
765 ]
766
767 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
768 # Skia.
769 configs_to_remove = [ "//gn:no_exceptions" ]
770
771 sources = [
772 "src/codec/SkRawAdapterCodec.cpp",
773 "src/codec/SkRawCodec.cpp",
774 ]
775}
776
Mike Klein852a8cb2018-05-15 10:46:58 -0400777import("third_party/skcms/skcms.gni")
778config("third_party_skcms_public") {
779 include_dirs = [ "third_party/skcms" ]
780}
781source_set("third_party_skcms") {
782 public_configs = [ ":third_party_skcms_public" ]
783
784 cflags = []
785 if (!is_win || is_clang) {
786 cflags += [
787 "-w",
788 "-std=c11",
789 ]
790 }
791
792 public = [
793 "third_party/skcms/skcms.h",
794 ]
795 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
796}
797
Mike Kleinfb333552018-01-25 12:49:37 -0500798optional("skcms") {
799 enabled = skia_use_skcms
800
Brian Osman094fba92018-03-26 17:05:48 -0400801 public_defines = [ "SK_USE_SKCMS" ]
Mike Kleinfb333552018-01-25 12:49:37 -0500802 deps = [
Mike Klein852a8cb2018-05-15 10:46:58 -0400803 ":third_party_skcms",
Mike Kleinfb333552018-01-25 12:49:37 -0500804 ]
805 sources = [
Brian Osman094fba92018-03-26 17:05:48 -0400806 "src/core/SkColorSpaceXform_skcms.cpp",
Mike Kleinfb333552018-01-25 12:49:37 -0500807 ]
808}
809
mtklein3cc22182016-08-29 13:26:14 -0700810optional("typeface_freetype") {
811 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700812
813 deps = [
814 "//third_party/freetype2",
815 ]
816 sources = [
817 "src/ports/SkFontHost_FreeType.cpp",
818 "src/ports/SkFontHost_FreeType_common.cpp",
819 ]
820}
821
mtklein457b42a2016-08-23 13:56:37 -0700822optional("webp") {
823 enabled = skia_use_libwebp
824 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
825
mtklein457b42a2016-08-23 13:56:37 -0700826 deps = [
827 "//third_party/libwebp",
828 ]
829 sources = [
830 "src/codec/SkWebpAdapterCodec.cpp",
831 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400832 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700833 ]
mtkleineb3c4252016-08-23 07:38:09 -0700834}
835
mtklein63213812016-08-24 09:55:56 -0700836optional("xml") {
837 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000838 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700839
mtklein63213812016-08-24 09:55:56 -0700840 deps = [
841 "//third_party/expat",
842 ]
843 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500844 "src/svg/SkSVGCanvas.cpp",
845 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700846 "src/xml/SkDOM.cpp",
847 "src/xml/SkXMLParser.cpp",
848 "src/xml/SkXMLWriter.cpp",
849 ]
850}
851
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700852if (skia_enable_gpu && skia_generate_workarounds) {
853 action("workaround_list") {
854 script = "tools/build_workaround_header.py"
855
856 inputs = [
857 "src/gpu/gpu_workaround_list.txt",
858 ]
859
860 # see comments in skia_compile_processors about out dir path shenanigans.
861 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -0700862 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700863
864 outputs = [
865 "$root_out_dir/$output_file",
866 ]
867 args = [
868 "--output-file",
869 "$output_file",
870 ]
871
872 foreach(file, inputs) {
873 args += [ rebase_path(file, root_build_dir) ]
874 }
875 }
876}
877
mtkleinc04ff472016-06-23 10:29:30 -0700878component("skia") {
879 public_configs = [ ":skia_public" ]
880 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700881
882 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700883 ":arm64",
884 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700885 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700886 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500887 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700888 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700889 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500890 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700891 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700892 ":fontmgr_fuchsia",
Mike Klein2c2a1192018-05-22 12:25:43 +0000893 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400894 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500895 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700896 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700897 ":none",
mtklein63213812016-08-24 09:55:56 -0700898 ":pdf",
899 ":png",
scroggof84ad642016-10-31 09:02:57 -0700900 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500901 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700902 ":sse2",
903 ":sse41",
904 ":sse42",
905 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700906 ":webp",
mtklein63213812016-08-24 09:55:56 -0700907 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700908 ]
909
Chinmay Garde43f115c2016-11-16 15:04:12 -0800910 # This file (and all GN files in Skia) are designed to work with an
911 # empty sources assignment filter; we handle all that explicitly.
912 # We clear the filter here for clients who may have set up a global filter.
913 set_sources_assignment_filter([])
914
mtkleinc04ff472016-06-23 10:29:30 -0700915 sources = []
brettwb9447282016-09-01 14:24:39 -0700916 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700917 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500918 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700919 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400920 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500921 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700922 "src/android/SkBitmapRegionCodec.cpp",
923 "src/android/SkBitmapRegionDecoder.cpp",
924 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400925 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700926 "src/codec/SkBmpCodec.cpp",
927 "src/codec/SkBmpMaskCodec.cpp",
928 "src/codec/SkBmpRLECodec.cpp",
929 "src/codec/SkBmpStandardCodec.cpp",
930 "src/codec/SkCodec.cpp",
931 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700932 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700933 "src/codec/SkMaskSwizzler.cpp",
934 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700935 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700936 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700937 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700938 "src/codec/SkSwizzler.cpp",
939 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700940 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700941 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700942 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700943 "src/ports/SkMemory_malloc.cpp",
944 "src/ports/SkOSFile_stdio.cpp",
945 "src/sfnt/SkOTTable_name.cpp",
946 "src/sfnt/SkOTUtils.cpp",
947 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700948 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700949 ]
brettwb9447282016-09-01 14:24:39 -0700950
mtklein7d6fb2c2016-08-25 14:50:44 -0700951 libs = []
952
mtkleinc04ff472016-06-23 10:29:30 -0700953 if (is_win) {
954 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400955 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700956 "src/ports/SkDebug_win.cpp",
957 "src/ports/SkFontHost_win.cpp",
958 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500959 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700960 "src/ports/SkImageEncoder_WIC.cpp",
961 "src/ports/SkImageGeneratorWIC.cpp",
962 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700963 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700964 "src/ports/SkScalerContext_win_dw.cpp",
965 "src/ports/SkTLS_win.cpp",
966 "src/ports/SkTypeface_win_dw.cpp",
967 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400968 libs += [
969 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500970 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400971 "Ole32.lib",
972 "OleAut32.lib",
973 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500974 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400975 ]
mtkleinc04ff472016-06-23 10:29:30 -0700976 } else {
977 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700978 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700979 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700980 "src/ports/SkTLS_pthread.cpp",
981 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400982 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700983 }
984
mtklein7d6fb2c2016-08-25 14:50:44 -0700985 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500986 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500987 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500988 deps += [ "//third_party/cpu-features" ]
989 }
mtklein06c35c02016-09-20 12:28:12 -0700990 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700991 libs += [
992 "EGL",
993 "GLESv2",
994 "log",
995 ]
996 }
997
mtkleinc04ff472016-06-23 10:29:30 -0700998 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700999 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001000 if (skia_use_egl) {
1001 libs += [ "GLESv2" ]
1002 }
mtkleinc04ff472016-06-23 10:29:30 -07001003 }
1004
1005 if (is_mac) {
1006 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001007 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001008 "src/ports/SkFontHost_mac.cpp",
1009 "src/ports/SkImageEncoder_CG.cpp",
1010 "src/ports/SkImageGeneratorCG.cpp",
1011 ]
mtklein09e61f72016-08-23 13:35:28 -07001012 libs += [
bungeman3e306f62017-03-29 11:32:02 -04001013 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
1014 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -07001015 "ApplicationServices.framework",
1016 "OpenGL.framework",
1017 ]
mtkleinc04ff472016-06-23 10:29:30 -07001018 }
abarth6fc8ff02016-07-15 15:15:15 -07001019
Mike Klein7d302882016-11-03 14:06:31 -04001020 if (is_ios) {
1021 sources += [
1022 "src/ports/SkDebug_stdio.cpp",
1023 "src/ports/SkFontHost_mac.cpp",
1024 "src/ports/SkImageEncoder_CG.cpp",
1025 "src/ports/SkImageGeneratorCG.cpp",
1026 ]
1027 libs += [
1028 "CoreFoundation.framework",
1029 "CoreGraphics.framework",
1030 "CoreText.framework",
1031 "ImageIO.framework",
1032 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -04001033
1034 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
1035 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001036 ]
1037 }
1038
abarth6fc8ff02016-07-15 15:15:15 -07001039 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001040 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001041 }
mtkleinc04ff472016-06-23 10:29:30 -07001042}
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" ]
Greg Danielafb7ec72017-12-07 12:48:30 -05001053 if (skia_use_vulkan) {
1054 # So we can get the header which includes vulkan
1055 include_dirs += [ "tools/gpu/vk" ]
1056 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001057 }
1058 action("skia.h") {
1059 public_configs = [ ":skia.h_config" ]
1060 skia_h = "$target_gen_dir/skia.h"
1061 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -04001062 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +00001063 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001064 depfile = "$skia_h.deps"
1065 outputs = [
1066 skia_h,
1067 ]
1068 }
1069
1070 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001071 executable("fiddle") {
1072 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001073 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001074 "tools/fiddle/draw.cpp",
1075 "tools/fiddle/fiddle_main.cpp",
1076 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001077
1078 if (skia_use_egl) {
1079 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001080 } else {
1081 sources += [ "tools/fiddle/null_context.cpp" ]
1082 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001083 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001084 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001085 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001086 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001087 ":skia",
1088 ":skia.h",
1089 ]
1090 }
1091 }
1092
1093 if (skia_enable_gpu) {
1094 source_set("public_headers_warnings_check") {
1095 sources = [
1096 "tools/public_headers_warnings_check.cpp",
1097 ]
1098 configs -= [ "//gn:warnings_except_public_headers" ]
1099 deps = [
1100 ":skia",
1101 ":skia.h",
1102 ]
1103 }
1104 }
1105
mtkleinc095df52016-08-24 12:23:52 -07001106 template("test_lib") {
1107 config(target_name + "_config") {
1108 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001109 if (defined(invoker.public_defines)) {
1110 defines = invoker.public_defines
1111 }
mtklein25c81d42016-07-27 13:55:26 -07001112 }
mtkleinc095df52016-08-24 12:23:52 -07001113 source_set(target_name) {
1114 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1115 public_configs = [
1116 ":" + target_name + "_config",
1117 ":skia_private",
1118 ]
1119
1120 if (!defined(deps)) {
1121 deps = []
1122 }
1123 deps += [ ":skia" ]
1124 testonly = true
1125 }
mtklein25c81d42016-07-27 13:55:26 -07001126 }
mtklein25c81d42016-07-27 13:55:26 -07001127
Mike Kleine6682eb2017-01-05 10:54:57 -05001128 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001129 if (is_ios) {
1130 app_name = target_name
1131 gen_path = target_gen_dir
1132
1133 action("${app_name}_generate_info_plist") {
1134 script = "//gn/gen_plist_ios.py"
1135 outputs = [
1136 "$gen_path/${app_name}_Info.plist",
1137 ]
1138 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1139 }
1140
1141 bundle_data("${app_name}_bundle_info_plist") {
1142 public_deps = [
1143 ":${app_name}_generate_info_plist",
1144 ]
1145 sources = [
1146 "$gen_path/${app_name}_Info.plist",
1147 ]
1148 outputs = [
1149 "{{bundle_root_dir}}/Info.plist",
1150 ]
1151 }
1152
Jim Van Verth329c5a62017-11-29 11:42:33 -05001153 bundle_ios_data =
1154 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1155
1156 if (bundle_ios_data) {
1157 has_skps =
1158 "True" == exec_script("//gn/checkdir.py",
1159 [ rebase_path("skps", root_build_dir) ],
1160 "trim string")
1161 bundle_data("${app_name}_bundle_resources") {
1162 sources = [
1163 "resources",
1164 ]
1165 outputs = [
1166 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1167 "{{bundle_resources_dir}}/data/resources",
1168 ]
1169 }
1170
1171 if (has_skps) {
1172 bundle_data("${app_name}_bundle_skps") {
1173 sources = [
1174 "skps",
1175 ]
1176 outputs = [
1177 # Store in same folder as resources
1178 "{{bundle_resources_dir}}/data/skps",
1179 ]
1180 }
1181 }
1182 }
1183
Jim Van Verth443a9132017-11-28 09:45:26 -05001184 executable("${app_name}_generate_executable") {
1185 forward_variables_from(invoker,
1186 "*",
1187 [
1188 "output_name",
1189 "visibility",
1190 "is_shared_library",
1191 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001192 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001193 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001194 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1195 }
1196
1197 bundle_data("${app_name}_bundle_executable") {
1198 public_deps = [
1199 ":${app_name}_generate_executable",
1200 ]
1201 sources = [
1202 "$gen_path/$app_name",
1203 ]
1204 outputs = [
1205 "{{bundle_executable_dir}}/$app_name",
1206 ]
1207 testonly = true
1208 }
1209
1210 create_bundle("$app_name") {
1211 product_type = "com.apple.product-type.application"
1212 testonly = true
1213
1214 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1215 bundle_resources_dir = bundle_root_dir
1216 bundle_executable_dir = bundle_root_dir
1217 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1218
1219 deps = [
1220 ":${app_name}_bundle_executable",
1221 ":${app_name}_bundle_info_plist",
1222 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001223 if (bundle_ios_data) {
1224 deps += [ ":${app_name}_bundle_resources" ]
1225 if (has_skps) {
1226 deps += [ ":${app_name}_bundle_skps" ]
1227 }
1228 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001229
1230 # should only code sign when running on a device, not the simulator
1231 if (target_cpu != "x64") {
1232 code_signing_script = "//gn/codesign_ios.py"
1233 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1234 code_signing_outputs = [
1235 "$bundle_root_dir/_CodeSignature/CodeResources",
1236 "$bundle_root_dir/embedded.mobileprovision",
1237 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001238 code_signing_args = [
1239 rebase_path("$bundle_root_dir", root_build_dir),
1240 skia_ios_identity,
1241 skia_ios_profile,
1242 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001243 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001244 }
1245 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001246 # !is_ios
1247
1248 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1249 shared_library("lib" + target_name) {
1250 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1251 configs += [ ":skia_private" ]
1252 testonly = true
1253 }
1254 } else {
1255 _executable = target_name
1256 executable(_executable) {
1257 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1258 configs += [ ":skia_private" ]
1259 testonly = true
1260 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001261 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001262 if (is_android && skia_android_serial != "" && defined(_executable)) {
1263 action("push_" + target_name) {
1264 script = "gn/push_to_android.py"
1265 deps = [
1266 ":" + _executable,
1267 ]
1268 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1269 outputs = [
1270 _stamp,
1271 ]
1272 args = [
1273 rebase_path("$root_build_dir/$_executable"),
1274 skia_android_serial,
1275 rebase_path(_stamp),
1276 ]
1277 testonly = true
1278 }
Mike Klein7d921032017-01-05 12:20:41 -05001279 }
1280 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001281 }
1282
mtkleinc095df52016-08-24 12:23:52 -07001283 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001284 public_include_dirs = []
1285 if (skia_enable_gpu) {
1286 public_defines = []
1287 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001288
1289 deps = []
mtklein38925aa2016-09-21 10:11:25 -07001290 sources = [
1291 "tools/gpu/GrContextFactory.cpp",
1292 "tools/gpu/GrTest.cpp",
Brian Salomon58389b92018-03-07 13:01:25 -05001293 "tools/gpu/ProxyUtils.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001294 "tools/gpu/TestContext.cpp",
Brian Salomoncbcb0a12017-11-19 13:20:13 -05001295 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001296 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001297 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001298 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1299 "tools/gpu/gl/debug/GrBufferObj.cpp",
1300 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1301 "tools/gpu/gl/debug/GrProgramObj.cpp",
1302 "tools/gpu/gl/debug/GrShaderObj.cpp",
1303 "tools/gpu/gl/debug/GrTextureObj.cpp",
1304 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1305 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001306 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001307 ]
1308 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001309
Kevin Lubick4a24e102017-03-29 11:19:01 -04001310 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001311 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001312 } else if (is_ios) {
1313 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1314 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001315 } else if (is_linux) {
1316 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001317 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001318 } else if (is_mac) {
1319 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001320 } else if (is_win) {
1321 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1322 libs += [
1323 "Gdi32.lib",
1324 "OpenGL32.lib",
1325 ]
mtklein38925aa2016-09-21 10:11:25 -07001326 }
mtklein6ef69992016-09-14 06:12:09 -07001327
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001328 cflags_objcc = [ "-fobjc-arc" ]
1329
Mike Kleinc168a3a2016-11-14 14:53:13 +00001330 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001331 deps += [ "//third_party/angle2" ]
1332 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1333 }
mtkleind68f9b02016-09-23 13:18:41 -07001334 if (skia_use_vulkan) {
1335 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001336 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001337 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001338 if (skia_use_metal) {
1339 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1340 }
mtkleina627b5c2016-09-20 13:36:47 -07001341 }
mtklein25c81d42016-07-27 13:55:26 -07001342 }
mtklein25c81d42016-07-27 13:55:26 -07001343
mtkleinc095df52016-08-24 12:23:52 -07001344 test_lib("flags") {
1345 public_include_dirs = [ "tools/flags" ]
1346 sources = [
1347 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001348 ]
1349 }
1350 test_lib("common_flags") {
1351 public_include_dirs = [ "tools/flags" ]
1352 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001353 "tools/flags/SkCommonFlags.cpp",
1354 "tools/flags/SkCommonFlagsConfig.cpp",
1355 ]
1356 deps = [
mtklein046cb562016-09-16 10:23:12 -07001357 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001358 ":gpu_tool_utils",
1359 ]
1360 }
mtklein25c81d42016-07-27 13:55:26 -07001361
mtkleinc095df52016-08-24 12:23:52 -07001362 test_lib("tool_utils") {
1363 public_include_dirs = [
1364 "tools",
1365 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001366 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001367 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001368 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001369 ]
1370 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001371 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001372 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001373 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001374 "tools/ProcStats.cpp",
1375 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001376 "tools/UrlDataManager.cpp",
1377 "tools/debugger/SkDebugCanvas.cpp",
1378 "tools/debugger/SkDrawCommand.cpp",
1379 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001380 "tools/fonts/SkRandomScalerContext.cpp",
1381 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001382 "tools/fonts/SkTestFontMgr.h",
1383 "tools/fonts/SkTestSVGTypeface.cpp",
1384 "tools/fonts/SkTestSVGTypeface.h",
1385 "tools/fonts/SkTestTypeface.cpp",
1386 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001387 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001388 "tools/picture_utils.cpp",
1389 "tools/random_parse_path.cpp",
1390 "tools/sk_tool_utils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001391 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001392 "tools/trace/SkChromeTracingTracer.cpp",
1393 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001394 "tools/trace/SkDebugfTracer.cpp",
1395 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001396 "tools/trace/SkEventTracingPriv.cpp",
1397 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001398 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001399 libs = []
1400 if (is_ios) {
1401 sources += [ "tools/ios_utils.m" ]
1402 libs += [ "Foundation.framework" ]
1403 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001404 defines = []
1405 if (skia_tools_require_resources) {
1406 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1407 }
mtkleinc095df52016-08-24 12:23:52 -07001408 deps = [
mtklein046cb562016-09-16 10:23:12 -07001409 ":common_flags",
Ben Wagner97182cc2018-02-15 10:20:04 -05001410 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001411 ":flags",
1412 "//third_party/libpng",
1413 ]
1414 public_deps = [
1415 "//third_party/jsoncpp",
1416 ]
1417 }
mtklein25c81d42016-07-27 13:55:26 -07001418
Mike Klein6e744122016-10-27 12:21:40 -04001419 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001420 test_lib("gm") {
1421 public_include_dirs = [ "gm" ]
1422 sources = gm_sources
1423 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001424 ":experimental_sksg",
scroggo19b91532016-10-24 09:03:26 -07001425 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001426 ":gpu_tool_utils",
1427 ":skia",
1428 ":tool_utils",
1429 ]
1430 }
mtklein25c81d42016-07-27 13:55:26 -07001431
Mike Klein6e744122016-10-27 12:21:40 -04001432 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001433 test_lib("tests") {
1434 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001435 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001436 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001437 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001438 }
mtkleinc095df52016-08-24 12:23:52 -07001439 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001440 ":experimental_sksg",
Hal Canary0f666812018-03-22 15:21:12 -04001441 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001442 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001443 ":skia",
Mike Klein852a8cb2018-05-15 10:46:58 -04001444 ":third_party_skcms",
mtkleinc095df52016-08-24 12:23:52 -07001445 ":tool_utils",
1446 "//third_party/libpng",
1447 "//third_party/zlib",
1448 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001449 public_deps = [
1450 ":gpu_tool_utils", # Test.h #includes headers from this target.
1451 ]
mtkleinc095df52016-08-24 12:23:52 -07001452 }
mtklein2f3416d2016-08-02 16:02:05 -07001453
Mike Klein6e744122016-10-27 12:21:40 -04001454 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001455 test_lib("bench") {
1456 public_include_dirs = [ "bench" ]
1457 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001458 deps = [
1459 ":flags",
1460 ":gm",
1461 ":gpu_tool_utils",
1462 ":skia",
1463 ":tool_utils",
1464 ]
1465 }
mtklein2b6870c2016-07-28 14:17:33 -07001466
Florin Malita54f65c42018-01-16 17:04:30 -05001467 test_lib("experimental_skottie") {
Florin Malita87ccf332018-05-04 12:23:24 -04001468 public_include_dirs = []
Florin Malita87ccf332018-05-04 12:23:24 -04001469 if (skia_enable_skottie) {
1470 public_include_dirs += [ "experimental/skottie" ]
1471 public_defines = [ "SK_ENABLE_SKOTTIE" ]
1472 sources = [
1473 "experimental/skottie/Skottie.cpp",
1474 "experimental/skottie/SkottieAdapter.cpp",
1475 "experimental/skottie/SkottieAnimator.cpp",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001476 "experimental/skottie/SkottieJson.cpp",
Florin Malita87ccf332018-05-04 12:23:24 -04001477 "experimental/skottie/SkottieValue.cpp",
1478 ]
1479 deps = [
1480 ":experimental_sksg",
1481 ":skia",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001482 "//third_party/rapidjson",
Florin Malita87ccf332018-05-04 12:23:24 -04001483 ]
1484 }
Florin Malita094ccde2017-12-30 12:27:00 -05001485 }
1486
mtkleinc095df52016-08-24 12:23:52 -07001487 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001488 public_include_dirs = []
1489 if (skia_use_expat) {
1490 public_include_dirs += [ "experimental/svg/model" ]
1491 sources = [
1492 "experimental/svg/model/SkSVGAttribute.cpp",
1493 "experimental/svg/model/SkSVGAttributeParser.cpp",
1494 "experimental/svg/model/SkSVGCircle.cpp",
1495 "experimental/svg/model/SkSVGClipPath.cpp",
1496 "experimental/svg/model/SkSVGContainer.cpp",
1497 "experimental/svg/model/SkSVGDOM.cpp",
1498 "experimental/svg/model/SkSVGEllipse.cpp",
1499 "experimental/svg/model/SkSVGGradient.cpp",
1500 "experimental/svg/model/SkSVGLine.cpp",
1501 "experimental/svg/model/SkSVGLinearGradient.cpp",
1502 "experimental/svg/model/SkSVGNode.cpp",
1503 "experimental/svg/model/SkSVGPath.cpp",
1504 "experimental/svg/model/SkSVGPattern.cpp",
1505 "experimental/svg/model/SkSVGPoly.cpp",
1506 "experimental/svg/model/SkSVGRadialGradient.cpp",
1507 "experimental/svg/model/SkSVGRect.cpp",
1508 "experimental/svg/model/SkSVGRenderContext.cpp",
1509 "experimental/svg/model/SkSVGSVG.cpp",
1510 "experimental/svg/model/SkSVGShape.cpp",
1511 "experimental/svg/model/SkSVGStop.cpp",
1512 "experimental/svg/model/SkSVGTransformableNode.cpp",
1513 "experimental/svg/model/SkSVGUse.cpp",
1514 "experimental/svg/model/SkSVGValue.cpp",
1515 ]
1516 deps = [
1517 ":skia",
1518 ":xml",
1519 ]
1520 }
mtkleinc095df52016-08-24 12:23:52 -07001521 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001522
Florin Malita4aa44412017-12-19 12:21:02 -05001523 test_lib("experimental_sksg") {
1524 public_include_dirs = [
1525 "experimental/sksg",
1526 "experimental/sksg/effects",
1527 "experimental/sksg/geometry",
1528 "experimental/sksg/paint",
1529 ]
1530 sources = [
1531 "experimental/sksg/SkSGDraw.cpp",
1532 "experimental/sksg/SkSGEffectNode.cpp",
1533 "experimental/sksg/SkSGGeometryNode.cpp",
1534 "experimental/sksg/SkSGGroup.cpp",
Florin Malita49328072018-01-08 12:51:12 -05001535 "experimental/sksg/SkSGImage.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001536 "experimental/sksg/SkSGInvalidationController.cpp",
1537 "experimental/sksg/SkSGNode.cpp",
1538 "experimental/sksg/SkSGPaintNode.cpp",
1539 "experimental/sksg/SkSGRenderNode.cpp",
Florin Malita35efaa82018-01-22 12:57:06 -05001540 "experimental/sksg/SkSGScene.cpp",
Florin Malita38ea40e2018-01-29 16:31:14 -05001541 "experimental/sksg/effects/SkSGClipEffect.cpp",
Florin Malita5f9102f2018-01-10 13:36:22 -05001542 "experimental/sksg/effects/SkSGMaskEffect.cpp",
Florin Malitac0034172018-01-08 16:42:59 -05001543 "experimental/sksg/effects/SkSGOpacityEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001544 "experimental/sksg/effects/SkSGTransform.cpp",
Florin Malita16d0ad02018-01-19 15:07:29 -05001545 "experimental/sksg/geometry/SkSGGeometryTransform.cpp",
Florin Malitae6345d92018-01-03 23:37:54 -05001546 "experimental/sksg/geometry/SkSGMerge.cpp",
Florin Malita047ae272017-12-27 11:13:13 -05001547 "experimental/sksg/geometry/SkSGPath.cpp",
Florin Malita97b3d2b2018-02-20 11:26:15 -05001548 "experimental/sksg/geometry/SkSGPlane.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001549 "experimental/sksg/geometry/SkSGRect.cpp",
Florin Malita41dff6e2018-04-30 23:08:15 -04001550 "experimental/sksg/geometry/SkSGRoundEffect.cpp",
Florin Malita51012ce2018-01-31 17:06:59 -05001551 "experimental/sksg/geometry/SkSGText.cpp",
Florin Malita51b8c892018-01-07 08:54:24 -05001552 "experimental/sksg/geometry/SkSGTrimEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001553 "experimental/sksg/paint/SkSGColor.cpp",
Florin Malita6aaee592018-01-12 12:25:09 -05001554 "experimental/sksg/paint/SkSGGradient.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001555 ]
1556 deps = [
1557 ":skia",
1558 ]
1559 }
1560
Kevin Lubickebf648e2017-09-21 13:45:16 -04001561 if (target_cpu != "wasm") {
1562 test_lib("views") {
1563 public_include_dirs = [ "include/views" ]
1564 sources = [
1565 "src/views/SkEvent.cpp",
1566 "src/views/SkEventSink.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001567 "src/views/SkTouchGesture.cpp",
1568 "src/views/SkView.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001569 ]
Brian Osman34755e22016-12-05 09:46:02 -05001570 }
Brian Osman16adfa32016-10-18 14:42:44 -04001571 }
1572
Mike Klein38af9432016-11-11 11:39:44 -05001573 if (skia_use_lua) {
1574 test_lib("lua") {
1575 public_include_dirs = []
1576 sources = [
1577 "src/utils/SkLua.cpp",
1578 "src/utils/SkLuaCanvas.cpp",
1579 ]
1580 deps = [
Herb Derby1724db12018-05-22 12:01:50 -04001581 ":skshaper",
Mike Klein38af9432016-11-11 11:39:44 -05001582 "//third_party/lua",
1583 ]
1584 }
1585
Mike Kleine6682eb2017-01-05 10:54:57 -05001586 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001587 sources = [
1588 "tools/lua/lua_app.cpp",
1589 ]
1590 deps = [
1591 ":lua",
1592 ":skia",
1593 "//third_party/lua",
1594 ]
Mike Klein38af9432016-11-11 11:39:44 -05001595 }
1596
Mike Kleine6682eb2017-01-05 10:54:57 -05001597 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001598 sources = [
1599 "tools/lua/lua_pictures.cpp",
1600 ]
1601 deps = [
1602 ":flags",
1603 ":lua",
1604 ":skia",
1605 ":tool_utils",
1606 "//third_party/lua",
1607 ]
Mike Klein38af9432016-11-11 11:39:44 -05001608 }
1609 }
1610
Cary Clark8032b982017-07-28 11:04:54 -04001611 test_app("bookmaker") {
1612 sources = [
1613 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001614 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001615 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001616 "tools/bookmaker/fiddleParser.cpp",
1617 "tools/bookmaker/includeParser.cpp",
1618 "tools/bookmaker/includeWriter.cpp",
1619 "tools/bookmaker/mdOut.cpp",
1620 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001621 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001622 "tools/bookmaker/spellCheck.cpp",
1623 ]
1624 deps = [
1625 ":flags",
1626 ":skia",
1627 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001628 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001629 ]
1630 }
1631
Kevin Lubickebf648e2017-09-21 13:45:16 -04001632 if (target_cpu != "wasm") {
1633 import("gn/samples.gni")
1634 test_lib("samples") {
1635 public_include_dirs = [ "samplecode" ]
1636 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001637 sources = samples_sources
Kevin Lubickebf648e2017-09-21 13:45:16 -04001638 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001639 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001640 ":experimental_svg_model",
1641 ":flags",
1642 ":gm",
Mike Reed193d3a02018-02-08 15:45:51 -05001643 ":skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001644 ":tool_utils",
1645 ":views",
1646 ":xml",
1647 ]
Mike Klein38af9432016-11-11 11:39:44 -05001648
Kevin Lubickebf648e2017-09-21 13:45:16 -04001649 if (skia_use_lua) {
1650 sources += [ "samplecode/SampleLua.cpp" ]
1651 deps += [
1652 ":lua",
1653 "//third_party/lua",
1654 ]
1655 }
1656 }
1657 test_app("dm") {
1658 sources = [
1659 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001660 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001661 "dm/DMJsonWriter.cpp",
1662 "dm/DMSrcSink.cpp",
1663 ]
1664 include_dirs = [ "tests" ]
1665 deps = [
1666 ":common_flags",
Florin Malita54f65c42018-01-16 17:04:30 -05001667 ":experimental_skottie",
Florin Malita4aa44412017-12-19 12:21:02 -05001668 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001669 ":experimental_svg_model",
1670 ":flags",
1671 ":gm",
1672 ":gpu_tool_utils",
1673 ":skia",
1674 ":tests",
1675 ":tool_utils",
1676 "//third_party/jsoncpp",
1677 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001678 ]
1679 }
Brian Osman16adfa32016-10-18 14:42:44 -04001680 }
1681
Mike Kleina8a51ce2018-01-09 12:34:11 -05001682 if (!is_win) {
1683 test_app("remote_demo") {
1684 sources = [
1685 "tools/remote_demo.cpp",
1686 ]
1687 deps = [
1688 ":skia",
1689 ]
1690 }
1691 }
1692
Mike Kleine6682eb2017-01-05 10:54:57 -05001693 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001694 sources = [
1695 "bench/nanobench.cpp",
1696 ]
1697 deps = [
1698 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001699 ":common_flags",
Florin Malita4aa44412017-12-19 12:21:02 -05001700 ":experimental_sksg",
fmalita6519c212016-09-14 08:05:17 -07001701 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001702 ":flags",
1703 ":gm",
1704 ":gpu_tool_utils",
1705 ":skia",
1706 ":tool_utils",
1707 "//third_party/jsoncpp",
1708 ]
mtklein2b6870c2016-07-28 14:17:33 -07001709 }
halcanary19a97202016-08-03 15:08:04 -07001710
Ravi Mistry10d36c52017-01-31 09:49:18 -05001711 test_app("skpinfo") {
1712 sources = [
1713 "tools/skpinfo.cpp",
1714 ]
1715 deps = [
1716 ":flags",
1717 ":skia",
1718 ]
1719 }
1720
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001721 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001722 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001723 sources = [
1724 "tools/skpbench/skpbench.cpp",
1725 ]
1726 deps = [
1727 ":flags",
1728 ":gpu_tool_utils",
1729 ":skia",
1730 ":tool_utils",
1731 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001732 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001733 }
1734
Hal Canary96c57252018-02-09 11:43:05 -05001735 test_lib("skshaper") {
1736 public_include_dirs = [ "tools/shape" ]
1737 deps = [
1738 ":skia",
1739 ]
1740
Hal Canary8bb40832018-02-08 15:16:28 -05001741 if (target_cpu == "wasm") {
Hal Canary96c57252018-02-09 11:43:05 -05001742 sources = [
1743 "tools/shape/SkShaper_primitive.cpp",
1744 ]
1745 } else {
mtklein6f5df6a2016-08-29 16:01:10 -07001746 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001747 "tools/shape/SkShaper_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001748 ]
Hal Canary96c57252018-02-09 11:43:05 -05001749 deps += [
mtklein6f5df6a2016-08-29 16:01:10 -07001750 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001751 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001752 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001753 }
halcanary19a97202016-08-03 15:08:04 -07001754 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001755 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001756 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001757 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001758 ]
1759 deps = [
1760 ":skia",
Hal Canary96c57252018-02-09 11:43:05 -05001761 ":skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001762 ]
halcanary3eee9d92016-09-10 07:01:53 -07001763 }
mtklein046cb562016-09-16 10:23:12 -07001764
Matt Sarett9f1c4032017-05-17 10:06:32 -04001765 test_app("create_flutter_test_images") {
1766 sources = [
1767 "tools/create_flutter_test_images.cpp",
1768 ]
1769 deps = [
1770 ":skia",
1771 ":tool_utils",
1772 ]
1773 }
1774
Ben Wagner219f3622017-07-17 15:32:25 -04001775 test_app("create_test_font") {
1776 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001777 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001778 ]
1779 deps = [
1780 ":skia",
1781 ]
1782 assert_no_deps = [
1783 # tool_utils requires the output of this app.
1784 ":tool_utils",
1785 ]
1786 }
1787
Ben Wagner97182cc2018-02-15 10:20:04 -05001788 test_app("create_test_font_color") {
1789 sources = [
1790 "tools/fonts/create_test_font_color.cpp",
1791 ]
1792 deps = [
1793 ":flags",
1794 ":skia",
Florin Malitac659c2c2018-04-05 11:57:21 -04001795 ":tool_utils",
Ben Wagner97182cc2018-02-15 10:20:04 -05001796 ]
1797 }
1798
Mike Kleine6682eb2017-01-05 10:54:57 -05001799 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001800 sources = [
1801 "tools/get_images_from_skps.cpp",
1802 ]
1803 deps = [
1804 ":flags",
1805 ":skia",
1806 "//third_party/jsoncpp",
1807 ]
mtklein046cb562016-09-16 10:23:12 -07001808 }
mtkleinecbc5262016-09-22 11:51:24 -07001809
Kevin Lubickebf648e2017-09-21 13:45:16 -04001810 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001811 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001812 sources = [
1813 "tools/skiaserve/Request.cpp",
1814 "tools/skiaserve/Response.cpp",
1815 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001816 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1817 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1818 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1819 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1820 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1821 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1822 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1823 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1824 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001825 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1826 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001827 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1828 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1829 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1830 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1831 ]
1832 deps = [
1833 ":flags",
1834 ":gpu_tool_utils",
1835 ":skia",
1836 ":tool_utils",
1837 "//third_party/jsoncpp",
1838 "//third_party/libmicrohttpd",
1839 "//third_party/libpng",
1840 ]
Mike Klein7d302882016-11-03 14:06:31 -04001841 }
mtkleinecbc5262016-09-22 11:51:24 -07001842 }
kjlubick14f984b2016-10-03 11:49:45 -07001843
Mike Kleine6682eb2017-01-05 10:54:57 -05001844 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001845 include_dirs = [
1846 "tools",
1847 "tools/debugger",
1848 ]
kjlubick14f984b2016-10-03 11:49:45 -07001849 sources = [
Hal Canary24ac42b2017-02-14 13:35:14 -05001850 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001851 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001852 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001853 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001854 "fuzz/FuzzGradients.cpp",
1855 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001856 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001857 "fuzz/FuzzPathop.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001858 "fuzz/FuzzRegionOp.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001859 "fuzz/fuzz.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001860 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1861 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001862 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
1863 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001864 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1865 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001866 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001867 "tools/UrlDataManager.cpp",
1868 "tools/debugger/SkDebugCanvas.cpp",
1869 "tools/debugger/SkDrawCommand.cpp",
1870 "tools/debugger/SkJsonWriteBuffer.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001871 "tools/picture_utils.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001872 ]
1873 deps = [
Kevin Lubick9eeede22018-05-03 16:26:10 -04001874 ":experimental_skottie",
kjlubick14f984b2016-10-03 11:49:45 -07001875 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001876 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001877 ":skia",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001878 "//third_party/jsoncpp",
1879 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001880 ]
Florin Malita0b0d93d2018-05-04 15:01:03 -04001881
1882 if (skia_enable_skottie) {
1883 sources += [ "fuzz/oss_fuzz/FuzzSkottieJSON.cpp" ]
1884 }
kjlubick14f984b2016-10-03 11:49:45 -07001885 }
Mike Klein38312422016-10-05 15:41:01 -04001886
Mike Kleine6682eb2017-01-05 10:54:57 -05001887 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001888 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001889 rebase_path("tests/skia_test.cpp"),
1890 rebase_path("tests/Test.cpp"),
1891 ]
caryclark9feb6322016-10-25 08:58:26 -07001892 deps = [
1893 ":flags",
1894 ":gpu_tool_utils",
1895 ":skia",
1896 ":tool_utils",
1897 ]
caryclark9feb6322016-10-25 08:58:26 -07001898 }
1899
Mike Kleine6682eb2017-01-05 10:54:57 -05001900 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001901 sources = [
1902 "tools/DumpRecord.cpp",
1903 "tools/dump_record.cpp",
1904 ]
1905 deps = [
1906 ":flags",
1907 ":skia",
1908 ]
Mike Klein38312422016-10-05 15:41:01 -04001909 }
bungemanfe917272016-10-13 17:36:40 -04001910
Mike Kleine6682eb2017-01-05 10:54:57 -05001911 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001912 sources = [
1913 "tools/skdiff/skdiff.cpp",
1914 "tools/skdiff/skdiff_html.cpp",
1915 "tools/skdiff/skdiff_main.cpp",
1916 "tools/skdiff/skdiff_utils.cpp",
1917 ]
1918 deps = [
1919 ":skia",
1920 ":tool_utils",
1921 ]
bungemanfe917272016-10-13 17:36:40 -04001922 }
halcanarya73d76a2016-10-17 13:19:02 -07001923
Mike Kleine6682eb2017-01-05 10:54:57 -05001924 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001925 sources = [
1926 "tools/skp_parser.cpp",
1927 ]
1928 deps = [
1929 ":skia",
1930 ":tool_utils",
1931 "//third_party/jsoncpp",
1932 ]
halcanarya73d76a2016-10-17 13:19:02 -07001933 }
Brian Osman16adfa32016-10-18 14:42:44 -04001934
Hal Canaryd7b38452017-12-11 17:46:26 -05001935 if (!is_win && skia_enable_gpu) {
1936 test_lib("skqp_lib") {
1937 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001938 defines =
1939 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001940 if (skia_skqp_enable_driver_correctness_workarounds) {
1941 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1942 }
Hal Canary75427132017-10-11 16:00:31 -04001943 sources = [
1944 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001945 "tools/skqp/gm_knowledge.cpp",
1946 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001947 ]
1948 deps = [
1949 ":gm",
1950 ":gpu_tool_utils",
1951 ":skia",
1952 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001953 ":tool_utils",
1954 ]
1955 }
1956 test_app("skqp") {
1957 sources = [
1958 "tools/skqp/skqp.cpp",
1959 ]
1960 deps = [
1961 ":skia",
1962 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001963 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001964 "//third_party/googletest",
1965 ]
1966 }
1967 }
Hal Canary28f89382017-12-12 09:42:14 -05001968 if (is_android && skia_enable_gpu) {
1969 test_app("skqp_app") {
1970 is_shared_library = true
1971 sources = [
1972 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1973 ]
1974 deps = [
1975 ":skia",
1976 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001977 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001978 ]
1979 libs = [ "android" ]
1980 }
1981 }
Hal Canary75427132017-10-11 16:00:31 -04001982
Hal Canarya9de7602018-01-19 13:08:23 -05001983 test_app("list_gms") {
1984 sources = [
1985 "tools/list_gms.cpp",
1986 ]
1987 deps = [
1988 ":gm",
1989 ":skia",
1990 ]
1991 }
1992 test_app("list_gpu_unit_tests") {
1993 sources = [
1994 "dm/DMGpuTestProcs.cpp",
1995 "tools/list_gpu_unit_tests.cpp",
1996 ]
1997 deps = [
1998 ":skia",
1999 ":tests",
2000 ]
2001 }
2002
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002003 if (skia_enable_gpu) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002004 test_lib("sk_app") {
2005 public_include_dirs = [ "tools/sk_app" ]
Brian Osman16adfa32016-10-18 14:42:44 -04002006 sources = [
Brian Osmaneff04b52017-11-21 13:18:02 -05002007 "tools/sk_app/CommandSet.cpp",
2008 "tools/sk_app/GLWindowContext.cpp",
2009 "tools/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002010 ]
Brian Osman2dd96932016-10-18 15:33:53 -04002011 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04002012
Jim Van Verth4e56a912016-10-21 10:58:52 -04002013 if (is_android) {
2014 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002015 "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",
Jim Van Verth4e56a912016-10-21 10:58:52 -04002020 ]
Brian Osman462334e2017-02-09 11:22:57 -05002021 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002022 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04002023 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002024 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2025 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2026 "tools/sk_app/unix/Window_unix.cpp",
Brian Osmanfa916272017-12-01 09:18:20 -05002027 "tools/sk_app/unix/keysym2ucs.c",
Brian Osmaneff04b52017-11-21 13:18:02 -05002028 "tools/sk_app/unix/main_unix.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04002029 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002030 libs += [
2031 "GL",
2032 "X11",
2033 ]
Brian Osman2dd96932016-10-18 15:33:53 -04002034 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04002035 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002036 "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",
Brian Osman16adfa32016-10-18 14:42:44 -04002040 ]
Brian Salomon194db172017-08-17 14:37:06 -04002041 if (skia_use_angle) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002042 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002043 }
Mike Klein43c25262016-10-20 10:17:47 -04002044 } else if (is_mac) {
2045 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002046 "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",
Mike Klein43c25262016-10-20 10:17:47 -04002050 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002051 libs += [
2052 "QuartzCore.framework",
2053 "Cocoa.framework",
2054 "Foundation.framework",
2055 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002056 } else if (is_ios) {
2057 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002058 "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",
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002062 ]
Brian Osman16adfa32016-10-18 14:42:44 -04002063 }
2064
2065 if (skia_use_vulkan) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002066 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002067 if (is_android) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002068 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002069 } else if (is_linux) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002070 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
Brian Osman2dd96932016-10-18 15:33:53 -04002071 libs += [ "X11-xcb" ]
2072 } else if (is_win) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002073 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Brian Osman16adfa32016-10-18 14:42:44 -04002074 }
2075 }
2076
Brian Osman16adfa32016-10-18 14:42:44 -04002077 deps = [
Brian Osman16adfa32016-10-18 14:42:44 -04002078 ":gpu_tool_utils",
Brian Osman16adfa32016-10-18 14:42:44 -04002079 ":skia",
2080 ":tool_utils",
2081 ":views",
Brian Osman16adfa32016-10-18 14:42:44 -04002082 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002083 if (is_android) {
2084 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002085 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04002086 deps += [ "//third_party/libsdl" ]
2087 }
Brian Salomon194db172017-08-17 14:37:06 -04002088 if (skia_use_angle) {
2089 deps += [ "//third_party/angle2" ]
2090 }
Mike Kleina92c3832016-12-08 09:49:39 -05002091 }
Brian Osman16adfa32016-10-18 14:42:44 -04002092 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002093
Brian Osmaneff04b52017-11-21 13:18:02 -05002094 if (skia_enable_gpu) {
2095 test_app("viewer") {
2096 is_shared_library = is_android
Jim Van Verth329c5a62017-11-29 11:42:33 -05002097 if (is_ios) {
2098 bundle_ios_data = true
2099 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002100 sources = [
Chris Dalton2d18f412018-02-20 13:23:32 -07002101 "tools/viewer/BisectSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002102 "tools/viewer/GMSlide.cpp",
Brian Osmand67e5182017-12-08 16:46:09 -05002103 "tools/viewer/ImGuiLayer.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002104 "tools/viewer/ImageSlide.cpp",
2105 "tools/viewer/SKPSlide.cpp",
2106 "tools/viewer/SampleSlide.cpp",
Florin Malita76a076b2018-02-15 18:40:48 -05002107 "tools/viewer/SlideDir.cpp",
Brian Osman56a24812017-12-19 11:15:16 -05002108 "tools/viewer/StatsLayer.cpp",
Florin Malitac659c2c2018-04-05 11:57:21 -04002109 "tools/viewer/SvgSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002110 "tools/viewer/Viewer.cpp",
2111 ]
2112 libs = []
2113
2114 include_dirs = []
2115 deps = [
Florin Malitabcd07232018-01-31 11:08:58 -05002116 ":experimental_sksg",
Florin Malitac659c2c2018-04-05 11:57:21 -04002117 ":experimental_svg_model",
Brian Osmaneff04b52017-11-21 13:18:02 -05002118 ":flags",
2119 ":gm",
2120 ":gpu_tool_utils",
2121 ":samples",
2122 ":sk_app",
2123 ":skia",
2124 ":tool_utils",
2125 ":views",
2126 "//third_party/imgui",
2127 "//third_party/jsoncpp",
2128 ]
Florin Malita87ccf332018-05-04 12:23:24 -04002129
2130 if (skia_enable_skottie) {
2131 sources += [ "tools/viewer/SkottieSlide.cpp" ]
2132 deps += [ ":experimental_skottie" ]
2133 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002134 }
2135 }
2136
2137 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
2138 test_app("HelloWorld") {
2139 sources = [
2140 "example/HelloWorld.cpp",
2141 ]
2142 libs = []
2143
2144 include_dirs = []
2145 deps = [
2146 ":flags",
2147 ":gpu_tool_utils",
2148 ":sk_app",
2149 ":skia",
2150 ":tool_utils",
2151 ":views",
2152 ]
2153 }
2154 }
2155
Jim Van Verthecfed2b2017-08-30 14:02:50 -04002156 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002157 test_app("SkiaSDLExample") {
2158 sources = [
2159 "example/SkiaSDLExample.cpp",
2160 ]
2161 libs = []
2162 include_dirs = []
2163 deps = [
2164 ":gpu_tool_utils",
2165 ":skia",
2166 "//third_party/libsdl",
2167 ]
2168 }
2169 }
2170
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002171 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2172 action_foreach("generate_mocs") {
2173 script = "gn/call.py"
2174 sources = [
2175 "tools/mdbviz/MainWindow.h",
2176 ]
2177 outputs = [
2178 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2179 ]
2180 args = [
2181 "$skia_qt_path" + "/bin/moc",
2182 "{{source}}",
2183 "-o",
2184 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2185 ]
2186 }
2187 action_foreach("generate_resources") {
2188 script = "gn/call.py"
2189 sources = [
2190 "tools/mdbviz/resources.qrc",
2191 ]
2192 outputs = [
2193 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2194 ]
2195 args = [
2196 "$skia_qt_path" + "/bin/rcc",
2197 "{{source}}",
2198 "-o",
2199 "gen/mdbviz/{{source_name_part}}_res.cpp",
2200 ]
2201 }
2202 test_app("mdbviz") {
2203 if (is_win) {
2204 # on Windows we need to disable some exception handling warnings due to the Qt headers
2205 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2206 }
2207 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002208 "tools/UrlDataManager.cpp",
2209 "tools/debugger/SkDebugCanvas.cpp",
2210 "tools/debugger/SkDrawCommand.cpp",
2211 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002212 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002213 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002214 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002215 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002216
2217 # generated files
2218 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2219 "$target_gen_dir/mdbviz/resources_res.cpp",
2220 ]
2221 lib_dirs = [ "$skia_qt_path/lib" ]
2222 libs = [
2223 "Qt5Core.lib",
2224 "Qt5Gui.lib",
2225 "Qt5Widgets.lib",
2226 ]
2227 include_dirs = [
2228 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002229 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002230 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002231 "tools",
2232 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002233 ]
2234 deps = [
2235 ":generate_mocs",
2236 ":generate_resources",
2237 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002238 "//third_party/jsoncpp",
2239 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002240 ]
2241 }
2242 }
2243
Mike Kleine459afd2017-03-03 09:21:30 -05002244 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002245 copy("gdbserver") {
2246 sources = [
2247 "$ndk/$ndk_gdbserver",
2248 ]
2249 outputs = [
2250 "$root_out_dir/gdbserver",
2251 ]
2252 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002253 }
mtklein25c81d42016-07-27 13:55:26 -07002254}