blob: 66dac2c2375ae7eef00ea6736eb8a2d01fcfbba6 [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
Greg Danielafb7ec72017-12-07 12:48:30 -050046 skia_vulkan_header = ""
Greg Daniel686bb212016-10-27 10:48:48 -040047 skia_vulkan_sdk = getenv("VULKAN_SDK")
Chris Dalton3a67b8e2018-05-03 09:30:29 -060048 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}
Greg Danielec6ae522017-04-25 13:38:26 -040082declare_args() {
Greg Danielafb7ec72017-12-07 12:48:30 -050083 skia_tools_vulkan_header_dir = ""
Greg Danielec6ae522017-04-25 13:38:26 -040084 if (skia_use_vulkan) {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000085 # 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 -040086 if (is_fuchsia) {
Greg Danielafb7ec72017-12-07 12:48:30 -050087 skia_tools_vulkan_header_dir = "$fuchsia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040088 } else if (is_linux || is_win) {
Greg Danielafb7ec72017-12-07 12:48:30 -050089 skia_tools_vulkan_header_dir = "$skia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040090 }
Greg Danielec6ae522017-04-25 13:38:26 -040091 }
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",
112 "include/gpu/gl",
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500113 "include/atlastext",
mtklein1211e0c2016-07-26 13:55:45 -0700114 "include/pathops",
115 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -0700116 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700117 "include/utils",
118 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700119]
120
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000121if (skia_use_vulkan) {
122 skia_public_includes += [ "include/gpu/vk" ]
123}
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500124if (skia_enable_atlas_text) {
125 skia_public_includes += [ "include/atlastext" ]
126}
Greg Daniele5ddff52017-07-05 16:49:36 -0400127if (skia_use_metal) {
128 skia_public_includes += [ "include/gpu/mtl" ]
129}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000130
mtkleinc04ff472016-06-23 10:29:30 -0700131# Skia public API, generally provided by :skia.
132config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700133 include_dirs = skia_public_includes
Greg Danielafb7ec72017-12-07 12:48:30 -0500134 if (skia_tools_vulkan_header_dir != "") {
135 include_dirs += [ skia_tools_vulkan_header_dir ]
Greg Danielec6ae522017-04-25 13:38:26 -0400136 }
Mike Kleinae7e6712016-10-11 17:49:33 -0400137 defines = []
138 if (is_component_build) {
139 defines += [ "SKIA_DLL" ]
140 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400141 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700142 defines += [ "SK_SAMPLES_FOR_X" ]
143 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400144 if (skia_enable_flutter_defines) {
145 defines += flutter_defines
146 }
mtklein06c35c02016-09-20 12:28:12 -0700147 if (!skia_enable_gpu) {
148 defines += [ "SK_SUPPORT_GPU=0" ]
149 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500150 if (skia_enable_atlas_text) {
151 defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ]
152 }
mtkleinc04ff472016-06-23 10:29:30 -0700153}
154
155# Skia internal APIs, used by Skia itself and a few test tools.
156config("skia_private") {
157 visibility = [ ":*" ]
158
159 include_dirs = [
160 "include/private",
161 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700162 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700163 "src/core",
164 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700165 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700166 "src/image",
167 "src/images",
168 "src/lazy",
169 "src/opts",
170 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700171 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700172 "src/ports",
173 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400174 "src/shaders",
175 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700176 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700177 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700178 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500179 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700180 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700181 ]
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400182 if (skia_llvm_path != "") {
183 include_dirs += [ "$skia_llvm_path/include" ]
184 }
mtklein150d1132016-08-01 06:56:40 -0700185
Mike Reeda9e241d2017-05-03 10:52:00 -0400186 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700187 if (is_android) {
188 defines += [
189 "SK_GAMMA_EXPONENT=1.4",
190 "SK_GAMMA_CONTRAST=0.0",
191 ]
192 }
mtklein88a7ac02016-09-14 11:16:49 -0700193 if (is_official_build || is_android) {
194 # TODO(bsalomon): it'd be nice to make Android normal.
195 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
196 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400197 libs = []
198 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500199 if (skia_enable_gpu) {
200 include_dirs += [ "src/gpu" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500201 if (is_skia_dev_build && skia_use_vulkan) {
202 include_dirs += [ "tools/gpu/vk" ]
203 }
Brian Salomon03e05842017-02-23 12:23:47 -0500204 }
Brian Osman34755e22016-12-05 09:46:02 -0500205 if (skia_use_angle) {
206 defines += [ "SK_ANGLE" ]
207 }
Brian Osman3f375d02016-12-28 11:19:22 -0500208 if (skia_enable_discrete_gpu) {
209 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
210 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400211 if (!is_official_build) {
212 defines += [ "GR_TEST_UTILS=1" ]
213 }
Ethan Nicholas26a9aad2018-03-27 14:10:52 -0400214 if (skia_llvm_path != "") {
215 defines += [ "SK_LLVM_AVAILABLE" ]
216 include_dirs += [ "$skia_llvm_path/include" ]
217 libs += [ skia_llvm_lib ]
218 lib_dirs += [ "$skia_llvm_path/lib/" ]
219 }
mtkleinc04ff472016-06-23 10:29:30 -0700220}
221
222# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
223config("skia_library") {
224 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700225 defines = [ "SKIA_IMPLEMENTATION=1" ]
226}
227
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600228config("moltenvk") {
229 if (is_ios) {
230 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS"
231 } else {
232 moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS"
233 }
234 cflags = [
235 "-F$moltenvk_framework_path",
236 "-isystem$skia_moltenvk_path/MoltenVK/include", # for <vulkan/vulkan.h>
237 ]
238 ldflags = [ "-F$moltenvk_framework_path" ]
239 libs = [
240 "MoltenVK.framework",
241 "Metal.framework",
242 "IOSurface.framework",
243 "QuartzCore.framework",
244 "Foundation.framework",
245 ]
246 if (is_ios) {
247 libs += [ "UIKit.framework" ]
248 } else {
249 libs += [ "IOKit.framework" ]
250 }
251 defines = [ "SK_MOLTENVK" ]
252}
253
mtkleinc04ff472016-06-23 10:29:30 -0700254skia_library_configs = [
255 ":skia_public",
256 ":skia_private",
257 ":skia_library",
258]
259
mtklein9b8583d2016-08-24 17:32:30 -0700260# Use for CPU-specific Skia code that needs particular compiler flags.
261template("opts") {
262 if (invoker.enabled) {
263 source_set(target_name) {
264 forward_variables_from(invoker, "*")
265 configs += skia_library_configs
266 }
267 } else {
268 # If not enabled, a phony empty target that swallows all otherwise unused variables.
269 source_set(target_name) {
270 forward_variables_from(invoker,
271 "*",
272 [
273 "sources",
274 "cflags",
275 ])
276 }
277 }
anmittala7eaf2e2016-08-17 13:57:26 -0700278}
279
mtklein422310d2016-08-16 18:28:43 -0700280is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700281
mtklein7d6fb2c2016-08-25 14:50:44 -0700282opts("none") {
283 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700284 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700285 cflags = []
286}
287
mtklein7d6fb2c2016-08-25 14:50:44 -0700288opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700289 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700290 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700291 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700292}
293
294opts("arm64") {
295 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700296 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700297 cflags = []
298}
299
300opts("crc32") {
301 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700302 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700303 cflags = [ "-march=armv8-a+crc" ]
304}
305
mtklein9b8583d2016-08-24 17:32:30 -0700306opts("sse2") {
307 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700308 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400309 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400310 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
311 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400312 cflags = [ "-msse2" ]
313 }
mtklein9b8583d2016-08-24 17:32:30 -0700314}
mtkleinc04ff472016-06-23 10:29:30 -0700315
mtklein9b8583d2016-08-24 17:32:30 -0700316opts("ssse3") {
317 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700318 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400319 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400320 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
321 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400322 cflags = [ "-mssse3" ]
323 }
mtklein9b8583d2016-08-24 17:32:30 -0700324}
mtkleinc04ff472016-06-23 10:29:30 -0700325
mtklein9b8583d2016-08-24 17:32:30 -0700326opts("sse41") {
327 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700328 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400329 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400330 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
331 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400332 cflags = [ "-msse4.1" ]
333 }
mtklein9b8583d2016-08-24 17:32:30 -0700334}
mtklein4e976072016-08-08 09:06:27 -0700335
mtklein9b8583d2016-08-24 17:32:30 -0700336opts("sse42") {
337 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700338 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400339 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400340 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
341 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400342 cflags = [ "-msse4.2" ]
343 }
mtklein9b8583d2016-08-24 17:32:30 -0700344}
345
346opts("avx") {
347 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700348 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400349 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000350 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400351 } else {
352 cflags = [ "-mavx" ]
353 }
mtkleinc04ff472016-06-23 10:29:30 -0700354}
355
Mike Klein1b9b7d52018-02-27 10:37:40 -0500356opts("hsw") {
357 enabled = is_x86
358 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400359 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500360 cflags = [ "/arch:AVX2" ]
361 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000362 cflags = [ "-march=haswell" ]
Mike Klein1b9b7d52018-02-27 10:37:40 -0500363 }
364
365 # Oddly, clang-cl doesn't recognize this as a valid flag.
366 # If it ever does, it'd nice to move this up with -mavx2 and co.
367 if (is_clang && !is_win) {
368 # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional,
369 # but nice to have, generating slightly better code for paths without explicit FMAs.
370 cflags += [ "-ffp-contract=fast" ]
371 }
372}
373
mtkleinc095df52016-08-24 12:23:52 -0700374# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700375template("optional") {
376 if (invoker.enabled) {
377 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700378 if (defined(invoker.public_defines)) {
379 defines = invoker.public_defines
380 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600381 if (defined(invoker.public_configs)) {
382 configs = invoker.public_configs
383 }
mtklein457b42a2016-08-23 13:56:37 -0700384 }
385 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700386 forward_variables_from(invoker,
387 "*",
388 [
389 "public_defines",
390 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700391 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700392 ])
mtklein457b42a2016-08-23 13:56:37 -0700393 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700394 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700395 if (defined(invoker.configs_to_remove)) {
396 configs -= invoker.configs_to_remove
397 }
mtklein457b42a2016-08-23 13:56:37 -0700398 }
399 } else {
mtklein457b42a2016-08-23 13:56:37 -0700400 source_set(target_name) {
401 forward_variables_from(invoker,
402 "*",
403 [
404 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700405 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700406 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700407 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700408 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700409 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700410 ])
mtkleincd01b032016-08-31 04:58:19 -0700411 if (defined(invoker.sources_when_disabled)) {
412 sources = invoker.sources_when_disabled
413 }
414 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700415 }
mtkleineb3c4252016-08-23 07:38:09 -0700416 }
mtklein457b42a2016-08-23 13:56:37 -0700417}
mtklein457b42a2016-08-23 13:56:37 -0700418
Mike Kleina04bb452017-02-09 12:24:07 -0500419optional("effects") {
420 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400421 deps = [
422 ":compile_processors",
423 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500424 sources =
425 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
426 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
427}
428
mtkleina45be612016-08-29 15:22:10 -0700429optional("fontmgr_android") {
430 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700431
432 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500433 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700434 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700435 ]
436 sources = [
437 "src/ports/SkFontMgr_android.cpp",
438 "src/ports/SkFontMgr_android_factory.cpp",
439 "src/ports/SkFontMgr_android_parser.cpp",
440 ]
441}
442
mtkleind2e39db2016-09-07 07:52:55 -0700443optional("fontmgr_custom") {
444 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
445
446 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500447 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700448 ]
449 sources = [
450 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500451 "src/ports/SkFontMgr_custom.h",
452 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700453 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500454 "src/ports/SkFontMgr_custom_embedded.cpp",
455 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700456 ]
457}
458
Hal Canaryff2742e2018-01-30 11:35:47 -0500459optional("fontmgr_empty") {
460 enabled = skia_enable_fontmgr_empty
461 sources = [
462 "src/ports/SkFontMgr_empty_factory.cpp",
463 ]
464}
465
mtklein3cc22182016-08-29 13:26:14 -0700466optional("fontmgr_fontconfig") {
467 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700468
469 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500470 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700471 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700472 ]
473 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700474 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700475 "src/ports/SkFontConfigInterface_direct.cpp",
476 "src/ports/SkFontConfigInterface_direct_factory.cpp",
477 "src/ports/SkFontMgr_FontConfigInterface.cpp",
478 "src/ports/SkFontMgr_fontconfig.cpp",
479 "src/ports/SkFontMgr_fontconfig_factory.cpp",
480 ]
481}
482
mtkleincdedd0e2016-09-12 15:15:44 -0700483optional("fontmgr_fuchsia") {
484 enabled = is_fuchsia && skia_use_freetype
485
486 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500487 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700488 ]
489 sources = [
490 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500491 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700492 "src/ports/SkFontMgr_custom_empty_factory.cpp",
493 ]
494}
495
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700496if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400497 executable("sksllex") {
498 sources = [
499 "src/sksl/lex/Main.cpp",
500 "src/sksl/lex/NFA.cpp",
501 "src/sksl/lex/RegexNode.cpp",
502 "src/sksl/lex/RegexParser.cpp",
503 ]
504 include_dirs = [ "src/sksl/lex" ]
505 }
506
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700507 action("run_sksllex") {
508 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400509 deps = [
510 ":sksllex(//gn/toolchain:$host_toolchain)",
511 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700512 sources = [
513 "src/sksl/lex/layout.lex",
514 "src/sksl/lex/sksl.lex",
515 ]
516
517 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
518 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
519 outputs = [
520 "$target_out_dir/" +
521 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
522 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
523 # confused due to the same file being named by two different paths
524 ]
525 sksllex_path = "$root_out_dir/"
526 sksllex_path += "sksllex"
527 if (host_os == "win") {
528 sksllex_path += ".exe"
529 }
530 args = [
531 rebase_path(sksllex_path),
532 rebase_path("bin/clang-format"),
533 rebase_path("src"),
534 ]
535 }
536} else {
537 group("run_sksllex") {
538 }
539}
540
541if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400542 executable("skslc") {
543 defines = [ "SKSL_STANDALONE" ]
544 sources = [
545 "src/sksl/SkSLMain.cpp",
546 ]
547 sources += skia_sksl_sources
548 include_dirs = [
549 "src/gpu",
550 "src/sksl",
551 ]
552 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500553 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400554 "//third_party/spirv-tools",
555 ]
556 }
557
558 skia_gpu_processor_outputs = []
559 foreach(src, skia_gpu_processor_sources) {
560 dir = get_path_info(src, "dir")
561 name = get_path_info(src, "name")
562
563 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
564 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
565 skia_gpu_processor_outputs += [
566 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
567 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
568 # confused due to the same file being named by two different paths
569 ]
570 }
571
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500572 action("create_sksl_enums") {
573 script = "gn/create_sksl_enums.py"
574 sources = [
575 "include/private/GrSharedEnums.h",
576 ]
577 outputs = [
578 "$target_out_dir/" +
Ben Wagnera56c4d22018-01-24 17:32:17 -0500579 rebase_path("src/sksl/sksl_enums.inc", target_out_dir),
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500580 ]
581 args = [
582 rebase_path(sources[0]),
583 rebase_path(outputs[0]),
584 ]
585 }
586
Ethan Nicholas762466e2017-06-29 10:03:38 -0400587 action("compile_processors") {
588 script = "gn/compile_processors.py"
589 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500590 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400591 ":skslc(//gn/toolchain:$host_toolchain)",
592 ]
593 sources = skia_gpu_processor_sources
594 outputs = skia_gpu_processor_outputs
595 skslc_path = "$root_out_dir/"
596 if (host_toolchain != default_toolchain_name) {
597 skslc_path += "$host_toolchain/"
598 }
599 skslc_path += "skslc"
600 if (host_os == "win") {
601 skslc_path += ".exe"
602 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400603 args = [
604 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400605 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400606 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400607 args += rebase_path(skia_gpu_processor_sources)
608 }
609} else {
610 skia_gpu_processor_outputs = []
611 group("compile_processors") {
612 }
613}
614
mtklein06c35c02016-09-20 12:28:12 -0700615optional("gpu") {
616 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400617 deps = [
618 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700619 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400620 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700621 if (skia_generate_workarounds) {
622 deps += [ ":workaround_list" ]
623 }
mtkleine9fb3d52016-09-20 15:11:46 -0700624 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600625 public_configs = []
mtkleine9fb3d52016-09-20 15:11:46 -0700626
Brian Salomon3d6801e2017-12-11 10:06:31 -0500627 sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700628
629 # These paths need to be absolute to match the ones produced by shared_sources.gni.
Brian Salomon3d6801e2017-12-11 10:06:31 -0500630 sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ],
mtklein06c35c02016-09-20 12:28:12 -0700631 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400632 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700633 if (is_android) {
Hal Canary25375e82018-03-14 15:16:56 -0400634 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400635
636 # this lib is required to link against AHardwareBuffer
637 if (defined(ndk_api) && ndk_api >= 26) {
638 libs += [ "android" ]
639 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400640 } else if (skia_use_egl) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500641 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
Kevin Lubick4a24e102017-03-29 11:19:01 -0400642 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700643 } else if (is_linux) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500644 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500645 libs += [
646 "GL",
647 "GLU",
648 ]
mtklein06c35c02016-09-20 12:28:12 -0700649 } else if (is_mac) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500650 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800651 } else if (is_ios) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500652 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400653 } else if (is_win) {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500654 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400655 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700656 } else {
Brian Salomon3d6801e2017-12-11 10:06:31 -0500657 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
mtklein06c35c02016-09-20 12:28:12 -0700658 }
mtkleine9fb3d52016-09-20 15:11:46 -0700659
660 if (skia_use_vulkan) {
661 public_defines += [ "SK_VULKAN" ]
662 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700663 if (skia_enable_vulkan_debug_layers) {
664 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
665 }
Greg Danielafb7ec72017-12-07 12:48:30 -0500666 if (skia_vulkan_header != "") {
667 public_defines += [ "SK_VULKAN_HEADER=\"$skia_vulkan_header\"" ]
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600668 } else if (skia_moltenvk_path != "") {
669 public_defines += [ "SK_VULKAN_HEADER=<MoltenVK/mvk_vulkan.h>" ]
670 } else if (is_skia_dev_build) {
671 public_defines += [ "SK_VULKAN_HEADER=\"GrVulkanDefines.h\"" ]
672 }
673 if (skia_moltenvk_path != "") {
674 public_configs += [ ":moltenvk" ]
Greg Danielafb7ec72017-12-07 12:48:30 -0500675 }
mtkleine9fb3d52016-09-20 15:11:46 -0700676 }
Brian Salomon5f33a8c2018-02-26 14:32:39 -0500677 if (skia_use_legacy_gpu_pixel_ops) {
678 public_defines += [ "SK_LEGACY_GPU_PIXEL_OPS" ]
679 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400680 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400681 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400682 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
683 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400684
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400685 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400686 if (skia_use_metal) {
687 public_defines += [ "SK_METAL" ]
688 sources += skia_metal_sources
689 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400690 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400691 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500692
693 if (skia_enable_atlas_text) {
694 sources += skia_atlas_text_sources
695 }
mtklein06c35c02016-09-20 12:28:12 -0700696}
697
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400698optional("heif") {
699 enabled = skia_use_libheif
700 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
701
702 deps = []
703
704 sources = [
705 "src/codec/SkHeifCodec.cpp",
706 ]
707}
708
mtklein63213812016-08-24 09:55:56 -0700709optional("jpeg") {
710 enabled = skia_use_libjpeg_turbo
711 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
712
mtklein63213812016-08-24 09:55:56 -0700713 deps = [
714 "//third_party/libjpeg-turbo:libjpeg",
715 ]
716 sources = [
717 "src/codec/SkJpegCodec.cpp",
718 "src/codec/SkJpegDecoderMgr.cpp",
719 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700720 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400721 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700722 ]
723}
724
725optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500726 enabled = skia_use_zlib && skia_enable_pdf
727 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700728
mtklein63213812016-08-24 09:55:56 -0700729 deps = [
730 "//third_party/zlib",
731 ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400732 if (skia_use_libjpeg_turbo) {
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700733 deps += [ ":jpeg" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400734 }
brettwb9447282016-09-01 14:24:39 -0700735 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700736 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700737
738 if (skia_use_sfntly) {
739 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500740 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700741 }
742}
743
744optional("png") {
745 enabled = skia_use_libpng
746 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
747
mtklein63213812016-08-24 09:55:56 -0700748 deps = [
749 "//third_party/libpng",
750 ]
751 sources = [
752 "src/codec/SkIcoCodec.cpp",
753 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400754 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700755 ]
756}
757
scroggof84ad642016-10-31 09:02:57 -0700758optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400759 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700760 public_defines = [ "SK_CODEC_DECODES_RAW" ]
761
762 deps = [
763 "//third_party/dng_sdk",
764 "//third_party/libjpeg-turbo:libjpeg",
765 "//third_party/piex",
766 ]
767
768 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
769 # Skia.
770 configs_to_remove = [ "//gn:no_exceptions" ]
771
772 sources = [
773 "src/codec/SkRawAdapterCodec.cpp",
774 "src/codec/SkRawCodec.cpp",
775 ]
776}
777
Mike Kleinfb333552018-01-25 12:49:37 -0500778optional("skcms") {
779 enabled = skia_use_skcms
780
Brian Osman094fba92018-03-26 17:05:48 -0400781 public_defines = [ "SK_USE_SKCMS" ]
Mike Kleinfb333552018-01-25 12:49:37 -0500782 deps = [
Brian Osman1b4faa72018-04-23 13:06:36 -0400783 "third_party/skcms",
Mike Kleinfb333552018-01-25 12:49:37 -0500784 ]
785 sources = [
Brian Osman094fba92018-03-26 17:05:48 -0400786 "src/core/SkColorSpaceXform_skcms.cpp",
Mike Kleinfb333552018-01-25 12:49:37 -0500787 ]
788}
789
mtklein3cc22182016-08-29 13:26:14 -0700790optional("typeface_freetype") {
791 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700792
793 deps = [
794 "//third_party/freetype2",
795 ]
796 sources = [
797 "src/ports/SkFontHost_FreeType.cpp",
798 "src/ports/SkFontHost_FreeType_common.cpp",
799 ]
800}
801
mtklein457b42a2016-08-23 13:56:37 -0700802optional("webp") {
803 enabled = skia_use_libwebp
804 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
805
mtklein457b42a2016-08-23 13:56:37 -0700806 deps = [
807 "//third_party/libwebp",
808 ]
809 sources = [
810 "src/codec/SkWebpAdapterCodec.cpp",
811 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400812 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700813 ]
mtkleineb3c4252016-08-23 07:38:09 -0700814}
815
mtklein63213812016-08-24 09:55:56 -0700816optional("xml") {
817 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000818 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700819
mtklein63213812016-08-24 09:55:56 -0700820 deps = [
821 "//third_party/expat",
822 ]
823 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500824 "src/svg/SkSVGCanvas.cpp",
825 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700826 "src/xml/SkDOM.cpp",
827 "src/xml/SkXMLParser.cpp",
828 "src/xml/SkXMLWriter.cpp",
829 ]
830}
831
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700832if (skia_enable_gpu && skia_generate_workarounds) {
833 action("workaround_list") {
834 script = "tools/build_workaround_header.py"
835
836 inputs = [
837 "src/gpu/gpu_workaround_list.txt",
838 ]
839
840 # see comments in skia_compile_processors about out dir path shenanigans.
841 output_file =
Greg Daniel024615e2018-05-10 17:25:52 +0000842 rebase_path("src/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700843
844 outputs = [
845 "$root_out_dir/$output_file",
846 ]
847 args = [
848 "--output-file",
849 "$output_file",
850 ]
851
852 foreach(file, inputs) {
853 args += [ rebase_path(file, root_build_dir) ]
854 }
855 }
856}
857
mtkleinc04ff472016-06-23 10:29:30 -0700858component("skia") {
859 public_configs = [ ":skia_public" ]
860 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700861
862 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700863 ":arm64",
864 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700865 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700866 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500867 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700868 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700869 ":fontmgr_custom",
Hal Canaryff2742e2018-01-30 11:35:47 -0500870 ":fontmgr_empty",
mtklein3cc22182016-08-29 13:26:14 -0700871 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700872 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700873 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400874 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -0500875 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700876 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700877 ":none",
mtklein63213812016-08-24 09:55:56 -0700878 ":pdf",
879 ":png",
scroggof84ad642016-10-31 09:02:57 -0700880 ":raw",
Mike Kleinfb333552018-01-25 12:49:37 -0500881 ":skcms",
mtklein9b8583d2016-08-24 17:32:30 -0700882 ":sse2",
883 ":sse41",
884 ":sse42",
885 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700886 ":webp",
mtklein63213812016-08-24 09:55:56 -0700887 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700888 ]
889
Chinmay Garde43f115c2016-11-16 15:04:12 -0800890 # This file (and all GN files in Skia) are designed to work with an
891 # empty sources assignment filter; we handle all that explicitly.
892 # We clear the filter here for clients who may have set up a global filter.
893 set_sources_assignment_filter([])
894
mtkleinc04ff472016-06-23 10:29:30 -0700895 sources = []
brettwb9447282016-09-01 14:24:39 -0700896 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700897 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500898 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700899 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400900 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -0500901 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700902 "src/android/SkBitmapRegionCodec.cpp",
903 "src/android/SkBitmapRegionDecoder.cpp",
904 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400905 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700906 "src/codec/SkBmpCodec.cpp",
907 "src/codec/SkBmpMaskCodec.cpp",
908 "src/codec/SkBmpRLECodec.cpp",
909 "src/codec/SkBmpStandardCodec.cpp",
910 "src/codec/SkCodec.cpp",
911 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700912 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700913 "src/codec/SkMaskSwizzler.cpp",
914 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700915 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700916 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700917 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700918 "src/codec/SkSwizzler.cpp",
919 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700920 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700921 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700922 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700923 "src/ports/SkMemory_malloc.cpp",
924 "src/ports/SkOSFile_stdio.cpp",
925 "src/sfnt/SkOTTable_name.cpp",
926 "src/sfnt/SkOTUtils.cpp",
927 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700928 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700929 ]
brettwb9447282016-09-01 14:24:39 -0700930
mtklein7d6fb2c2016-08-25 14:50:44 -0700931 libs = []
932
mtkleinc04ff472016-06-23 10:29:30 -0700933 if (is_win) {
934 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400935 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700936 "src/ports/SkDebug_win.cpp",
937 "src/ports/SkFontHost_win.cpp",
938 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500939 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700940 "src/ports/SkImageEncoder_WIC.cpp",
941 "src/ports/SkImageGeneratorWIC.cpp",
942 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700943 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700944 "src/ports/SkScalerContext_win_dw.cpp",
945 "src/ports/SkTLS_win.cpp",
946 "src/ports/SkTypeface_win_dw.cpp",
947 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400948 libs += [
949 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500950 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400951 "Ole32.lib",
952 "OleAut32.lib",
953 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500954 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400955 ]
mtkleinc04ff472016-06-23 10:29:30 -0700956 } else {
957 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700958 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700959 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700960 "src/ports/SkTLS_pthread.cpp",
961 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400962 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700963 }
964
mtklein7d6fb2c2016-08-25 14:50:44 -0700965 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500966 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500967 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500968 deps += [ "//third_party/cpu-features" ]
969 }
mtklein06c35c02016-09-20 12:28:12 -0700970 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700971 libs += [
972 "EGL",
973 "GLESv2",
974 "log",
975 ]
976 }
977
mtkleinc04ff472016-06-23 10:29:30 -0700978 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700979 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -0400980 if (skia_use_egl) {
981 libs += [ "GLESv2" ]
982 }
mtkleinc04ff472016-06-23 10:29:30 -0700983 }
984
985 if (is_mac) {
986 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700987 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700988 "src/ports/SkFontHost_mac.cpp",
989 "src/ports/SkImageEncoder_CG.cpp",
990 "src/ports/SkImageGeneratorCG.cpp",
991 ]
mtklein09e61f72016-08-23 13:35:28 -0700992 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400993 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
994 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700995 "ApplicationServices.framework",
996 "OpenGL.framework",
997 ]
mtkleinc04ff472016-06-23 10:29:30 -0700998 }
abarth6fc8ff02016-07-15 15:15:15 -0700999
Mike Klein7d302882016-11-03 14:06:31 -04001000 if (is_ios) {
1001 sources += [
1002 "src/ports/SkDebug_stdio.cpp",
1003 "src/ports/SkFontHost_mac.cpp",
1004 "src/ports/SkImageEncoder_CG.cpp",
1005 "src/ports/SkImageGeneratorCG.cpp",
1006 ]
1007 libs += [
1008 "CoreFoundation.framework",
1009 "CoreGraphics.framework",
1010 "CoreText.framework",
1011 "ImageIO.framework",
1012 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -04001013
1014 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
1015 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001016 ]
1017 }
1018
abarth6fc8ff02016-07-15 15:15:15 -07001019 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001020 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001021 }
mtkleinc04ff472016-06-23 10:29:30 -07001022}
1023
mtkleinc095df52016-08-24 12:23:52 -07001024# Targets guarded by skia_enable_tools may use //third_party freely.
1025if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -05001026 # Used by gn_to_bp.py to list our public include dirs.
1027 source_set("public") {
1028 configs += [ ":skia_public" ]
1029 }
1030
Mike Kleinc36dedf2016-11-18 09:35:28 -05001031 config("skia.h_config") {
1032 include_dirs = [ "$target_gen_dir" ]
Greg Danielafb7ec72017-12-07 12:48:30 -05001033 if (skia_use_vulkan) {
1034 # So we can get the header which includes vulkan
1035 include_dirs += [ "tools/gpu/vk" ]
1036 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001037 }
1038 action("skia.h") {
1039 public_configs = [ ":skia.h_config" ]
1040 skia_h = "$target_gen_dir/skia.h"
1041 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -04001042 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +00001043 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001044 depfile = "$skia_h.deps"
1045 outputs = [
1046 skia_h,
1047 ]
1048 }
1049
1050 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001051 executable("fiddle") {
1052 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001053 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001054 "tools/fiddle/draw.cpp",
1055 "tools/fiddle/fiddle_main.cpp",
1056 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001057
1058 if (skia_use_egl) {
1059 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001060 } else {
1061 sources += [ "tools/fiddle/null_context.cpp" ]
1062 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001063 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001064 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001065 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001066 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001067 ":skia",
1068 ":skia.h",
1069 ]
1070 }
1071 }
1072
1073 if (skia_enable_gpu) {
1074 source_set("public_headers_warnings_check") {
1075 sources = [
1076 "tools/public_headers_warnings_check.cpp",
1077 ]
1078 configs -= [ "//gn:warnings_except_public_headers" ]
1079 deps = [
1080 ":skia",
1081 ":skia.h",
1082 ]
1083 }
1084 }
1085
mtkleinc095df52016-08-24 12:23:52 -07001086 template("test_lib") {
1087 config(target_name + "_config") {
1088 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -07001089 if (defined(invoker.public_defines)) {
1090 defines = invoker.public_defines
1091 }
mtklein25c81d42016-07-27 13:55:26 -07001092 }
mtkleinc095df52016-08-24 12:23:52 -07001093 source_set(target_name) {
1094 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
1095 public_configs = [
1096 ":" + target_name + "_config",
1097 ":skia_private",
1098 ]
1099
1100 if (!defined(deps)) {
1101 deps = []
1102 }
1103 deps += [ ":skia" ]
1104 testonly = true
1105 }
mtklein25c81d42016-07-27 13:55:26 -07001106 }
mtklein25c81d42016-07-27 13:55:26 -07001107
Mike Kleine6682eb2017-01-05 10:54:57 -05001108 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001109 if (is_ios) {
1110 app_name = target_name
1111 gen_path = target_gen_dir
1112
1113 action("${app_name}_generate_info_plist") {
1114 script = "//gn/gen_plist_ios.py"
1115 outputs = [
1116 "$gen_path/${app_name}_Info.plist",
1117 ]
1118 args = [ rebase_path("$gen_path/$app_name", root_build_dir) ]
1119 }
1120
1121 bundle_data("${app_name}_bundle_info_plist") {
1122 public_deps = [
1123 ":${app_name}_generate_info_plist",
1124 ]
1125 sources = [
1126 "$gen_path/${app_name}_Info.plist",
1127 ]
1128 outputs = [
1129 "{{bundle_root_dir}}/Info.plist",
1130 ]
1131 }
1132
Jim Van Verth329c5a62017-11-29 11:42:33 -05001133 bundle_ios_data =
1134 defined(invoker.bundle_ios_data) && invoker.bundle_ios_data
1135
1136 if (bundle_ios_data) {
1137 has_skps =
1138 "True" == exec_script("//gn/checkdir.py",
1139 [ rebase_path("skps", root_build_dir) ],
1140 "trim string")
1141 bundle_data("${app_name}_bundle_resources") {
1142 sources = [
1143 "resources",
1144 ]
1145 outputs = [
1146 # iOS reserves the folders 'Resources' and 'resources' so store one level deeper
1147 "{{bundle_resources_dir}}/data/resources",
1148 ]
1149 }
1150
1151 if (has_skps) {
1152 bundle_data("${app_name}_bundle_skps") {
1153 sources = [
1154 "skps",
1155 ]
1156 outputs = [
1157 # Store in same folder as resources
1158 "{{bundle_resources_dir}}/data/skps",
1159 ]
1160 }
1161 }
1162 }
1163
Jim Van Verth443a9132017-11-28 09:45:26 -05001164 executable("${app_name}_generate_executable") {
1165 forward_variables_from(invoker,
1166 "*",
1167 [
1168 "output_name",
1169 "visibility",
1170 "is_shared_library",
1171 ])
Mike Klein154e6da2017-07-26 15:13:47 -04001172 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -05001173 testonly = true
Jim Van Verth443a9132017-11-28 09:45:26 -05001174 output_name = rebase_path("$gen_path/$app_name", root_build_dir)
1175 }
1176
1177 bundle_data("${app_name}_bundle_executable") {
1178 public_deps = [
1179 ":${app_name}_generate_executable",
1180 ]
1181 sources = [
1182 "$gen_path/$app_name",
1183 ]
1184 outputs = [
1185 "{{bundle_executable_dir}}/$app_name",
1186 ]
1187 testonly = true
1188 }
1189
1190 create_bundle("$app_name") {
1191 product_type = "com.apple.product-type.application"
1192 testonly = true
1193
1194 bundle_root_dir = "${root_build_dir}/${target_name}.app"
1195 bundle_resources_dir = bundle_root_dir
1196 bundle_executable_dir = bundle_root_dir
1197 bundle_plugins_dir = bundle_root_dir + "/Plugins"
1198
1199 deps = [
1200 ":${app_name}_bundle_executable",
1201 ":${app_name}_bundle_info_plist",
1202 ]
Jim Van Verth329c5a62017-11-29 11:42:33 -05001203 if (bundle_ios_data) {
1204 deps += [ ":${app_name}_bundle_resources" ]
1205 if (has_skps) {
1206 deps += [ ":${app_name}_bundle_skps" ]
1207 }
1208 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001209
1210 # should only code sign when running on a device, not the simulator
1211 if (target_cpu != "x64") {
1212 code_signing_script = "//gn/codesign_ios.py"
1213 code_signing_sources = [ "$target_gen_dir/$app_name" ]
1214 code_signing_outputs = [
1215 "$bundle_root_dir/_CodeSignature/CodeResources",
1216 "$bundle_root_dir/embedded.mobileprovision",
1217 ]
Jim Van Verth4e502972017-12-07 15:16:10 -05001218 code_signing_args = [
1219 rebase_path("$bundle_root_dir", root_build_dir),
1220 skia_ios_identity,
1221 skia_ios_profile,
1222 ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001223 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001224 }
1225 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001226 # !is_ios
1227
1228 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1229 shared_library("lib" + target_name) {
1230 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1231 configs += [ ":skia_private" ]
1232 testonly = true
1233 }
1234 } else {
1235 _executable = target_name
1236 executable(_executable) {
1237 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1238 configs += [ ":skia_private" ]
1239 testonly = true
1240 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001241 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001242 if (is_android && skia_android_serial != "" && defined(_executable)) {
1243 action("push_" + target_name) {
1244 script = "gn/push_to_android.py"
1245 deps = [
1246 ":" + _executable,
1247 ]
1248 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
1249 outputs = [
1250 _stamp,
1251 ]
1252 args = [
1253 rebase_path("$root_build_dir/$_executable"),
1254 skia_android_serial,
1255 rebase_path(_stamp),
1256 ]
1257 testonly = true
1258 }
Mike Klein7d921032017-01-05 12:20:41 -05001259 }
1260 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001261 }
1262
mtkleinc095df52016-08-24 12:23:52 -07001263 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -07001264 public_include_dirs = []
1265 if (skia_enable_gpu) {
1266 public_defines = []
1267 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -07001268
1269 deps = []
mtklein38925aa2016-09-21 10:11:25 -07001270 sources = [
1271 "tools/gpu/GrContextFactory.cpp",
1272 "tools/gpu/GrTest.cpp",
Brian Salomon58389b92018-03-07 13:01:25 -05001273 "tools/gpu/ProxyUtils.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001274 "tools/gpu/TestContext.cpp",
Brian Salomoncbcb0a12017-11-19 13:20:13 -05001275 "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001276 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001277 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001278 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1279 "tools/gpu/gl/debug/GrBufferObj.cpp",
1280 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1281 "tools/gpu/gl/debug/GrProgramObj.cpp",
1282 "tools/gpu/gl/debug/GrShaderObj.cpp",
1283 "tools/gpu/gl/debug/GrTextureObj.cpp",
1284 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1285 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001286 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001287 ]
1288 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001289
Kevin Lubick4a24e102017-03-29 11:19:01 -04001290 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001291 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001292 } else if (is_ios) {
1293 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1294 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001295 } else if (is_linux) {
1296 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001297 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001298 } else if (is_mac) {
1299 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001300 } else if (is_win) {
1301 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1302 libs += [
1303 "Gdi32.lib",
1304 "OpenGL32.lib",
1305 ]
mtklein38925aa2016-09-21 10:11:25 -07001306 }
mtklein6ef69992016-09-14 06:12:09 -07001307
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001308 cflags_objcc = [ "-fobjc-arc" ]
1309
Mike Kleinc168a3a2016-11-14 14:53:13 +00001310 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001311 deps += [ "//third_party/angle2" ]
1312 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1313 }
mtkleind68f9b02016-09-23 13:18:41 -07001314 if (skia_use_vulkan) {
1315 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001316 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001317 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001318 if (skia_use_metal) {
1319 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1320 }
mtkleina627b5c2016-09-20 13:36:47 -07001321 }
mtklein25c81d42016-07-27 13:55:26 -07001322 }
mtklein25c81d42016-07-27 13:55:26 -07001323
mtkleinc095df52016-08-24 12:23:52 -07001324 test_lib("flags") {
1325 public_include_dirs = [ "tools/flags" ]
1326 sources = [
1327 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001328 ]
1329 }
1330 test_lib("common_flags") {
1331 public_include_dirs = [ "tools/flags" ]
1332 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001333 "tools/flags/SkCommonFlags.cpp",
1334 "tools/flags/SkCommonFlagsConfig.cpp",
1335 ]
1336 deps = [
mtklein046cb562016-09-16 10:23:12 -07001337 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001338 ":gpu_tool_utils",
1339 ]
1340 }
mtklein25c81d42016-07-27 13:55:26 -07001341
mtkleinc095df52016-08-24 12:23:52 -07001342 test_lib("tool_utils") {
1343 public_include_dirs = [
1344 "tools",
1345 "tools/debugger",
Ben Wagner483c7722018-02-20 17:06:07 -05001346 "tools/fonts",
mtkleinc095df52016-08-24 12:23:52 -07001347 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001348 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001349 ]
1350 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001351 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001352 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001353 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001354 "tools/ProcStats.cpp",
1355 "tools/Resources.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001356 "tools/UrlDataManager.cpp",
1357 "tools/debugger/SkDebugCanvas.cpp",
1358 "tools/debugger/SkDrawCommand.cpp",
1359 "tools/debugger/SkJsonWriteBuffer.cpp",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001360 "tools/fonts/SkRandomScalerContext.cpp",
1361 "tools/fonts/SkTestFontMgr.cpp",
Ben Wagner97182cc2018-02-15 10:20:04 -05001362 "tools/fonts/SkTestFontMgr.h",
1363 "tools/fonts/SkTestSVGTypeface.cpp",
1364 "tools/fonts/SkTestSVGTypeface.h",
1365 "tools/fonts/SkTestTypeface.cpp",
1366 "tools/fonts/SkTestTypeface.h",
Brian Salomon5f33a8c2018-02-26 14:32:39 -05001367 "tools/fonts/sk_tool_utils_font.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001368 "tools/picture_utils.cpp",
1369 "tools/random_parse_path.cpp",
1370 "tools/sk_tool_utils.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001371 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001372 "tools/trace/SkChromeTracingTracer.cpp",
1373 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001374 "tools/trace/SkDebugfTracer.cpp",
1375 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001376 "tools/trace/SkEventTracingPriv.cpp",
1377 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001378 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001379 libs = []
1380 if (is_ios) {
1381 sources += [ "tools/ios_utils.m" ]
1382 libs += [ "Foundation.framework" ]
1383 }
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001384 defines = []
1385 if (skia_tools_require_resources) {
1386 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1387 }
mtkleinc095df52016-08-24 12:23:52 -07001388 deps = [
mtklein046cb562016-09-16 10:23:12 -07001389 ":common_flags",
Ben Wagner97182cc2018-02-15 10:20:04 -05001390 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001391 ":flags",
1392 "//third_party/libpng",
1393 ]
1394 public_deps = [
1395 "//third_party/jsoncpp",
1396 ]
1397 }
mtklein25c81d42016-07-27 13:55:26 -07001398
Mike Klein6e744122016-10-27 12:21:40 -04001399 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001400 test_lib("gm") {
1401 public_include_dirs = [ "gm" ]
1402 sources = gm_sources
1403 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001404 ":experimental_sksg",
scroggo19b91532016-10-24 09:03:26 -07001405 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001406 ":gpu_tool_utils",
1407 ":skia",
1408 ":tool_utils",
1409 ]
1410 }
mtklein25c81d42016-07-27 13:55:26 -07001411
Mike Klein6e744122016-10-27 12:21:40 -04001412 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001413 test_lib("tests") {
1414 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001415 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001416 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001417 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001418 }
mtkleinc095df52016-08-24 12:23:52 -07001419 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001420 ":experimental_sksg",
Hal Canary0f666812018-03-22 15:21:12 -04001421 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001422 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001423 ":skia",
1424 ":tool_utils",
1425 "//third_party/libpng",
Brian Osman12e4e842018-04-27 12:03:51 -04001426 "//third_party/skcms",
mtkleinc095df52016-08-24 12:23:52 -07001427 "//third_party/zlib",
1428 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001429 public_deps = [
1430 ":gpu_tool_utils", # Test.h #includes headers from this target.
1431 ]
mtkleinc095df52016-08-24 12:23:52 -07001432 }
mtklein2f3416d2016-08-02 16:02:05 -07001433
Mike Klein6e744122016-10-27 12:21:40 -04001434 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001435 test_lib("bench") {
1436 public_include_dirs = [ "bench" ]
1437 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001438 deps = [
1439 ":flags",
1440 ":gm",
1441 ":gpu_tool_utils",
1442 ":skia",
1443 ":tool_utils",
1444 ]
1445 }
mtklein2b6870c2016-07-28 14:17:33 -07001446
Florin Malita54f65c42018-01-16 17:04:30 -05001447 test_lib("experimental_skottie") {
Florin Malita87ccf332018-05-04 12:23:24 -04001448 public_include_dirs = []
Florin Malita87ccf332018-05-04 12:23:24 -04001449 if (skia_enable_skottie) {
1450 public_include_dirs += [ "experimental/skottie" ]
1451 public_defines = [ "SK_ENABLE_SKOTTIE" ]
1452 sources = [
1453 "experimental/skottie/Skottie.cpp",
1454 "experimental/skottie/SkottieAdapter.cpp",
1455 "experimental/skottie/SkottieAnimator.cpp",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001456 "experimental/skottie/SkottieJson.cpp",
Florin Malita87ccf332018-05-04 12:23:24 -04001457 "experimental/skottie/SkottieValue.cpp",
1458 ]
1459 deps = [
1460 ":experimental_sksg",
1461 ":skia",
Florin Malitafa7e9a82018-05-04 15:10:54 -04001462 "//third_party/rapidjson",
Florin Malita87ccf332018-05-04 12:23:24 -04001463 ]
1464 }
Florin Malita094ccde2017-12-30 12:27:00 -05001465 }
1466
mtkleinc095df52016-08-24 12:23:52 -07001467 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001468 public_include_dirs = []
1469 if (skia_use_expat) {
1470 public_include_dirs += [ "experimental/svg/model" ]
1471 sources = [
1472 "experimental/svg/model/SkSVGAttribute.cpp",
1473 "experimental/svg/model/SkSVGAttributeParser.cpp",
1474 "experimental/svg/model/SkSVGCircle.cpp",
1475 "experimental/svg/model/SkSVGClipPath.cpp",
1476 "experimental/svg/model/SkSVGContainer.cpp",
1477 "experimental/svg/model/SkSVGDOM.cpp",
1478 "experimental/svg/model/SkSVGEllipse.cpp",
1479 "experimental/svg/model/SkSVGGradient.cpp",
1480 "experimental/svg/model/SkSVGLine.cpp",
1481 "experimental/svg/model/SkSVGLinearGradient.cpp",
1482 "experimental/svg/model/SkSVGNode.cpp",
1483 "experimental/svg/model/SkSVGPath.cpp",
1484 "experimental/svg/model/SkSVGPattern.cpp",
1485 "experimental/svg/model/SkSVGPoly.cpp",
1486 "experimental/svg/model/SkSVGRadialGradient.cpp",
1487 "experimental/svg/model/SkSVGRect.cpp",
1488 "experimental/svg/model/SkSVGRenderContext.cpp",
1489 "experimental/svg/model/SkSVGSVG.cpp",
1490 "experimental/svg/model/SkSVGShape.cpp",
1491 "experimental/svg/model/SkSVGStop.cpp",
1492 "experimental/svg/model/SkSVGTransformableNode.cpp",
1493 "experimental/svg/model/SkSVGUse.cpp",
1494 "experimental/svg/model/SkSVGValue.cpp",
1495 ]
1496 deps = [
1497 ":skia",
1498 ":xml",
1499 ]
1500 }
mtkleinc095df52016-08-24 12:23:52 -07001501 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001502
Florin Malita4aa44412017-12-19 12:21:02 -05001503 test_lib("experimental_sksg") {
1504 public_include_dirs = [
1505 "experimental/sksg",
1506 "experimental/sksg/effects",
1507 "experimental/sksg/geometry",
1508 "experimental/sksg/paint",
1509 ]
1510 sources = [
1511 "experimental/sksg/SkSGDraw.cpp",
1512 "experimental/sksg/SkSGEffectNode.cpp",
1513 "experimental/sksg/SkSGGeometryNode.cpp",
1514 "experimental/sksg/SkSGGroup.cpp",
Florin Malita49328072018-01-08 12:51:12 -05001515 "experimental/sksg/SkSGImage.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001516 "experimental/sksg/SkSGInvalidationController.cpp",
1517 "experimental/sksg/SkSGNode.cpp",
1518 "experimental/sksg/SkSGPaintNode.cpp",
1519 "experimental/sksg/SkSGRenderNode.cpp",
Florin Malita35efaa82018-01-22 12:57:06 -05001520 "experimental/sksg/SkSGScene.cpp",
Florin Malita38ea40e2018-01-29 16:31:14 -05001521 "experimental/sksg/effects/SkSGClipEffect.cpp",
Florin Malita5f9102f2018-01-10 13:36:22 -05001522 "experimental/sksg/effects/SkSGMaskEffect.cpp",
Florin Malitac0034172018-01-08 16:42:59 -05001523 "experimental/sksg/effects/SkSGOpacityEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001524 "experimental/sksg/effects/SkSGTransform.cpp",
Florin Malita16d0ad02018-01-19 15:07:29 -05001525 "experimental/sksg/geometry/SkSGGeometryTransform.cpp",
Florin Malitae6345d92018-01-03 23:37:54 -05001526 "experimental/sksg/geometry/SkSGMerge.cpp",
Florin Malita047ae272017-12-27 11:13:13 -05001527 "experimental/sksg/geometry/SkSGPath.cpp",
Florin Malita97b3d2b2018-02-20 11:26:15 -05001528 "experimental/sksg/geometry/SkSGPlane.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001529 "experimental/sksg/geometry/SkSGRect.cpp",
Florin Malita41dff6e2018-04-30 23:08:15 -04001530 "experimental/sksg/geometry/SkSGRoundEffect.cpp",
Florin Malita51012ce2018-01-31 17:06:59 -05001531 "experimental/sksg/geometry/SkSGText.cpp",
Florin Malita51b8c892018-01-07 08:54:24 -05001532 "experimental/sksg/geometry/SkSGTrimEffect.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001533 "experimental/sksg/paint/SkSGColor.cpp",
Florin Malita6aaee592018-01-12 12:25:09 -05001534 "experimental/sksg/paint/SkSGGradient.cpp",
Florin Malita4aa44412017-12-19 12:21:02 -05001535 ]
1536 deps = [
1537 ":skia",
1538 ]
1539 }
1540
Kevin Lubickebf648e2017-09-21 13:45:16 -04001541 if (target_cpu != "wasm") {
1542 test_lib("views") {
1543 public_include_dirs = [ "include/views" ]
1544 sources = [
1545 "src/views/SkEvent.cpp",
1546 "src/views/SkEventSink.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001547 "src/views/SkTouchGesture.cpp",
1548 "src/views/SkView.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001549 ]
Brian Osman34755e22016-12-05 09:46:02 -05001550 }
Brian Osman16adfa32016-10-18 14:42:44 -04001551 }
1552
Mike Klein38af9432016-11-11 11:39:44 -05001553 if (skia_use_lua) {
1554 test_lib("lua") {
1555 public_include_dirs = []
1556 sources = [
1557 "src/utils/SkLua.cpp",
1558 "src/utils/SkLuaCanvas.cpp",
1559 ]
1560 deps = [
1561 "//third_party/lua",
1562 ]
1563 }
1564
Mike Kleine6682eb2017-01-05 10:54:57 -05001565 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001566 sources = [
1567 "tools/lua/lua_app.cpp",
1568 ]
1569 deps = [
1570 ":lua",
1571 ":skia",
1572 "//third_party/lua",
1573 ]
Mike Klein38af9432016-11-11 11:39:44 -05001574 }
1575
Mike Kleine6682eb2017-01-05 10:54:57 -05001576 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001577 sources = [
1578 "tools/lua/lua_pictures.cpp",
1579 ]
1580 deps = [
1581 ":flags",
1582 ":lua",
1583 ":skia",
1584 ":tool_utils",
1585 "//third_party/lua",
1586 ]
Mike Klein38af9432016-11-11 11:39:44 -05001587 }
1588 }
1589
Cary Clark8032b982017-07-28 11:04:54 -04001590 test_app("bookmaker") {
1591 sources = [
1592 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001593 "tools/bookmaker/cataloger.cpp",
Cary Clarka560c472017-11-27 10:44:06 -05001594 "tools/bookmaker/definition.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001595 "tools/bookmaker/fiddleParser.cpp",
1596 "tools/bookmaker/includeParser.cpp",
1597 "tools/bookmaker/includeWriter.cpp",
1598 "tools/bookmaker/mdOut.cpp",
1599 "tools/bookmaker/parserCommon.cpp",
Cary Clarkac47b882018-01-11 10:35:44 -05001600 "tools/bookmaker/selfCheck.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001601 "tools/bookmaker/spellCheck.cpp",
1602 ]
1603 deps = [
1604 ":flags",
1605 ":skia",
1606 ":tool_utils",
Cary Clark2f466242017-12-11 16:03:17 -05001607 "//third_party/jsoncpp",
Cary Clark8032b982017-07-28 11:04:54 -04001608 ]
1609 }
1610
Kevin Lubickebf648e2017-09-21 13:45:16 -04001611 if (target_cpu != "wasm") {
1612 import("gn/samples.gni")
1613 test_lib("samples") {
1614 public_include_dirs = [ "samplecode" ]
1615 include_dirs = [ "experimental" ]
Yuqian Li56a4a092018-02-12 14:47:34 +08001616 sources = samples_sources
Kevin Lubickebf648e2017-09-21 13:45:16 -04001617 deps = [
Florin Malita4aa44412017-12-19 12:21:02 -05001618 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001619 ":experimental_svg_model",
1620 ":flags",
1621 ":gm",
Mike Reed193d3a02018-02-08 15:45:51 -05001622 ":skshaper",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001623 ":tool_utils",
1624 ":views",
1625 ":xml",
1626 ]
Mike Klein38af9432016-11-11 11:39:44 -05001627
Kevin Lubickebf648e2017-09-21 13:45:16 -04001628 if (skia_use_lua) {
1629 sources += [ "samplecode/SampleLua.cpp" ]
1630 deps += [
1631 ":lua",
1632 "//third_party/lua",
1633 ]
1634 }
1635 }
1636 test_app("dm") {
1637 sources = [
1638 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001639 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001640 "dm/DMJsonWriter.cpp",
1641 "dm/DMSrcSink.cpp",
1642 ]
1643 include_dirs = [ "tests" ]
1644 deps = [
1645 ":common_flags",
Florin Malita54f65c42018-01-16 17:04:30 -05001646 ":experimental_skottie",
Florin Malita4aa44412017-12-19 12:21:02 -05001647 ":experimental_sksg",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001648 ":experimental_svg_model",
1649 ":flags",
1650 ":gm",
1651 ":gpu_tool_utils",
1652 ":skia",
1653 ":tests",
1654 ":tool_utils",
1655 "//third_party/jsoncpp",
1656 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001657 ]
1658 }
Brian Osman16adfa32016-10-18 14:42:44 -04001659 }
1660
Mike Kleina8a51ce2018-01-09 12:34:11 -05001661 if (!is_win) {
1662 test_app("remote_demo") {
1663 sources = [
1664 "tools/remote_demo.cpp",
1665 ]
1666 deps = [
1667 ":skia",
1668 ]
1669 }
1670 }
1671
Mike Kleine6682eb2017-01-05 10:54:57 -05001672 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001673 sources = [
1674 "bench/nanobench.cpp",
1675 ]
1676 deps = [
1677 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001678 ":common_flags",
Florin Malita4aa44412017-12-19 12:21:02 -05001679 ":experimental_sksg",
fmalita6519c212016-09-14 08:05:17 -07001680 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001681 ":flags",
1682 ":gm",
1683 ":gpu_tool_utils",
1684 ":skia",
1685 ":tool_utils",
1686 "//third_party/jsoncpp",
1687 ]
mtklein2b6870c2016-07-28 14:17:33 -07001688 }
halcanary19a97202016-08-03 15:08:04 -07001689
Ravi Mistry10d36c52017-01-31 09:49:18 -05001690 test_app("skpinfo") {
1691 sources = [
1692 "tools/skpinfo.cpp",
1693 ]
1694 deps = [
1695 ":flags",
1696 ":skia",
1697 ]
1698 }
1699
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001700 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001701 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001702 sources = [
1703 "tools/skpbench/skpbench.cpp",
1704 ]
1705 deps = [
1706 ":flags",
1707 ":gpu_tool_utils",
1708 ":skia",
1709 ":tool_utils",
1710 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001711 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001712 }
1713
Hal Canary96c57252018-02-09 11:43:05 -05001714 test_lib("skshaper") {
1715 public_include_dirs = [ "tools/shape" ]
1716 deps = [
1717 ":skia",
1718 ]
1719
Hal Canary8bb40832018-02-08 15:16:28 -05001720 if (target_cpu == "wasm") {
Hal Canary96c57252018-02-09 11:43:05 -05001721 sources = [
1722 "tools/shape/SkShaper_primitive.cpp",
1723 ]
1724 } else {
mtklein6f5df6a2016-08-29 16:01:10 -07001725 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001726 "tools/shape/SkShaper_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001727 ]
Hal Canary96c57252018-02-09 11:43:05 -05001728 deps += [
mtklein6f5df6a2016-08-29 16:01:10 -07001729 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001730 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001731 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001732 }
halcanary19a97202016-08-03 15:08:04 -07001733 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001734 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001735 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001736 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001737 ]
1738 deps = [
1739 ":skia",
Hal Canary96c57252018-02-09 11:43:05 -05001740 ":skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07001741 ]
halcanary3eee9d92016-09-10 07:01:53 -07001742 }
mtklein046cb562016-09-16 10:23:12 -07001743
Matt Sarett9f1c4032017-05-17 10:06:32 -04001744 test_app("create_flutter_test_images") {
1745 sources = [
1746 "tools/create_flutter_test_images.cpp",
1747 ]
1748 deps = [
1749 ":skia",
1750 ":tool_utils",
1751 ]
1752 }
1753
Ben Wagner219f3622017-07-17 15:32:25 -04001754 test_app("create_test_font") {
1755 sources = [
Ben Wagner483c7722018-02-20 17:06:07 -05001756 "tools/fonts/create_test_font.cpp",
Ben Wagner219f3622017-07-17 15:32:25 -04001757 ]
1758 deps = [
1759 ":skia",
1760 ]
1761 assert_no_deps = [
1762 # tool_utils requires the output of this app.
1763 ":tool_utils",
1764 ]
1765 }
1766
Ben Wagner97182cc2018-02-15 10:20:04 -05001767 test_app("create_test_font_color") {
1768 sources = [
1769 "tools/fonts/create_test_font_color.cpp",
1770 ]
1771 deps = [
1772 ":flags",
1773 ":skia",
Florin Malitac659c2c2018-04-05 11:57:21 -04001774 ":tool_utils",
Ben Wagner97182cc2018-02-15 10:20:04 -05001775 ]
1776 }
1777
Mike Kleine6682eb2017-01-05 10:54:57 -05001778 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001779 sources = [
1780 "tools/get_images_from_skps.cpp",
1781 ]
1782 deps = [
1783 ":flags",
1784 ":skia",
1785 "//third_party/jsoncpp",
1786 ]
mtklein046cb562016-09-16 10:23:12 -07001787 }
mtkleinecbc5262016-09-22 11:51:24 -07001788
Kevin Lubickebf648e2017-09-21 13:45:16 -04001789 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001790 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001791 sources = [
1792 "tools/skiaserve/Request.cpp",
1793 "tools/skiaserve/Response.cpp",
1794 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001795 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1796 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1797 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1798 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1799 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1800 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1801 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1802 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1803 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001804 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1805 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001806 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1807 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1808 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1809 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1810 ]
1811 deps = [
1812 ":flags",
1813 ":gpu_tool_utils",
1814 ":skia",
1815 ":tool_utils",
1816 "//third_party/jsoncpp",
1817 "//third_party/libmicrohttpd",
1818 "//third_party/libpng",
1819 ]
Mike Klein7d302882016-11-03 14:06:31 -04001820 }
mtkleinecbc5262016-09-22 11:51:24 -07001821 }
kjlubick14f984b2016-10-03 11:49:45 -07001822
Mike Kleine6682eb2017-01-05 10:54:57 -05001823 test_app("fuzz") {
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001824 include_dirs = [
1825 "tools",
1826 "tools/debugger",
1827 ]
kjlubick14f984b2016-10-03 11:49:45 -07001828 sources = [
Hal Canary24ac42b2017-02-14 13:35:14 -05001829 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001830 "fuzz/FuzzCommon.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001831 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04001832 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001833 "fuzz/FuzzGradients.cpp",
1834 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05001835 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001836 "fuzz/FuzzPathop.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04001837 "fuzz/FuzzRegionOp.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001838 "fuzz/fuzz.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05001839 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
1840 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001841 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
1842 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05001843 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
1844 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05001845 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001846 "tools/UrlDataManager.cpp",
1847 "tools/debugger/SkDebugCanvas.cpp",
1848 "tools/debugger/SkDrawCommand.cpp",
1849 "tools/debugger/SkJsonWriteBuffer.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001850 "tools/picture_utils.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001851 ]
1852 deps = [
Kevin Lubick9eeede22018-05-03 16:26:10 -04001853 ":experimental_skottie",
kjlubick14f984b2016-10-03 11:49:45 -07001854 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001855 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001856 ":skia",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05001857 "//third_party/jsoncpp",
1858 "//third_party/libpng",
kjlubick14f984b2016-10-03 11:49:45 -07001859 ]
Florin Malita0b0d93d2018-05-04 15:01:03 -04001860
1861 if (skia_enable_skottie) {
1862 sources += [ "fuzz/oss_fuzz/FuzzSkottieJSON.cpp" ]
1863 }
kjlubick14f984b2016-10-03 11:49:45 -07001864 }
Mike Klein38312422016-10-05 15:41:01 -04001865
Mike Kleine6682eb2017-01-05 10:54:57 -05001866 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001867 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001868 rebase_path("tests/skia_test.cpp"),
1869 rebase_path("tests/Test.cpp"),
1870 ]
caryclark9feb6322016-10-25 08:58:26 -07001871 deps = [
1872 ":flags",
1873 ":gpu_tool_utils",
1874 ":skia",
1875 ":tool_utils",
1876 ]
caryclark9feb6322016-10-25 08:58:26 -07001877 }
1878
Mike Kleine6682eb2017-01-05 10:54:57 -05001879 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001880 sources = [
1881 "tools/DumpRecord.cpp",
1882 "tools/dump_record.cpp",
1883 ]
1884 deps = [
1885 ":flags",
1886 ":skia",
1887 ]
Mike Klein38312422016-10-05 15:41:01 -04001888 }
bungemanfe917272016-10-13 17:36:40 -04001889
Mike Kleine6682eb2017-01-05 10:54:57 -05001890 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001891 sources = [
1892 "tools/skdiff/skdiff.cpp",
1893 "tools/skdiff/skdiff_html.cpp",
1894 "tools/skdiff/skdiff_main.cpp",
1895 "tools/skdiff/skdiff_utils.cpp",
1896 ]
1897 deps = [
1898 ":skia",
1899 ":tool_utils",
1900 ]
bungemanfe917272016-10-13 17:36:40 -04001901 }
halcanarya73d76a2016-10-17 13:19:02 -07001902
Mike Kleine6682eb2017-01-05 10:54:57 -05001903 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001904 sources = [
1905 "tools/skp_parser.cpp",
1906 ]
1907 deps = [
1908 ":skia",
1909 ":tool_utils",
1910 "//third_party/jsoncpp",
1911 ]
halcanarya73d76a2016-10-17 13:19:02 -07001912 }
Brian Osman16adfa32016-10-18 14:42:44 -04001913
Hal Canaryd7b38452017-12-11 17:46:26 -05001914 if (!is_win && skia_enable_gpu) {
1915 test_lib("skqp_lib") {
1916 public_include_dirs = [ "tools/skqp" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05001917 defines =
1918 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary4689b542018-01-31 11:54:14 -05001919 if (skia_skqp_enable_driver_correctness_workarounds) {
1920 defines += [ "SK_SKQP_ENABLE_DRIVER_CORRECTNESS_WORKAROUNDS" ]
1921 }
Hal Canary75427132017-10-11 16:00:31 -04001922 sources = [
1923 "dm/DMGpuTestProcs.cpp",
Hal Canaryd7b38452017-12-11 17:46:26 -05001924 "tools/skqp/gm_knowledge.cpp",
1925 "tools/skqp/gm_runner.cpp",
Hal Canary75427132017-10-11 16:00:31 -04001926 ]
1927 deps = [
1928 ":gm",
1929 ":gpu_tool_utils",
1930 ":skia",
1931 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05001932 ":tool_utils",
1933 ]
1934 }
1935 test_app("skqp") {
1936 sources = [
1937 "tools/skqp/skqp.cpp",
1938 ]
1939 deps = [
1940 ":skia",
1941 ":skqp_lib",
Hal Canary537d9c02018-01-30 11:30:48 -05001942 ":tool_utils",
Hal Canary75427132017-10-11 16:00:31 -04001943 "//third_party/googletest",
1944 ]
1945 }
1946 }
Hal Canary28f89382017-12-12 09:42:14 -05001947 if (is_android && skia_enable_gpu) {
1948 test_app("skqp_app") {
1949 is_shared_library = true
1950 sources = [
1951 "tools/skqp/jni/org_skia_skqp_SkQPRunner.cpp",
1952 ]
1953 deps = [
1954 ":skia",
1955 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05001956 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05001957 ]
1958 libs = [ "android" ]
1959 }
1960 }
Hal Canary75427132017-10-11 16:00:31 -04001961
Hal Canarya9de7602018-01-19 13:08:23 -05001962 test_app("list_gms") {
1963 sources = [
1964 "tools/list_gms.cpp",
1965 ]
1966 deps = [
1967 ":gm",
1968 ":skia",
1969 ]
1970 }
1971 test_app("list_gpu_unit_tests") {
1972 sources = [
1973 "dm/DMGpuTestProcs.cpp",
1974 "tools/list_gpu_unit_tests.cpp",
1975 ]
1976 deps = [
1977 ":skia",
1978 ":tests",
1979 ]
1980 }
1981
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001982 if (skia_enable_gpu) {
Brian Osmaneff04b52017-11-21 13:18:02 -05001983 test_lib("sk_app") {
1984 public_include_dirs = [ "tools/sk_app" ]
Brian Osman16adfa32016-10-18 14:42:44 -04001985 sources = [
Brian Osmaneff04b52017-11-21 13:18:02 -05001986 "tools/sk_app/CommandSet.cpp",
1987 "tools/sk_app/GLWindowContext.cpp",
1988 "tools/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001989 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001990 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001991
Jim Van Verth4e56a912016-10-21 10:58:52 -04001992 if (is_android) {
1993 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05001994 "tools/sk_app/android/GLWindowContext_android.cpp",
1995 "tools/sk_app/android/RasterWindowContext_android.cpp",
1996 "tools/sk_app/android/Window_android.cpp",
1997 "tools/sk_app/android/main_android.cpp",
1998 "tools/sk_app/android/surface_glue_android.cpp",
Jim Van Verth4e56a912016-10-21 10:58:52 -04001999 ]
Brian Osman462334e2017-02-09 11:22:57 -05002000 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002001 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04002002 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002003 "tools/sk_app/unix/GLWindowContext_unix.cpp",
2004 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
2005 "tools/sk_app/unix/Window_unix.cpp",
Brian Osmanfa916272017-12-01 09:18:20 -05002006 "tools/sk_app/unix/keysym2ucs.c",
Brian Osmaneff04b52017-11-21 13:18:02 -05002007 "tools/sk_app/unix/main_unix.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04002008 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002009 libs += [
2010 "GL",
2011 "X11",
2012 ]
Brian Osman2dd96932016-10-18 15:33:53 -04002013 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04002014 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002015 "tools/sk_app/win/GLWindowContext_win.cpp",
2016 "tools/sk_app/win/RasterWindowContext_win.cpp",
2017 "tools/sk_app/win/Window_win.cpp",
2018 "tools/sk_app/win/main_win.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002019 ]
Brian Salomon194db172017-08-17 14:37:06 -04002020 if (skia_use_angle) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002021 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
Brian Salomon194db172017-08-17 14:37:06 -04002022 }
Mike Klein43c25262016-10-20 10:17:47 -04002023 } else if (is_mac) {
2024 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002025 "tools/sk_app/mac/GLWindowContext_mac.cpp",
2026 "tools/sk_app/mac/RasterWindowContext_mac.cpp",
2027 "tools/sk_app/mac/Window_mac.cpp",
2028 "tools/sk_app/mac/main_mac.cpp",
Mike Klein43c25262016-10-20 10:17:47 -04002029 ]
Brian Osmanfa916272017-12-01 09:18:20 -05002030 libs += [
2031 "QuartzCore.framework",
2032 "Cocoa.framework",
2033 "Foundation.framework",
2034 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002035 } else if (is_ios) {
2036 sources += [
Brian Osmaneff04b52017-11-21 13:18:02 -05002037 "tools/sk_app/ios/GLWindowContext_ios.cpp",
2038 "tools/sk_app/ios/RasterWindowContext_ios.cpp",
2039 "tools/sk_app/ios/Window_ios.cpp",
2040 "tools/sk_app/ios/main_ios.cpp",
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002041 ]
Brian Osman16adfa32016-10-18 14:42:44 -04002042 }
2043
2044 if (skia_use_vulkan) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002045 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002046 if (is_android) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002047 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002048 } else if (is_linux) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002049 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
Brian Osman2dd96932016-10-18 15:33:53 -04002050 libs += [ "X11-xcb" ]
2051 } else if (is_win) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002052 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
Brian Osman16adfa32016-10-18 14:42:44 -04002053 }
2054 }
2055
Brian Osman16adfa32016-10-18 14:42:44 -04002056 deps = [
Brian Osman16adfa32016-10-18 14:42:44 -04002057 ":gpu_tool_utils",
Brian Osman16adfa32016-10-18 14:42:44 -04002058 ":skia",
2059 ":tool_utils",
2060 ":views",
Brian Osman16adfa32016-10-18 14:42:44 -04002061 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04002062 if (is_android) {
2063 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04002064 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04002065 deps += [ "//third_party/libsdl" ]
2066 }
Brian Salomon194db172017-08-17 14:37:06 -04002067 if (skia_use_angle) {
2068 deps += [ "//third_party/angle2" ]
2069 }
Mike Kleina92c3832016-12-08 09:49:39 -05002070 }
Brian Osman16adfa32016-10-18 14:42:44 -04002071 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002072
Brian Osmaneff04b52017-11-21 13:18:02 -05002073 if (skia_enable_gpu) {
2074 test_app("viewer") {
2075 is_shared_library = is_android
Jim Van Verth329c5a62017-11-29 11:42:33 -05002076 if (is_ios) {
2077 bundle_ios_data = true
2078 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002079 sources = [
Chris Dalton2d18f412018-02-20 13:23:32 -07002080 "tools/viewer/BisectSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002081 "tools/viewer/GMSlide.cpp",
Brian Osmand67e5182017-12-08 16:46:09 -05002082 "tools/viewer/ImGuiLayer.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002083 "tools/viewer/ImageSlide.cpp",
2084 "tools/viewer/SKPSlide.cpp",
2085 "tools/viewer/SampleSlide.cpp",
Florin Malita76a076b2018-02-15 18:40:48 -05002086 "tools/viewer/SlideDir.cpp",
Brian Osman56a24812017-12-19 11:15:16 -05002087 "tools/viewer/StatsLayer.cpp",
Florin Malitac659c2c2018-04-05 11:57:21 -04002088 "tools/viewer/SvgSlide.cpp",
Brian Osmaneff04b52017-11-21 13:18:02 -05002089 "tools/viewer/Viewer.cpp",
2090 ]
2091 libs = []
2092
2093 include_dirs = []
2094 deps = [
Florin Malitabcd07232018-01-31 11:08:58 -05002095 ":experimental_sksg",
Florin Malitac659c2c2018-04-05 11:57:21 -04002096 ":experimental_svg_model",
Brian Osmaneff04b52017-11-21 13:18:02 -05002097 ":flags",
2098 ":gm",
2099 ":gpu_tool_utils",
2100 ":samples",
2101 ":sk_app",
2102 ":skia",
2103 ":tool_utils",
2104 ":views",
2105 "//third_party/imgui",
2106 "//third_party/jsoncpp",
2107 ]
Florin Malita87ccf332018-05-04 12:23:24 -04002108
2109 if (skia_enable_skottie) {
2110 sources += [ "tools/viewer/SkottieSlide.cpp" ]
2111 deps += [ ":experimental_skottie" ]
2112 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002113 }
2114 }
2115
2116 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
2117 test_app("HelloWorld") {
2118 sources = [
2119 "example/HelloWorld.cpp",
2120 ]
2121 libs = []
2122
2123 include_dirs = []
2124 deps = [
2125 ":flags",
2126 ":gpu_tool_utils",
2127 ":sk_app",
2128 ":skia",
2129 ":tool_utils",
2130 ":views",
2131 ]
2132 }
2133 }
2134
Jim Van Verthecfed2b2017-08-30 14:02:50 -04002135 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002136 test_app("SkiaSDLExample") {
2137 sources = [
2138 "example/SkiaSDLExample.cpp",
2139 ]
2140 libs = []
2141 include_dirs = []
2142 deps = [
2143 ":gpu_tool_utils",
2144 ":skia",
2145 "//third_party/libsdl",
2146 ]
2147 }
2148 }
2149
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002150 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2151 action_foreach("generate_mocs") {
2152 script = "gn/call.py"
2153 sources = [
2154 "tools/mdbviz/MainWindow.h",
2155 ]
2156 outputs = [
2157 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
2158 ]
2159 args = [
2160 "$skia_qt_path" + "/bin/moc",
2161 "{{source}}",
2162 "-o",
2163 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2164 ]
2165 }
2166 action_foreach("generate_resources") {
2167 script = "gn/call.py"
2168 sources = [
2169 "tools/mdbviz/resources.qrc",
2170 ]
2171 outputs = [
2172 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
2173 ]
2174 args = [
2175 "$skia_qt_path" + "/bin/rcc",
2176 "{{source}}",
2177 "-o",
2178 "gen/mdbviz/{{source_name_part}}_res.cpp",
2179 ]
2180 }
2181 test_app("mdbviz") {
2182 if (is_win) {
2183 # on Windows we need to disable some exception handling warnings due to the Qt headers
2184 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2185 }
2186 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002187 "tools/UrlDataManager.cpp",
2188 "tools/debugger/SkDebugCanvas.cpp",
2189 "tools/debugger/SkDrawCommand.cpp",
2190 "tools/debugger/SkJsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002191 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002192 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002193 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002194 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002195
2196 # generated files
2197 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2198 "$target_gen_dir/mdbviz/resources_res.cpp",
2199 ]
2200 lib_dirs = [ "$skia_qt_path/lib" ]
2201 libs = [
2202 "Qt5Core.lib",
2203 "Qt5Gui.lib",
2204 "Qt5Widgets.lib",
2205 ]
2206 include_dirs = [
2207 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002208 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002209 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002210 "tools",
2211 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002212 ]
2213 deps = [
2214 ":generate_mocs",
2215 ":generate_resources",
2216 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002217 "//third_party/jsoncpp",
2218 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002219 ]
2220 }
2221 }
2222
Mike Kleine459afd2017-03-03 09:21:30 -05002223 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002224 copy("gdbserver") {
2225 sources = [
2226 "$ndk/$ndk_gdbserver",
2227 ]
2228 outputs = [
2229 "$root_out_dir/gdbserver",
2230 ]
2231 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002232 }
mtklein25c81d42016-07-27 13:55:26 -07002233}