blob: aee0fd1a1e9f245da6cb12a210891cf92608e454 [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
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040042 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050043 skia_enable_tools = is_skia_dev_build
44 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Danielafb7ec72017-12-07 12:48:30 -050045 skia_vulkan_header = ""
Greg Daniel686bb212016-10-27 10:48:48 -040046 skia_vulkan_sdk = getenv("VULKAN_SDK")
Chris Dalton3a67b8e2018-05-03 09:30:29 -060047 skia_moltenvk_path = ""
Robert Phillipsa6d2d702017-09-01 12:17:03 -040048 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040049 skia_compile_processors = false
Adrienne Walker1df7cd82018-04-18 13:46:25 -070050 skia_generate_workarounds = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070051 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040052
Hal Canary4689b542018-01-31 11:54:14 -050053 skia_skqp_enable_driver_correctness_workarounds = false
Hal Canary2331c822018-02-01 14:06:13 -050054 skia_skqp_global_error_tolerance = 0
Ethan Nicholas26a9aad2018-03-27 14:10:52 -040055
56 skia_llvm_path = ""
57 skia_llvm_lib = "LLVM"
Hal Canaryfd9bcab2018-04-24 11:47:23 -040058
59 skia_tools_require_resources = false
mtkleinc04ff472016-06-23 10:29:30 -070060}
Brian Salomon23d73ea2016-10-27 13:31:37 -040061declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040062 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040063 skia_use_sfntly = skia_use_icu
Brian Salomoncbcb0a12017-11-19 13:20:13 -050064 skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu
Mike Klein10d665d2016-11-01 11:46:10 -040065
Brian Salomon5f33a8c2018-02-26 14:32:39 -050066 skia_use_legacy_gpu_pixel_ops = is_skia_dev_build && is_win # Arbitrary to keep old code path tested until deletion.
67
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 {
Chris Dalton3a67b8e2018-05-03 09:30:29 -060073 skia_use_vulkan = skia_vulkan_sdk != "" || skia_moltenvk_path != ""
Mike Klein4d598a32016-10-31 13:44:49 -040074 }
Jim Van Verth4e502972017-12-07 15:16:10 -050075
76 if (is_ios) {
77 skia_ios_identity = ".*Google.*"
78 skia_ios_profile = "Google Development"
79 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040080}
Greg Danielec6ae522017-04-25 13:38:26 -040081declare_args() {
Greg Danielafb7ec72017-12-07 12:48:30 -050082 skia_tools_vulkan_header_dir = ""
Greg Danielec6ae522017-04-25 13:38:26 -040083 if (skia_use_vulkan) {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000084 # When buliding on Android we get the header via the NDK so no need for any extra path.
Greg Danielec6ae522017-04-25 13:38:26 -040085 if (is_fuchsia) {
Greg Danielafb7ec72017-12-07 12:48:30 -050086 skia_tools_vulkan_header_dir = "$fuchsia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040087 } else if (is_linux || is_win) {
Greg Danielafb7ec72017-12-07 12:48:30 -050088 skia_tools_vulkan_header_dir = "$skia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040089 }
Greg Danielec6ae522017-04-25 13:38:26 -040090 }
91}
Brian Salomon789e25e2016-09-30 13:41:03 -040092
Adam Barth54ef74a2017-10-13 10:59:38 -070093if (defined(skia_settings)) {
94 import(skia_settings)
95}
96
mtklein38925aa2016-09-21 10:11:25 -070097# Our tools require static linking (they use non-exported symbols).
98skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070099
mtkleina45be612016-08-29 15:22:10 -0700100fontmgr_android_enabled = skia_use_expat && skia_use_freetype
101
mtklein1211e0c2016-07-26 13:55:45 -0700102skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -0700103 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -0700104 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -0700105 "include/codec",
106 "include/config",
107 "include/core",
108 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -0400109 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -0700110 "include/gpu",
111 "include/gpu/gl",
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
Greg Danielafb7ec72017-12-07 12:48:30 -0500133 if (skia_tools_vulkan_header_dir != "") {
134 include_dirs += [ skia_tools_vulkan_header_dir ]
Greg Danielec6ae522017-04-25 13:38:26 -0400135 }
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
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600227config("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) {
660 public_defines += [ "SK_VULKAN" ]
661 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 }
Greg Danielafb7ec72017-12-07 12:48:30 -0500665 if (skia_vulkan_header != "") {
666 public_defines += [ "SK_VULKAN_HEADER=\"$skia_vulkan_header\"" ]
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600667 } 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" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500674 }
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 Kleinfb333552018-01-25 12:49:37 -0500777optional("skcms") {
778 enabled = skia_use_skcms
779
Brian Osman094fba92018-03-26 17:05:48 -0400780 public_defines = [ "SK_USE_SKCMS" ]
Mike Kleinfb333552018-01-25 12:49:37 -0500781 deps = [
Brian Osman1b4faa72018-04-23 13:06:36 -0400782 "third_party/skcms",
Mike Kleinfb333552018-01-25 12:49:37 -0500783 ]
784 sources = [
Brian Osman094fba92018-03-26 17:05:48 -0400785 "src/core/SkColorSpaceXform_skcms.cpp",
Mike Kleinfb333552018-01-25 12:49:37 -0500786 ]
787}
788
mtklein3cc22182016-08-29 13:26:14 -0700789optional("typeface_freetype") {
790 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700791
792 deps = [
793 "//third_party/freetype2",
794 ]
795 sources = [
796 "src/ports/SkFontHost_FreeType.cpp",
797 "src/ports/SkFontHost_FreeType_common.cpp",
798 ]
799}
800
mtklein457b42a2016-08-23 13:56:37 -0700801optional("webp") {
802 enabled = skia_use_libwebp
803 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
804
mtklein457b42a2016-08-23 13:56:37 -0700805 deps = [
806 "//third_party/libwebp",
807 ]
808 sources = [
809 "src/codec/SkWebpAdapterCodec.cpp",
810 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400811 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700812 ]
mtkleineb3c4252016-08-23 07:38:09 -0700813}
814
mtklein63213812016-08-24 09:55:56 -0700815optional("xml") {
816 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000817 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700818
mtklein63213812016-08-24 09:55:56 -0700819 deps = [
820 "//third_party/expat",
821 ]
822 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500823 "src/svg/SkSVGCanvas.cpp",
824 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700825 "src/xml/SkDOM.cpp",
826 "src/xml/SkXMLParser.cpp",
827 "src/xml/SkXMLWriter.cpp",
828 ]
829}
830
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700831if (skia_enable_gpu && skia_generate_workarounds) {
832 action("workaround_list") {
833 script = "tools/build_workaround_header.py"
834
835 inputs = [
836 "src/gpu/gpu_workaround_list.txt",
837 ]
838
839 # see comments in skia_compile_processors about out dir path shenanigans.
840 output_file =
841 rebase_path("src/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
842
843 outputs = [
844 "$root_out_dir/$output_file",
845 ]
846 args = [
847 "--output-file",
848 "$output_file",
849 ]
850
851 foreach(file, inputs) {
852 args += [ rebase_path(file, root_build_dir) ]
853 }
854 }
855}
856
mtkleinc04ff472016-06-23 10:29:30 -0700857component("skia") {
858 public_configs = [ ":skia_public" ]
859 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700860
861 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700862 ":arm64",
863 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700864 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700865 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500866 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700867 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700868 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500869 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700870 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700871 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700872 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400873 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500874 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700875 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700876 ":none",
mtklein63213812016-08-24 09:55:56 -0700877 ":pdf",
878 ":png",
scroggof84ad642016-10-31 09:02:57 -0700879 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500880 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700881 ":sse2",
882 ":sse41",
883 ":sse42",
884 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700885 ":webp",
mtklein63213812016-08-24 09:55:56 -0700886 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700887 ]
888
Chinmay Garde43f115c2016-11-16 15:04:12 -0800889 # This file (and all GN files in Skia) are designed to work with an
890 # empty sources assignment filter; we handle all that explicitly.
891 # We clear the filter here for clients who may have set up a global filter.
892 set_sources_assignment_filter([])
893
mtkleinc04ff472016-06-23 10:29:30 -0700894 sources = []
brettwb9447282016-09-01 14:24:39 -0700895 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700896 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500897 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700898 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400899 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500900 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700901 "src/android/SkBitmapRegionCodec.cpp",
902 "src/android/SkBitmapRegionDecoder.cpp",
903 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400904 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700905 "src/codec/SkBmpCodec.cpp",
906 "src/codec/SkBmpMaskCodec.cpp",
907 "src/codec/SkBmpRLECodec.cpp",
908 "src/codec/SkBmpStandardCodec.cpp",
909 "src/codec/SkCodec.cpp",
910 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700911 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700912 "src/codec/SkMaskSwizzler.cpp",
913 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700914 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700915 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700916 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700917 "src/codec/SkSwizzler.cpp",
918 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700919 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700920 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700921 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700922 "src/ports/SkMemory_malloc.cpp",
923 "src/ports/SkOSFile_stdio.cpp",
924 "src/sfnt/SkOTTable_name.cpp",
925 "src/sfnt/SkOTUtils.cpp",
926 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700927 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700928 ]
brettwb9447282016-09-01 14:24:39 -0700929
mtklein7d6fb2c2016-08-25 14:50:44 -0700930 libs = []
931
mtkleinc04ff472016-06-23 10:29:30 -0700932 if (is_win) {
933 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400934 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700935 "src/ports/SkDebug_win.cpp",
936 "src/ports/SkFontHost_win.cpp",
937 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500938 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700939 "src/ports/SkImageEncoder_WIC.cpp",
940 "src/ports/SkImageGeneratorWIC.cpp",
941 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700942 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700943 "src/ports/SkScalerContext_win_dw.cpp",
944 "src/ports/SkTLS_win.cpp",
945 "src/ports/SkTypeface_win_dw.cpp",
946 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400947 libs += [
948 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500949 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400950 "Ole32.lib",
951 "OleAut32.lib",
952 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500953 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400954 ]
mtkleinc04ff472016-06-23 10:29:30 -0700955 } else {
956 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700957 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700958 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700959 "src/ports/SkTLS_pthread.cpp",
960 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400961 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700962 }
963
mtklein7d6fb2c2016-08-25 14:50:44 -0700964 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500965 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500966 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500967 deps += [ "//third_party/cpu-features" ]
968 }
mtklein06c35c02016-09-20 12:28:12 -0700969 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700970 libs += [
971 "EGL",
972 "GLESv2",
973 "log",
974 ]
975 }
976
mtkleinc04ff472016-06-23 10:29:30 -0700977 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700978 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400979 if (skia_use_egl) {
980 libs += [ "GLESv2" ]
981 }
mtkleinc04ff472016-06-23 10:29:30 -0700982 }
983
984 if (is_mac) {
985 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700986 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700987 "src/ports/SkFontHost_mac.cpp",
988 "src/ports/SkImageEncoder_CG.cpp",
989 "src/ports/SkImageGeneratorCG.cpp",
990 ]
mtklein09e61f72016-08-23 13:35:28 -0700991 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400992 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
993 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700994 "ApplicationServices.framework",
995 "OpenGL.framework",
996 ]
mtkleinc04ff472016-06-23 10:29:30 -0700997 }
abarth6fc8ff02016-07-15 15:15:15 -0700998
Mike Klein7d302882016-11-03 14:06:31 -0400999 if (is_ios) {
1000 sources += [
1001 "src/ports/SkDebug_stdio.cpp",
1002 "src/ports/SkFontHost_mac.cpp",
1003 "src/ports/SkImageEncoder_CG.cpp",
1004 "src/ports/SkImageGeneratorCG.cpp",
1005 ]
1006 libs += [
1007 "CoreFoundation.framework",
1008 "CoreGraphics.framework",
1009 "CoreText.framework",
1010 "ImageIO.framework",
1011 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -04001012
1013 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
1014 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001015 ]
1016 }
1017
abarth6fc8ff02016-07-15 15:15:15 -07001018 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001019 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001020 }
mtkleinc04ff472016-06-23 10:29:30 -07001021}
1022
mtkleinc095df52016-08-24 12:23:52 -07001023# Targets guarded by skia_enable_tools may use //third_party freely.
1024if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001025 # Used by gn_to_bp.py to list our public include dirs.
1026 source_set("public") {
1027 configs += [ ":skia_public" ]
1028 }
1029
Mike Kleinc36dedf2016-11-18 09:35:28 -05001030 config("skia.h_config") {
1031 include_dirs = [ "$target_gen_dir" ]
Greg Danielafb7ec72017-12-07 12:48:30 -05001032 if (skia_use_vulkan) {
1033 # So we can get the header which includes vulkan
1034 include_dirs += [ "tools/gpu/vk" ]
1035 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001036 }
1037 action("skia.h") {
1038 public_configs = [ ":skia.h_config" ]
1039 skia_h = "$target_gen_dir/skia.h"
1040 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -04001041 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +00001042 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001043 depfile = "$skia_h.deps"
1044 outputs = [
1045 skia_h,
1046 ]
1047 }
1048
1049 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001050 executable("fiddle") {
1051 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001052 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001053 "tools/fiddle/draw.cpp",
1054 "tools/fiddle/fiddle_main.cpp",
1055 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001056
1057 if (skia_use_egl) {
1058 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001059 } else {
1060 sources += [ "tools/fiddle/null_context.cpp" ]
1061 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001062 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001063 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001064 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001065 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001066 ":skia",
1067 ":skia.h",
1068 ]
1069 }
1070 }
1071
1072 if (skia_enable_gpu) {
1073 source_set("public_headers_warnings_check") {
1074 sources = [
1075 "tools/public_headers_warnings_check.cpp",
1076 ]
1077 configs -= [ "//gn:warnings_except_public_headers" ]
1078 deps = [
1079 ":skia",
1080 ":skia.h",
1081 ]
1082 }
1083 }
1084
mtkleinc095df52016-08-24 12:23:52 -07001085 template("test_lib") {
1086 config(target_name + "_config") {
1087 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001088 if (defined(invoker.public_defines)) {
1089 defines = invoker.public_defines
1090 }
mtklein25c81d42016-07-27 13:55:26 -07001091 }
mtkleinc095df52016-08-24 12:23:52 -07001092 source_set(target_name) {
1093 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1094 public_configs = [
1095 ":" + target_name + "_config",
1096 ":skia_private",
1097 ]
1098
1099 if (!defined(deps)) {
1100 deps = []
1101 }
1102 deps += [ ":skia" ]
1103 testonly = true
1104 }
mtklein25c81d42016-07-27 13:55:26 -07001105 }
mtklein25c81d42016-07-27 13:55:26 -07001106
Mike Kleine6682eb2017-01-05 10:54:57 -05001107 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001108 if (is_ios) {
1109 app_name = target_name
1110 gen_path = target_gen_dir
1111
1112 action("${app_name}_generate_info_plist") {
1113 script = "//gn/gen_plist_ios.py"
1114 outputs = [
1115 "$gen_path/${app_name}_Info.plist",
1116 ]
1117 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1118 }
1119
1120 bundle_data("${app_name}_bundle_info_plist") {
1121 public_deps = [
1122 ":${app_name}_generate_info_plist",
1123 ]
1124 sources = [
1125 "$gen_path/${app_name}_Info.plist",
1126 ]
1127 outputs = [
1128 "{{bundle_root_dir}}/Info.plist",
1129 ]
1130 }
1131
Jim Van Verth329c5a62017-11-29 11:42:33 -05001132 bundle_ios_data =
1133 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1134
1135 if (bundle_ios_data) {
1136 has_skps =
1137 "True" == exec_script("//gn/checkdir.py",
1138 [ rebase_path("skps", root_build_dir) ],
1139 "trim string")
1140 bundle_data("${app_name}_bundle_resources") {
1141 sources = [
1142 "resources",
1143 ]
1144 outputs = [
1145 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1146 "{{bundle_resources_dir}}/data/resources",
1147 ]
1148 }
1149
1150 if (has_skps) {
1151 bundle_data("${app_name}_bundle_skps") {
1152 sources = [
1153 "skps",
1154 ]
1155 outputs = [
1156 # Store in same folder as resources
1157 "{{bundle_resources_dir}}/data/skps",
1158 ]
1159 }
1160 }
1161 }
1162
Jim Van Verth443a9132017-11-28 09:45:26 -05001163 executable("${app_name}_generate_executable") {
1164 forward_variables_from(invoker,
1165 "*",
1166 [
1167 "output_name",
1168 "visibility",
1169 "is_shared_library",
1170 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001171 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001172 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001173 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1174 }
1175
1176 bundle_data("${app_name}_bundle_executable") {
1177 public_deps = [
1178 ":${app_name}_generate_executable",
1179 ]
1180 sources = [
1181 "$gen_path/$app_name",
1182 ]
1183 outputs = [
1184 "{{bundle_executable_dir}}/$app_name",
1185 ]
1186 testonly = true
1187 }
1188
1189 create_bundle("$app_name") {
1190 product_type = "com.apple.product-type.application"
1191 testonly = true
1192
1193 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1194 bundle_resources_dir = bundle_root_dir
1195 bundle_executable_dir = bundle_root_dir
1196 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1197
1198 deps = [
1199 ":${app_name}_bundle_executable",
1200 ":${app_name}_bundle_info_plist",
1201 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001202 if (bundle_ios_data) {
1203 deps += [ ":${app_name}_bundle_resources" ]
1204 if (has_skps) {
1205 deps += [ ":${app_name}_bundle_skps" ]
1206 }
1207 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001208
1209 # should only code sign when running on a device, not the simulator
1210 if (target_cpu != "x64") {
1211 code_signing_script = "//gn/codesign_ios.py"
1212 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1213 code_signing_outputs = [
1214 "$bundle_root_dir/_CodeSignature/CodeResources",
1215 "$bundle_root_dir/embedded.mobileprovision",
1216 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001217 code_signing_args = [
1218 rebase_path("$bundle_root_dir", root_build_dir),
1219 skia_ios_identity,
1220 skia_ios_profile,
1221 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001222 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001223 }
1224 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001225 # !is_ios
1226
1227 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1228 shared_library("lib" + target_name) {
1229 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1230 configs += [ ":skia_private" ]
1231 testonly = true
1232 }
1233 } else {
1234 _executable = target_name
1235 executable(_executable) {
1236 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1237 configs += [ ":skia_private" ]
1238 testonly = true
1239 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001240 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001241 if (is_android && skia_android_serial != "" && defined(_executable)) {
1242 action("push_" + target_name) {
1243 script = "gn/push_to_android.py"
1244 deps = [
1245 ":" + _executable,
1246 ]
1247 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1248 outputs = [
1249 _stamp,
1250 ]
1251 args = [
1252 rebase_path("$root_build_dir/$_executable"),
1253 skia_android_serial,
1254 rebase_path(_stamp),
1255 ]
1256 testonly = true
1257 }
Mike Klein7d921032017-01-05 12:20:41 -05001258 }
1259 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001260 }
1261
mtkleinc095df52016-08-24 12:23:52 -07001262 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001263 public_include_dirs = []
1264 if (skia_enable_gpu) {
1265 public_defines = []
1266 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001267
1268 deps = []
mtklein38925aa2016-09-21 10:11:25 -07001269 sources = [
1270 "tools/gpu/GrContextFactory.cpp",
1271 "tools/gpu/GrTest.cpp",
Brian Salomon58389b92018-03-07 13:01:25 -05001272 "tools/gpu/ProxyUtils.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001273 "tools/gpu/TestContext.cpp",
Brian Salomoncbcb0a12017-11-19 13:20:13 -05001274 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001275 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001276 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001277 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1278 "tools/gpu/gl/debug/GrBufferObj.cpp",
1279 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1280 "tools/gpu/gl/debug/GrProgramObj.cpp",
1281 "tools/gpu/gl/debug/GrShaderObj.cpp",
1282 "tools/gpu/gl/debug/GrTextureObj.cpp",
1283 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1284 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001285 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001286 ]
1287 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001288
Kevin Lubick4a24e102017-03-29 11:19:01 -04001289 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001290 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001291 } else if (is_ios) {
1292 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1293 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001294 } else if (is_linux) {
1295 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001296 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001297 } else if (is_mac) {
1298 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001299 } else if (is_win) {
1300 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1301 libs += [
1302 "Gdi32.lib",
1303 "OpenGL32.lib",
1304 ]
mtklein38925aa2016-09-21 10:11:25 -07001305 }
mtklein6ef69992016-09-14 06:12:09 -07001306
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001307 cflags_objcc = [ "-fobjc-arc" ]
1308
Mike Kleinc168a3a2016-11-14 14:53:13 +00001309 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001310 deps += [ "//third_party/angle2" ]
1311 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1312 }
mtkleind68f9b02016-09-23 13:18:41 -07001313 if (skia_use_vulkan) {
1314 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001315 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001316 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001317 if (skia_use_metal) {
1318 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1319 }
mtkleina627b5c2016-09-20 13:36:47 -07001320 }
mtklein25c81d42016-07-27 13:55:26 -07001321 }
mtklein25c81d42016-07-27 13:55:26 -07001322
mtkleinc095df52016-08-24 12:23:52 -07001323 test_lib("flags") {
1324 public_include_dirs = [ "tools/flags" ]
1325 sources = [
1326 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001327 ]
1328 }
1329 test_lib("common_flags") {
1330 public_include_dirs = [ "tools/flags" ]
1331 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001332 "tools/flags/SkCommonFlags.cpp",
1333 "tools/flags/SkCommonFlagsConfig.cpp",
1334 ]
1335 deps = [
mtklein046cb562016-09-16 10:23:12 -07001336 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001337 ":gpu_tool_utils",
1338 ]
1339 }
mtklein25c81d42016-07-27 13:55:26 -07001340
mtkleinc095df52016-08-24 12:23:52 -07001341 test_lib("tool_utils") {
1342 public_include_dirs = [
1343 "tools",
1344 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001345 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001346 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001347 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001348 ]
1349 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001350 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001351 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001352 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001353 "tools/ProcStats.cpp",
1354 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001355 "tools/UrlDataManager.cpp",
1356 "tools/debugger/SkDebugCanvas.cpp",
1357 "tools/debugger/SkDrawCommand.cpp",
1358 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001359 "tools/fonts/SkRandomScalerContext.cpp",
1360 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001361 "tools/fonts/SkTestFontMgr.h",
1362 "tools/fonts/SkTestSVGTypeface.cpp",
1363 "tools/fonts/SkTestSVGTypeface.h",
1364 "tools/fonts/SkTestTypeface.cpp",
1365 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001366 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001367 "tools/picture_utils.cpp",
1368 "tools/random_parse_path.cpp",
1369 "tools/sk_tool_utils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001370 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001371 "tools/trace/SkChromeTracingTracer.cpp",
1372 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001373 "tools/trace/SkDebugfTracer.cpp",
1374 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001375 "tools/trace/SkEventTracingPriv.cpp",
1376 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001377 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001378 libs = []
1379 if (is_ios) {
1380 sources += [ "tools/ios_utils.m" ]
1381 libs += [ "Foundation.framework" ]
1382 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001383 defines = []
1384 if (skia_tools_require_resources) {
1385 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1386 }
mtkleinc095df52016-08-24 12:23:52 -07001387 deps = [
mtklein046cb562016-09-16 10:23:12 -07001388 ":common_flags",
Ben Wagner97182cc2018-02-15 10:20:04 -05001389 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001390 ":flags",
1391 "//third_party/libpng",
1392 ]
1393 public_deps = [
1394 "//third_party/jsoncpp",
1395 ]
1396 }
mtklein25c81d42016-07-27 13:55:26 -07001397
Mike Klein6e744122016-10-27 12:21:40 -04001398 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001399 test_lib("gm") {
1400 public_include_dirs = [ "gm" ]
1401 sources = gm_sources
1402 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001403 ":experimental_sksg",
scroggo19b91532016-10-24 09:03:26 -07001404 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001405 ":gpu_tool_utils",
1406 ":skia",
1407 ":tool_utils",
1408 ]
1409 }
mtklein25c81d42016-07-27 13:55:26 -07001410
Mike Klein6e744122016-10-27 12:21:40 -04001411 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001412 test_lib("tests") {
1413 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001414 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001415 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001416 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001417 }
mtkleinc095df52016-08-24 12:23:52 -07001418 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001419 ":experimental_sksg",
Hal Canary0f666812018-03-22 15:21:12 -04001420 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001421 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001422 ":skia",
1423 ":tool_utils",
1424 "//third_party/libpng",
Brian Osman12e4e842018-04-27 12:03:51 -04001425 "//third_party/skcms",
mtkleinc095df52016-08-24 12:23:52 -07001426 "//third_party/zlib",
1427 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001428 public_deps = [
1429 ":gpu_tool_utils", # Test.h #includes headers from this target.
1430 ]
mtkleinc095df52016-08-24 12:23:52 -07001431 }
mtklein2f3416d2016-08-02 16:02:05 -07001432
Mike Klein6e744122016-10-27 12:21:40 -04001433 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001434 test_lib("bench") {
1435 public_include_dirs = [ "bench" ]
1436 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001437 deps = [
1438 ":flags",
1439 ":gm",
1440 ":gpu_tool_utils",
1441 ":skia",
1442 ":tool_utils",
1443 ]
1444 }
mtklein2b6870c2016-07-28 14:17:33 -07001445
Florin Malita54f65c42018-01-16 17:04:30 -05001446 test_lib("experimental_skottie") {
1447 public_include_dirs = [ "experimental/skottie" ]
Florin Malita094ccde2017-12-30 12:27:00 -05001448 include_dirs = [ "tools" ]
1449 sources = [
Florin Malita54f65c42018-01-16 17:04:30 -05001450 "experimental/skottie/Skottie.cpp",
Florin Malitaa6e30f72018-03-23 13:41:58 -04001451 "experimental/skottie/SkottieAdapter.cpp",
Florin Malita54f65c42018-01-16 17:04:30 -05001452 "experimental/skottie/SkottieAnimator.cpp",
Florin Malitacf8ed522018-01-25 15:27:33 -05001453 "experimental/skottie/SkottieParser.cpp",
Florin Malitaa6e30f72018-03-23 13:41:58 -04001454 "experimental/skottie/SkottieValue.cpp",
Florin Malita094ccde2017-12-30 12:27:00 -05001455 ]
1456 deps = [
1457 ":experimental_sksg",
1458 ":skia",
1459 "//third_party/jsoncpp",
1460 ]
1461 }
1462
mtkleinc095df52016-08-24 12:23:52 -07001463 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001464 public_include_dirs = []
1465 if (skia_use_expat) {
1466 public_include_dirs += [ "experimental/svg/model" ]
1467 sources = [
1468 "experimental/svg/model/SkSVGAttribute.cpp",
1469 "experimental/svg/model/SkSVGAttributeParser.cpp",
1470 "experimental/svg/model/SkSVGCircle.cpp",
1471 "experimental/svg/model/SkSVGClipPath.cpp",
1472 "experimental/svg/model/SkSVGContainer.cpp",
1473 "experimental/svg/model/SkSVGDOM.cpp",
1474 "experimental/svg/model/SkSVGEllipse.cpp",
1475 "experimental/svg/model/SkSVGGradient.cpp",
1476 "experimental/svg/model/SkSVGLine.cpp",
1477 "experimental/svg/model/SkSVGLinearGradient.cpp",
1478 "experimental/svg/model/SkSVGNode.cpp",
1479 "experimental/svg/model/SkSVGPath.cpp",
1480 "experimental/svg/model/SkSVGPattern.cpp",
1481 "experimental/svg/model/SkSVGPoly.cpp",
1482 "experimental/svg/model/SkSVGRadialGradient.cpp",
1483 "experimental/svg/model/SkSVGRect.cpp",
1484 "experimental/svg/model/SkSVGRenderContext.cpp",
1485 "experimental/svg/model/SkSVGSVG.cpp",
1486 "experimental/svg/model/SkSVGShape.cpp",
1487 "experimental/svg/model/SkSVGStop.cpp",
1488 "experimental/svg/model/SkSVGTransformableNode.cpp",
1489 "experimental/svg/model/SkSVGUse.cpp",
1490 "experimental/svg/model/SkSVGValue.cpp",
1491 ]
1492 deps = [
1493 ":skia",
1494 ":xml",
1495 ]
1496 }
mtkleinc095df52016-08-24 12:23:52 -07001497 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001498
Florin Malita4aa44412017-12-19 12:21:02 -05001499 test_lib("experimental_sksg") {
1500 public_include_dirs = [
1501 "experimental/sksg",
1502 "experimental/sksg/effects",
1503 "experimental/sksg/geometry",
1504 "experimental/sksg/paint",
1505 ]
1506 sources = [
1507 "experimental/sksg/SkSGDraw.cpp",
1508 "experimental/sksg/SkSGEffectNode.cpp",
1509 "experimental/sksg/SkSGGeometryNode.cpp",
1510 "experimental/sksg/SkSGGroup.cpp",
Florin Malita49328072018-01-08 12:51:12 -05001511 "experimental/sksg/SkSGImage.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001512 "experimental/sksg/SkSGInvalidationController.cpp",
1513 "experimental/sksg/SkSGNode.cpp",
1514 "experimental/sksg/SkSGPaintNode.cpp",
1515 "experimental/sksg/SkSGRenderNode.cpp",
Florin Malita35efaa82018-01-22 12:57:06 -05001516 "experimental/sksg/SkSGScene.cpp",
Florin Malita38ea40e2018-01-29 16:31:14 -05001517 "experimental/sksg/effects/SkSGClipEffect.cpp",
Florin Malita5f9102f2018-01-10 13:36:22 -05001518 "experimental/sksg/effects/SkSGMaskEffect.cpp",
Florin Malitac0034172018-01-08 16:42:59 -05001519 "experimental/sksg/effects/SkSGOpacityEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001520 "experimental/sksg/effects/SkSGTransform.cpp",
Florin Malita16d0ad02018-01-19 15:07:29 -05001521 "experimental/sksg/geometry/SkSGGeometryTransform.cpp",
Florin Malitae6345d92018-01-03 23:37:54 -05001522 "experimental/sksg/geometry/SkSGMerge.cpp",
Florin Malita047ae272017-12-27 11:13:13 -05001523 "experimental/sksg/geometry/SkSGPath.cpp",
Florin Malita97b3d2b2018-02-20 11:26:15 -05001524 "experimental/sksg/geometry/SkSGPlane.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001525 "experimental/sksg/geometry/SkSGRect.cpp",
Florin Malita41dff6e2018-04-30 23:08:15 -04001526 "experimental/sksg/geometry/SkSGRoundEffect.cpp",
Florin Malita51012ce2018-01-31 17:06:59 -05001527 "experimental/sksg/geometry/SkSGText.cpp",
Florin Malita51b8c892018-01-07 08:54:24 -05001528 "experimental/sksg/geometry/SkSGTrimEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001529 "experimental/sksg/paint/SkSGColor.cpp",
Florin Malita6aaee592018-01-12 12:25:09 -05001530 "experimental/sksg/paint/SkSGGradient.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001531 ]
1532 deps = [
1533 ":skia",
1534 ]
1535 }
1536
Kevin Lubickebf648e2017-09-21 13:45:16 -04001537 if (target_cpu != "wasm") {
1538 test_lib("views") {
1539 public_include_dirs = [ "include/views" ]
1540 sources = [
1541 "src/views/SkEvent.cpp",
1542 "src/views/SkEventSink.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001543 "src/views/SkTouchGesture.cpp",
1544 "src/views/SkView.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001545 ]
Brian Osman34755e22016-12-05 09:46:02 -05001546 }
Brian Osman16adfa32016-10-18 14:42:44 -04001547 }
1548
Mike Klein38af9432016-11-11 11:39:44 -05001549 if (skia_use_lua) {
1550 test_lib("lua") {
1551 public_include_dirs = []
1552 sources = [
1553 "src/utils/SkLua.cpp",
1554 "src/utils/SkLuaCanvas.cpp",
1555 ]
1556 deps = [
1557 "//third_party/lua",
1558 ]
1559 }
1560
Mike Kleine6682eb2017-01-05 10:54:57 -05001561 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001562 sources = [
1563 "tools/lua/lua_app.cpp",
1564 ]
1565 deps = [
1566 ":lua",
1567 ":skia",
1568 "//third_party/lua",
1569 ]
Mike Klein38af9432016-11-11 11:39:44 -05001570 }
1571
Mike Kleine6682eb2017-01-05 10:54:57 -05001572 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001573 sources = [
1574 "tools/lua/lua_pictures.cpp",
1575 ]
1576 deps = [
1577 ":flags",
1578 ":lua",
1579 ":skia",
1580 ":tool_utils",
1581 "//third_party/lua",
1582 ]
Mike Klein38af9432016-11-11 11:39:44 -05001583 }
1584 }
1585
Cary Clark8032b982017-07-28 11:04:54 -04001586 test_app("bookmaker") {
1587 sources = [
1588 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001589 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001590 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001591 "tools/bookmaker/fiddleParser.cpp",
1592 "tools/bookmaker/includeParser.cpp",
1593 "tools/bookmaker/includeWriter.cpp",
1594 "tools/bookmaker/mdOut.cpp",
1595 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001596 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001597 "tools/bookmaker/spellCheck.cpp",
1598 ]
1599 deps = [
1600 ":flags",
1601 ":skia",
1602 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001603 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001604 ]
1605 }
1606
Kevin Lubickebf648e2017-09-21 13:45:16 -04001607 if (target_cpu != "wasm") {
1608 import("gn/samples.gni")
1609 test_lib("samples") {
1610 public_include_dirs = [ "samplecode" ]
1611 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001612 sources = samples_sources
Kevin Lubickebf648e2017-09-21 13:45:16 -04001613 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001614 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001615 ":experimental_svg_model",
1616 ":flags",
1617 ":gm",
Mike Reed193d3a02018-02-08 15:45:51 -05001618 ":skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001619 ":tool_utils",
1620 ":views",
1621 ":xml",
1622 ]
Mike Klein38af9432016-11-11 11:39:44 -05001623
Kevin Lubickebf648e2017-09-21 13:45:16 -04001624 if (skia_use_lua) {
1625 sources += [ "samplecode/SampleLua.cpp" ]
1626 deps += [
1627 ":lua",
1628 "//third_party/lua",
1629 ]
1630 }
1631 }
1632 test_app("dm") {
1633 sources = [
1634 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001635 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001636 "dm/DMJsonWriter.cpp",
1637 "dm/DMSrcSink.cpp",
1638 ]
1639 include_dirs = [ "tests" ]
1640 deps = [
1641 ":common_flags",
Florin Malita54f65c42018-01-16 17:04:30 -05001642 ":experimental_skottie",
Florin Malita4aa44412017-12-19 12:21:02 -05001643 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001644 ":experimental_svg_model",
1645 ":flags",
1646 ":gm",
1647 ":gpu_tool_utils",
1648 ":skia",
1649 ":tests",
1650 ":tool_utils",
1651 "//third_party/jsoncpp",
1652 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001653 ]
1654 }
Brian Osman16adfa32016-10-18 14:42:44 -04001655 }
1656
Mike Kleina8a51ce2018-01-09 12:34:11 -05001657 if (!is_win) {
1658 test_app("remote_demo") {
1659 sources = [
1660 "tools/remote_demo.cpp",
1661 ]
1662 deps = [
1663 ":skia",
1664 ]
1665 }
1666 }
1667
Mike Kleine6682eb2017-01-05 10:54:57 -05001668 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001669 sources = [
1670 "bench/nanobench.cpp",
1671 ]
1672 deps = [
1673 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001674 ":common_flags",
Florin Malita4aa44412017-12-19 12:21:02 -05001675 ":experimental_sksg",
fmalita6519c212016-09-14 08:05:17 -07001676 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001677 ":flags",
1678 ":gm",
1679 ":gpu_tool_utils",
1680 ":skia",
1681 ":tool_utils",
1682 "//third_party/jsoncpp",
1683 ]
mtklein2b6870c2016-07-28 14:17:33 -07001684 }
halcanary19a97202016-08-03 15:08:04 -07001685
Ravi Mistry10d36c52017-01-31 09:49:18 -05001686 test_app("skpinfo") {
1687 sources = [
1688 "tools/skpinfo.cpp",
1689 ]
1690 deps = [
1691 ":flags",
1692 ":skia",
1693 ]
1694 }
1695
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001696 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001697 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001698 sources = [
1699 "tools/skpbench/skpbench.cpp",
1700 ]
1701 deps = [
1702 ":flags",
1703 ":gpu_tool_utils",
1704 ":skia",
1705 ":tool_utils",
1706 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001707 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001708 }
1709
Hal Canary96c57252018-02-09 11:43:05 -05001710 test_lib("skshaper") {
1711 public_include_dirs = [ "tools/shape" ]
1712 deps = [
1713 ":skia",
1714 ]
1715
Hal Canary8bb40832018-02-08 15:16:28 -05001716 if (target_cpu == "wasm") {
Hal Canary96c57252018-02-09 11:43:05 -05001717 sources = [
1718 "tools/shape/SkShaper_primitive.cpp",
1719 ]
1720 } else {
mtklein6f5df6a2016-08-29 16:01:10 -07001721 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001722 "tools/shape/SkShaper_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001723 ]
Hal Canary96c57252018-02-09 11:43:05 -05001724 deps += [
mtklein6f5df6a2016-08-29 16:01:10 -07001725 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001726 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001727 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001728 }
halcanary19a97202016-08-03 15:08:04 -07001729 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001730 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001731 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001732 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001733 ]
1734 deps = [
1735 ":skia",
Hal Canary96c57252018-02-09 11:43:05 -05001736 ":skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001737 ]
halcanary3eee9d92016-09-10 07:01:53 -07001738 }
mtklein046cb562016-09-16 10:23:12 -07001739
Matt Sarett9f1c4032017-05-17 10:06:32 -04001740 test_app("create_flutter_test_images") {
1741 sources = [
1742 "tools/create_flutter_test_images.cpp",
1743 ]
1744 deps = [
1745 ":skia",
1746 ":tool_utils",
1747 ]
1748 }
1749
Ben Wagner219f3622017-07-17 15:32:25 -04001750 test_app("create_test_font") {
1751 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001752 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001753 ]
1754 deps = [
1755 ":skia",
1756 ]
1757 assert_no_deps = [
1758 # tool_utils requires the output of this app.
1759 ":tool_utils",
1760 ]
1761 }
1762
Ben Wagner97182cc2018-02-15 10:20:04 -05001763 test_app("create_test_font_color") {
1764 sources = [
1765 "tools/fonts/create_test_font_color.cpp",
1766 ]
1767 deps = [
1768 ":flags",
1769 ":skia",
Florin Malitac659c2c2018-04-05 11:57:21 -04001770 ":tool_utils",
Ben Wagner97182cc2018-02-15 10:20:04 -05001771 ]
1772 }
1773
Mike Kleine6682eb2017-01-05 10:54:57 -05001774 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001775 sources = [
1776 "tools/get_images_from_skps.cpp",
1777 ]
1778 deps = [
1779 ":flags",
1780 ":skia",
1781 "//third_party/jsoncpp",
1782 ]
mtklein046cb562016-09-16 10:23:12 -07001783 }
mtkleinecbc5262016-09-22 11:51:24 -07001784
Mike Kleine6682eb2017-01-05 10:54:57 -05001785 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001786 sources = [
1787 "tools/colorspaceinfo.cpp",
1788 ]
1789 deps = [
1790 ":flags",
1791 ":skia",
1792 ":tool_utils",
1793 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001794 }
1795
Kevin Lubickebf648e2017-09-21 13:45:16 -04001796 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001797 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001798 sources = [
1799 "tools/skiaserve/Request.cpp",
1800 "tools/skiaserve/Response.cpp",
1801 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001802 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1803 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1804 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1805 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1806 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1807 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1808 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1809 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1810 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001811 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1812 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001813 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1814 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1815 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1816 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1817 ]
1818 deps = [
1819 ":flags",
1820 ":gpu_tool_utils",
1821 ":skia",
1822 ":tool_utils",
1823 "//third_party/jsoncpp",
1824 "//third_party/libmicrohttpd",
1825 "//third_party/libpng",
1826 ]
Mike Klein7d302882016-11-03 14:06:31 -04001827 }
mtkleinecbc5262016-09-22 11:51:24 -07001828 }
kjlubick14f984b2016-10-03 11:49:45 -07001829
Mike Kleine6682eb2017-01-05 10:54:57 -05001830 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001831 include_dirs = [
1832 "tools",
1833 "tools/debugger",
1834 ]
kjlubick14f984b2016-10-03 11:49:45 -07001835 sources = [
Hal Canary24ac42b2017-02-14 13:35:14 -05001836 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001837 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001838 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001839 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001840 "fuzz/FuzzGradients.cpp",
1841 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001842 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001843 "fuzz/FuzzPathop.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001844 "fuzz/FuzzRegionOp.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001845 "fuzz/fuzz.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001846 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1847 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001848 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
1849 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001850 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1851 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001852 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001853 "tools/UrlDataManager.cpp",
1854 "tools/debugger/SkDebugCanvas.cpp",
1855 "tools/debugger/SkDrawCommand.cpp",
1856 "tools/debugger/SkJsonWriteBuffer.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001857 "tools/picture_utils.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001858 ]
1859 deps = [
1860 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001861 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001862 ":skia",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001863 "//third_party/jsoncpp",
1864 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001865 ]
kjlubick14f984b2016-10-03 11:49:45 -07001866 }
Mike Klein38312422016-10-05 15:41:01 -04001867
Mike Kleine6682eb2017-01-05 10:54:57 -05001868 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001869 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001870 rebase_path("tests/skia_test.cpp"),
1871 rebase_path("tests/Test.cpp"),
1872 ]
caryclark9feb6322016-10-25 08:58:26 -07001873 deps = [
1874 ":flags",
1875 ":gpu_tool_utils",
1876 ":skia",
1877 ":tool_utils",
1878 ]
caryclark9feb6322016-10-25 08:58:26 -07001879 }
1880
Mike Kleine6682eb2017-01-05 10:54:57 -05001881 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001882 sources = [
1883 "tools/DumpRecord.cpp",
1884 "tools/dump_record.cpp",
1885 ]
1886 deps = [
1887 ":flags",
1888 ":skia",
1889 ]
Mike Klein38312422016-10-05 15:41:01 -04001890 }
bungemanfe917272016-10-13 17:36:40 -04001891
Mike Kleine6682eb2017-01-05 10:54:57 -05001892 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001893 sources = [
1894 "tools/skdiff/skdiff.cpp",
1895 "tools/skdiff/skdiff_html.cpp",
1896 "tools/skdiff/skdiff_main.cpp",
1897 "tools/skdiff/skdiff_utils.cpp",
1898 ]
1899 deps = [
1900 ":skia",
1901 ":tool_utils",
1902 ]
bungemanfe917272016-10-13 17:36:40 -04001903 }
halcanarya73d76a2016-10-17 13:19:02 -07001904
Mike Kleine6682eb2017-01-05 10:54:57 -05001905 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001906 sources = [
1907 "tools/skp_parser.cpp",
1908 ]
1909 deps = [
1910 ":skia",
1911 ":tool_utils",
1912 "//third_party/jsoncpp",
1913 ]
halcanarya73d76a2016-10-17 13:19:02 -07001914 }
Brian Osman16adfa32016-10-18 14:42:44 -04001915
Hal Canaryd7b38452017-12-11 17:46:26 -05001916 if (!is_win && skia_enable_gpu) {
1917 test_lib("skqp_lib") {
1918 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001919 defines =
1920 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001921 if (skia_skqp_enable_driver_correctness_workarounds) {
1922 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1923 }
Hal Canary75427132017-10-11 16:00:31 -04001924 sources = [
1925 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001926 "tools/skqp/gm_knowledge.cpp",
1927 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001928 ]
1929 deps = [
1930 ":gm",
1931 ":gpu_tool_utils",
1932 ":skia",
1933 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001934 ":tool_utils",
1935 ]
1936 }
1937 test_app("skqp") {
1938 sources = [
1939 "tools/skqp/skqp.cpp",
1940 ]
1941 deps = [
1942 ":skia",
1943 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001944 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001945 "//third_party/googletest",
1946 ]
1947 }
1948 }
Hal Canary28f89382017-12-12 09:42:14 -05001949 if (is_android && skia_enable_gpu) {
1950 test_app("skqp_app") {
1951 is_shared_library = true
1952 sources = [
1953 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1954 ]
1955 deps = [
1956 ":skia",
1957 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001958 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001959 ]
1960 libs = [ "android" ]
1961 }
1962 }
Hal Canary75427132017-10-11 16:00:31 -04001963
Hal Canarya9de7602018-01-19 13:08:23 -05001964 test_app("list_gms") {
1965 sources = [
1966 "tools/list_gms.cpp",
1967 ]
1968 deps = [
1969 ":gm",
1970 ":skia",
1971 ]
1972 }
1973 test_app("list_gpu_unit_tests") {
1974 sources = [
1975 "dm/DMGpuTestProcs.cpp",
1976 "tools/list_gpu_unit_tests.cpp",
1977 ]
1978 deps = [
1979 ":skia",
1980 ":tests",
1981 ]
1982 }
1983
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001984 if (skia_enable_gpu) {
Brian Osmaneff04b52017-11-21 13:18:02 -05001985 test_lib("sk_app") {
1986 public_include_dirs = [ "tools/sk_app" ]
Brian Osman16adfa32016-10-18 14:42:44 -04001987 sources = [
Brian Osmaneff04b52017-11-21 13:18:02 -05001988 "tools/sk_app/CommandSet.cpp",
1989 "tools/sk_app/GLWindowContext.cpp",
1990 "tools/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001991 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001992 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001993
Jim Van Verth4e56a912016-10-21 10:58:52 -04001994 if (is_android) {
1995 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001996 "tools/sk_app/android/GLWindowContext_android.cpp",
1997 "tools/sk_app/android/RasterWindowContext_android.cpp",
1998 "tools/sk_app/android/Window_android.cpp",
1999 "tools/sk_app/android/main_android.cpp",
2000 "tools/sk_app/android/surface_glue_android.cpp",
Jim Van Verth4e56a912016-10-21 10:58:52 -04002001 ]
Brian Osman462334e2017-02-09 11:22:57 -05002002 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002003 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04002004 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002005 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2006 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2007 "tools/sk_app/unix/Window_unix.cpp",
Brian Osmanfa916272017-12-01 09:18:20 -05002008 "tools/sk_app/unix/keysym2ucs.c",
Brian Osmaneff04b52017-11-21 13:18:02 -05002009 "tools/sk_app/unix/main_unix.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04002010 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002011 libs += [
2012 "GL",
2013 "X11",
2014 ]
Brian Osman2dd96932016-10-18 15:33:53 -04002015 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04002016 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002017 "tools/sk_app/win/GLWindowContext_win.cpp",
2018 "tools/sk_app/win/RasterWindowContext_win.cpp",
2019 "tools/sk_app/win/Window_win.cpp",
2020 "tools/sk_app/win/main_win.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002021 ]
Brian Salomon194db172017-08-17 14:37:06 -04002022 if (skia_use_angle) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002023 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002024 }
Mike Klein43c25262016-10-20 10:17:47 -04002025 } else if (is_mac) {
2026 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002027 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2028 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2029 "tools/sk_app/mac/Window_mac.cpp",
2030 "tools/sk_app/mac/main_mac.cpp",
Mike Klein43c25262016-10-20 10:17:47 -04002031 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002032 libs += [
2033 "QuartzCore.framework",
2034 "Cocoa.framework",
2035 "Foundation.framework",
2036 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002037 } else if (is_ios) {
2038 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002039 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2040 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2041 "tools/sk_app/ios/Window_ios.cpp",
2042 "tools/sk_app/ios/main_ios.cpp",
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002043 ]
Brian Osman16adfa32016-10-18 14:42:44 -04002044 }
2045
2046 if (skia_use_vulkan) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002047 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002048 if (is_android) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002049 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002050 } else if (is_linux) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002051 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
Brian Osman2dd96932016-10-18 15:33:53 -04002052 libs += [ "X11-xcb" ]
2053 } else if (is_win) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002054 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Brian Osman16adfa32016-10-18 14:42:44 -04002055 }
2056 }
2057
Brian Osman16adfa32016-10-18 14:42:44 -04002058 deps = [
Brian Osman16adfa32016-10-18 14:42:44 -04002059 ":gpu_tool_utils",
Brian Osman16adfa32016-10-18 14:42:44 -04002060 ":skia",
2061 ":tool_utils",
2062 ":views",
Brian Osman16adfa32016-10-18 14:42:44 -04002063 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002064 if (is_android) {
2065 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002066 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04002067 deps += [ "//third_party/libsdl" ]
2068 }
Brian Salomon194db172017-08-17 14:37:06 -04002069 if (skia_use_angle) {
2070 deps += [ "//third_party/angle2" ]
2071 }
Mike Kleina92c3832016-12-08 09:49:39 -05002072 }
Brian Osman16adfa32016-10-18 14:42:44 -04002073 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002074
Brian Osmaneff04b52017-11-21 13:18:02 -05002075 if (skia_enable_gpu) {
2076 test_app("viewer") {
2077 is_shared_library = is_android
Jim Van Verth329c5a62017-11-29 11:42:33 -05002078 if (is_ios) {
2079 bundle_ios_data = true
2080 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002081 sources = [
Chris Dalton2d18f412018-02-20 13:23:32 -07002082 "tools/viewer/BisectSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002083 "tools/viewer/GMSlide.cpp",
Brian Osmand67e5182017-12-08 16:46:09 -05002084 "tools/viewer/ImGuiLayer.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002085 "tools/viewer/ImageSlide.cpp",
2086 "tools/viewer/SKPSlide.cpp",
2087 "tools/viewer/SampleSlide.cpp",
Florin Malita54f65c42018-01-16 17:04:30 -05002088 "tools/viewer/SkottieSlide.cpp",
Florin Malita76a076b2018-02-15 18:40:48 -05002089 "tools/viewer/SlideDir.cpp",
Brian Osman56a24812017-12-19 11:15:16 -05002090 "tools/viewer/StatsLayer.cpp",
Florin Malitac659c2c2018-04-05 11:57:21 -04002091 "tools/viewer/SvgSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002092 "tools/viewer/Viewer.cpp",
2093 ]
2094 libs = []
2095
2096 include_dirs = []
2097 deps = [
Florin Malita54f65c42018-01-16 17:04:30 -05002098 ":experimental_skottie",
Florin Malitabcd07232018-01-31 11:08:58 -05002099 ":experimental_sksg",
Florin Malitac659c2c2018-04-05 11:57:21 -04002100 ":experimental_svg_model",
Brian Osmaneff04b52017-11-21 13:18:02 -05002101 ":flags",
2102 ":gm",
2103 ":gpu_tool_utils",
2104 ":samples",
2105 ":sk_app",
2106 ":skia",
2107 ":tool_utils",
2108 ":views",
2109 "//third_party/imgui",
2110 "//third_party/jsoncpp",
2111 ]
2112 }
2113 }
2114
2115 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
2116 test_app("HelloWorld") {
2117 sources = [
2118 "example/HelloWorld.cpp",
2119 ]
2120 libs = []
2121
2122 include_dirs = []
2123 deps = [
2124 ":flags",
2125 ":gpu_tool_utils",
2126 ":sk_app",
2127 ":skia",
2128 ":tool_utils",
2129 ":views",
2130 ]
2131 }
2132 }
2133
Jim Van Verthecfed2b2017-08-30 14:02:50 -04002134 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002135 test_app("SkiaSDLExample") {
2136 sources = [
2137 "example/SkiaSDLExample.cpp",
2138 ]
2139 libs = []
2140 include_dirs = []
2141 deps = [
2142 ":gpu_tool_utils",
2143 ":skia",
2144 "//third_party/libsdl",
2145 ]
2146 }
2147 }
2148
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002149 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2150 action_foreach("generate_mocs") {
2151 script = "gn/call.py"
2152 sources = [
2153 "tools/mdbviz/MainWindow.h",
2154 ]
2155 outputs = [
2156 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2157 ]
2158 args = [
2159 "$skia_qt_path" + "/bin/moc",
2160 "{{source}}",
2161 "-o",
2162 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2163 ]
2164 }
2165 action_foreach("generate_resources") {
2166 script = "gn/call.py"
2167 sources = [
2168 "tools/mdbviz/resources.qrc",
2169 ]
2170 outputs = [
2171 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2172 ]
2173 args = [
2174 "$skia_qt_path" + "/bin/rcc",
2175 "{{source}}",
2176 "-o",
2177 "gen/mdbviz/{{source_name_part}}_res.cpp",
2178 ]
2179 }
2180 test_app("mdbviz") {
2181 if (is_win) {
2182 # on Windows we need to disable some exception handling warnings due to the Qt headers
2183 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2184 }
2185 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002186 "tools/UrlDataManager.cpp",
2187 "tools/debugger/SkDebugCanvas.cpp",
2188 "tools/debugger/SkDrawCommand.cpp",
2189 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002190 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002191 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002192 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002193 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002194
2195 # generated files
2196 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2197 "$target_gen_dir/mdbviz/resources_res.cpp",
2198 ]
2199 lib_dirs = [ "$skia_qt_path/lib" ]
2200 libs = [
2201 "Qt5Core.lib",
2202 "Qt5Gui.lib",
2203 "Qt5Widgets.lib",
2204 ]
2205 include_dirs = [
2206 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002207 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002208 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002209 "tools",
2210 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002211 ]
2212 deps = [
2213 ":generate_mocs",
2214 ":generate_resources",
2215 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002216 "//third_party/jsoncpp",
2217 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002218 ]
2219 }
2220 }
2221
Mike Kleine459afd2017-03-03 09:21:30 -05002222 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002223 copy("gdbserver") {
2224 sources = [
2225 "$ndk/$ndk_gdbserver",
2226 ]
2227 outputs = [
2228 "$root_out_dir/gdbserver",
2229 ]
2230 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002231 }
mtklein25c81d42016-07-27 13:55:26 -07002232}