blob: 6e24d3dec07ddea06c323f8f22449c3744a520c0 [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 Klein38af9432016-11-11 11:39:44 -050028 skia_use_lua = false
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
mtklein1bd72ba2016-09-16 07:45:52 -070033
Mike Klein7d921032017-01-05 12:20:41 -050034 skia_android_serial = ""
Brian Osman3f375d02016-12-28 11:19:22 -050035 skia_enable_discrete_gpu = true
Mike Kleina04bb452017-02-09 12:24:07 -050036 skia_enable_effects = true
Brian Osmanf2c90142017-07-13 15:50:03 -040037 skia_enable_flutter_defines = false
mtklein06c35c02016-09-20 12:28:12 -070038 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050039 skia_enable_pdf = true
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040040 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050041 skia_enable_tools = is_skia_dev_build
42 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Daniel686bb212016-10-27 10:48:48 -040043 skia_vulkan_sdk = getenv("VULKAN_SDK")
Robert Phillipsa6d2d702017-09-01 12:17:03 -040044 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040045 skia_compile_processors = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070046 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040047
48 skia_jumper_clang = ""
49 skia_jumper_objdump = ""
50 skia_jumper_ccache = ""
mtkleinc04ff472016-06-23 10:29:30 -070051}
Brian Salomon23d73ea2016-10-27 13:31:37 -040052declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040053 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040054 skia_use_sfntly = skia_use_icu
55
Mike Klein4d598a32016-10-31 13:44:49 -040056 if (is_android) {
57 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070058 } else if (is_fuchsia) {
59 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040060 } else {
61 skia_use_vulkan = skia_vulkan_sdk != ""
62 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040063}
Greg Danielec6ae522017-04-25 13:38:26 -040064declare_args() {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000065 skia_vulkan_headers = ""
Greg Danielec6ae522017-04-25 13:38:26 -040066 if (skia_use_vulkan) {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000067 # 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 -040068 if (is_fuchsia) {
69 skia_vulkan_headers = "$fuchsia_vulkan_sdk/include"
70 } else if (is_linux || is_win) {
71 skia_vulkan_headers = "$skia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040072 }
Greg Danielec6ae522017-04-25 13:38:26 -040073 }
74}
Brian Salomon789e25e2016-09-30 13:41:03 -040075
Adam Barth54ef74a2017-10-13 10:59:38 -070076if (defined(skia_settings)) {
77 import(skia_settings)
78}
79
mtklein38925aa2016-09-21 10:11:25 -070080# Our tools require static linking (they use non-exported symbols).
81skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070082
mtkleina45be612016-08-29 15:22:10 -070083fontmgr_android_enabled = skia_use_expat && skia_use_freetype
84
mtklein1211e0c2016-07-26 13:55:45 -070085skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070086 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070087 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070088 "include/codec",
89 "include/config",
90 "include/core",
91 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -040092 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -070093 "include/gpu",
94 "include/gpu/gl",
mtklein1211e0c2016-07-26 13:55:45 -070095 "include/pathops",
96 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070097 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070098 "include/utils",
99 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700100]
101
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000102if (skia_use_vulkan) {
103 skia_public_includes += [ "include/gpu/vk" ]
104}
Greg Daniele5ddff52017-07-05 16:49:36 -0400105if (skia_use_metal) {
106 skia_public_includes += [ "include/gpu/mtl" ]
107}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000108
mtkleinc04ff472016-06-23 10:29:30 -0700109# Skia public API, generally provided by :skia.
110config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700111 include_dirs = skia_public_includes
Greg Danielec6ae522017-04-25 13:38:26 -0400112 if (skia_vulkan_headers != "") {
113 include_dirs += [ skia_vulkan_headers ]
114 }
Mike Kleinae7e6712016-10-11 17:49:33 -0400115 defines = []
116 if (is_component_build) {
117 defines += [ "SKIA_DLL" ]
118 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400119 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700120 defines += [ "SK_SAMPLES_FOR_X" ]
121 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400122 if (skia_enable_flutter_defines) {
123 defines += flutter_defines
124 }
mtklein06c35c02016-09-20 12:28:12 -0700125 if (!skia_enable_gpu) {
126 defines += [ "SK_SUPPORT_GPU=0" ]
127 }
mtkleinc04ff472016-06-23 10:29:30 -0700128}
129
130# Skia internal APIs, used by Skia itself and a few test tools.
131config("skia_private") {
132 visibility = [ ":*" ]
133
134 include_dirs = [
135 "include/private",
136 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700137 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700138 "src/core",
139 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700140 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700141 "src/image",
142 "src/images",
143 "src/lazy",
144 "src/opts",
145 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700146 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700147 "src/ports",
148 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400149 "src/shaders",
150 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700151 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700152 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700153 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500154 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700155 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700156 ]
mtklein150d1132016-08-01 06:56:40 -0700157
Mike Reeda9e241d2017-05-03 10:52:00 -0400158 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700159 if (is_android) {
160 defines += [
161 "SK_GAMMA_EXPONENT=1.4",
162 "SK_GAMMA_CONTRAST=0.0",
163 ]
164 }
mtklein88a7ac02016-09-14 11:16:49 -0700165 if (is_official_build || is_android) {
166 # TODO(bsalomon): it'd be nice to make Android normal.
167 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
168 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400169 libs = []
170 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500171 if (skia_enable_gpu) {
172 include_dirs += [ "src/gpu" ]
173 }
Brian Osman34755e22016-12-05 09:46:02 -0500174 if (skia_use_angle) {
175 defines += [ "SK_ANGLE" ]
176 }
Brian Osman3f375d02016-12-28 11:19:22 -0500177 if (skia_enable_discrete_gpu) {
178 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
179 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400180 if (!is_official_build) {
181 defines += [ "GR_TEST_UTILS=1" ]
182 }
mtkleinc04ff472016-06-23 10:29:30 -0700183}
184
185# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
186config("skia_library") {
187 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700188 defines = [ "SKIA_IMPLEMENTATION=1" ]
189}
190
191skia_library_configs = [
192 ":skia_public",
193 ":skia_private",
194 ":skia_library",
195]
196
mtklein9b8583d2016-08-24 17:32:30 -0700197# Use for CPU-specific Skia code that needs particular compiler flags.
198template("opts") {
199 if (invoker.enabled) {
200 source_set(target_name) {
201 forward_variables_from(invoker, "*")
202 configs += skia_library_configs
203 }
204 } else {
205 # If not enabled, a phony empty target that swallows all otherwise unused variables.
206 source_set(target_name) {
207 forward_variables_from(invoker,
208 "*",
209 [
210 "sources",
211 "cflags",
212 ])
213 }
214 }
anmittala7eaf2e2016-08-17 13:57:26 -0700215}
216
mtklein422310d2016-08-16 18:28:43 -0700217is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700218
mtklein7d6fb2c2016-08-25 14:50:44 -0700219opts("none") {
220 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700221 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700222 cflags = []
223}
224
mtklein7d6fb2c2016-08-25 14:50:44 -0700225opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700226 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700227 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700228 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700229}
230
231opts("arm64") {
232 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700233 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700234 cflags = []
235}
236
237opts("crc32") {
238 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700239 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700240 cflags = [ "-march=armv8-a+crc" ]
241}
242
mtklein9b8583d2016-08-24 17:32:30 -0700243opts("sse2") {
244 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700245 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400246 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400247 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
248 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400249 cflags = [ "-msse2" ]
250 }
mtklein9b8583d2016-08-24 17:32:30 -0700251}
mtkleinc04ff472016-06-23 10:29:30 -0700252
mtklein9b8583d2016-08-24 17:32:30 -0700253opts("ssse3") {
254 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700255 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400256 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400257 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
258 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400259 cflags = [ "-mssse3" ]
260 }
mtklein9b8583d2016-08-24 17:32:30 -0700261}
mtkleinc04ff472016-06-23 10:29:30 -0700262
mtklein9b8583d2016-08-24 17:32:30 -0700263opts("sse41") {
264 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700265 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400266 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400267 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
268 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400269 cflags = [ "-msse4.1" ]
270 }
mtklein9b8583d2016-08-24 17:32:30 -0700271}
mtklein4e976072016-08-08 09:06:27 -0700272
mtklein9b8583d2016-08-24 17:32:30 -0700273opts("sse42") {
274 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700275 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400276 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400277 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
278 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400279 cflags = [ "-msse4.2" ]
280 }
mtklein9b8583d2016-08-24 17:32:30 -0700281}
282
283opts("avx") {
284 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700285 sources = skia_opts.avx_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400286 if (!is_clang && is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000287 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400288 } else {
289 cflags = [ "-mavx" ]
290 }
mtkleinc04ff472016-06-23 10:29:30 -0700291}
292
mtkleinc095df52016-08-24 12:23:52 -0700293# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700294template("optional") {
295 if (invoker.enabled) {
296 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700297 if (defined(invoker.public_defines)) {
298 defines = invoker.public_defines
299 }
mtklein457b42a2016-08-23 13:56:37 -0700300 }
301 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700302 forward_variables_from(invoker,
303 "*",
304 [
305 "public_defines",
306 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700307 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700308 ])
mtklein457b42a2016-08-23 13:56:37 -0700309 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700310 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700311 if (defined(invoker.configs_to_remove)) {
312 configs -= invoker.configs_to_remove
313 }
mtklein457b42a2016-08-23 13:56:37 -0700314 }
315 } else {
mtklein457b42a2016-08-23 13:56:37 -0700316 source_set(target_name) {
317 forward_variables_from(invoker,
318 "*",
319 [
320 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700321 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700322 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700323 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700324 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700325 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700326 ])
mtkleincd01b032016-08-31 04:58:19 -0700327 if (defined(invoker.sources_when_disabled)) {
328 sources = invoker.sources_when_disabled
329 }
330 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700331 }
mtkleineb3c4252016-08-23 07:38:09 -0700332 }
mtklein457b42a2016-08-23 13:56:37 -0700333}
mtklein457b42a2016-08-23 13:56:37 -0700334
Mike Kleina04bb452017-02-09 12:24:07 -0500335optional("effects") {
336 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400337 deps = [
338 ":compile_processors",
339 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500340 sources =
341 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
342 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
343}
344
mtkleina45be612016-08-29 15:22:10 -0700345optional("fontmgr_android") {
346 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700347
348 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500349 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700350 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700351 ]
352 sources = [
353 "src/ports/SkFontMgr_android.cpp",
354 "src/ports/SkFontMgr_android_factory.cpp",
355 "src/ports/SkFontMgr_android_parser.cpp",
356 ]
357}
358
mtkleind2e39db2016-09-07 07:52:55 -0700359optional("fontmgr_custom") {
360 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
361
362 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500363 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700364 ]
365 sources = [
366 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500367 "src/ports/SkFontMgr_custom.h",
368 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700369 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500370 "src/ports/SkFontMgr_custom_embedded.cpp",
371 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700372 ]
373}
374
mtklein3cc22182016-08-29 13:26:14 -0700375optional("fontmgr_fontconfig") {
376 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700377
378 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500379 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700380 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700381 ]
382 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700383 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700384 "src/ports/SkFontConfigInterface_direct.cpp",
385 "src/ports/SkFontConfigInterface_direct_factory.cpp",
386 "src/ports/SkFontMgr_FontConfigInterface.cpp",
387 "src/ports/SkFontMgr_fontconfig.cpp",
388 "src/ports/SkFontMgr_fontconfig_factory.cpp",
389 ]
390}
391
mtkleincdedd0e2016-09-12 15:15:44 -0700392optional("fontmgr_fuchsia") {
393 enabled = is_fuchsia && skia_use_freetype
394
395 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500396 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700397 ]
398 sources = [
399 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500400 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700401 "src/ports/SkFontMgr_custom_empty_factory.cpp",
402 ]
403}
404
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700405if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400406 executable("sksllex") {
407 sources = [
408 "src/sksl/lex/Main.cpp",
409 "src/sksl/lex/NFA.cpp",
410 "src/sksl/lex/RegexNode.cpp",
411 "src/sksl/lex/RegexParser.cpp",
412 ]
413 include_dirs = [ "src/sksl/lex" ]
414 }
415
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700416 action("run_sksllex") {
417 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400418 deps = [
419 ":sksllex(//gn/toolchain:$host_toolchain)",
420 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700421 sources = [
422 "src/sksl/lex/layout.lex",
423 "src/sksl/lex/sksl.lex",
424 ]
425
426 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
427 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
428 outputs = [
429 "$target_out_dir/" +
430 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
431 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
432 # confused due to the same file being named by two different paths
433 ]
434 sksllex_path = "$root_out_dir/"
435 sksllex_path += "sksllex"
436 if (host_os == "win") {
437 sksllex_path += ".exe"
438 }
439 args = [
440 rebase_path(sksllex_path),
441 rebase_path("bin/clang-format"),
442 rebase_path("src"),
443 ]
444 }
445} else {
446 group("run_sksllex") {
447 }
448}
449
450if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400451 executable("skslc") {
452 defines = [ "SKSL_STANDALONE" ]
453 sources = [
454 "src/sksl/SkSLMain.cpp",
455 ]
456 sources += skia_sksl_sources
457 include_dirs = [
458 "src/gpu",
459 "src/sksl",
460 ]
461 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500462 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400463 "//third_party/spirv-tools",
464 ]
465 }
466
467 skia_gpu_processor_outputs = []
468 foreach(src, skia_gpu_processor_sources) {
469 dir = get_path_info(src, "dir")
470 name = get_path_info(src, "name")
471
472 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
473 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
474 skia_gpu_processor_outputs += [
475 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
476 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
477 # confused due to the same file being named by two different paths
478 ]
479 }
480
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500481 action("create_sksl_enums") {
482 script = "gn/create_sksl_enums.py"
483 sources = [
484 "include/private/GrSharedEnums.h",
485 ]
486 outputs = [
487 "$target_out_dir/" +
488 rebase_path("src/sksl/sksl_enums.include", target_out_dir),
489 ]
490 args = [
491 rebase_path(sources[0]),
492 rebase_path(outputs[0]),
493 ]
494 }
495
Ethan Nicholas762466e2017-06-29 10:03:38 -0400496 action("compile_processors") {
497 script = "gn/compile_processors.py"
498 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500499 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400500 ":skslc(//gn/toolchain:$host_toolchain)",
501 ]
502 sources = skia_gpu_processor_sources
503 outputs = skia_gpu_processor_outputs
504 skslc_path = "$root_out_dir/"
505 if (host_toolchain != default_toolchain_name) {
506 skslc_path += "$host_toolchain/"
507 }
508 skslc_path += "skslc"
509 if (host_os == "win") {
510 skslc_path += ".exe"
511 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400512 args = [
513 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400514 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400515 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400516 args += rebase_path(skia_gpu_processor_sources)
517 }
518} else {
519 skia_gpu_processor_outputs = []
520 group("compile_processors") {
521 }
522}
523
mtklein06c35c02016-09-20 12:28:12 -0700524optional("gpu") {
525 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400526 deps = [
527 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700528 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400529 ]
mtkleine9fb3d52016-09-20 15:11:46 -0700530 public_defines = []
531
Mike Klein29b3e582017-02-09 11:57:32 -0500532 sources = skia_gpu_sources + skia_sksl_sources +
Ethan Nicholas762466e2017-06-29 10:03:38 -0400533 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] +
534 skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700535
536 # These paths need to be absolute to match the ones produced by shared_sources.gni.
537 sources -= get_path_info([
538 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
539 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
540 ],
541 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400542 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700543 if (is_android) {
544 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400545
546 # this lib is required to link against AHardwareBuffer
547 if (defined(ndk_api) && ndk_api >= 26) {
548 libs += [ "android" ]
549 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400550 } else if (skia_use_egl) {
551 sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
552 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700553 } else if (is_linux) {
554 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500555 libs += [
556 "GL",
557 "GLU",
558 ]
mtklein06c35c02016-09-20 12:28:12 -0700559 } else if (is_mac) {
560 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800561 } else if (is_ios) {
562 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400563 } else if (is_win) {
564 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
565 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700566 } else {
567 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
568 }
mtkleine9fb3d52016-09-20 15:11:46 -0700569
570 if (skia_use_vulkan) {
571 public_defines += [ "SK_VULKAN" ]
572 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700573 if (skia_enable_vulkan_debug_layers) {
574 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
575 }
mtkleine9fb3d52016-09-20 15:11:46 -0700576 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400577 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400578 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400579 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
580 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400581
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400582 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400583 if (skia_use_metal) {
584 public_defines += [ "SK_METAL" ]
585 sources += skia_metal_sources
586 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400587 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400588 }
mtklein06c35c02016-09-20 12:28:12 -0700589}
590
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400591optional("heif") {
592 enabled = skia_use_libheif
593 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
594
595 deps = []
596
597 sources = [
598 "src/codec/SkHeifCodec.cpp",
599 ]
600}
601
mtklein63213812016-08-24 09:55:56 -0700602optional("jpeg") {
603 enabled = skia_use_libjpeg_turbo
604 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
605
mtklein63213812016-08-24 09:55:56 -0700606 deps = [
607 "//third_party/libjpeg-turbo:libjpeg",
608 ]
609 sources = [
610 "src/codec/SkJpegCodec.cpp",
611 "src/codec/SkJpegDecoderMgr.cpp",
612 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700613 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400614 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700615 ]
616}
617
618optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500619 enabled = skia_use_zlib && skia_enable_pdf
620 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700621
mtklein63213812016-08-24 09:55:56 -0700622 deps = [
623 "//third_party/zlib",
624 ]
brettwb9447282016-09-01 14:24:39 -0700625 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700626 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700627
628 if (skia_use_sfntly) {
629 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500630 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700631 }
632}
633
634optional("png") {
635 enabled = skia_use_libpng
636 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
637
mtklein63213812016-08-24 09:55:56 -0700638 deps = [
639 "//third_party/libpng",
640 ]
641 sources = [
642 "src/codec/SkIcoCodec.cpp",
643 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400644 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700645 ]
646}
647
scroggof84ad642016-10-31 09:02:57 -0700648optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400649 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700650 public_defines = [ "SK_CODEC_DECODES_RAW" ]
651
652 deps = [
653 "//third_party/dng_sdk",
654 "//third_party/libjpeg-turbo:libjpeg",
655 "//third_party/piex",
656 ]
657
658 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
659 # Skia.
660 configs_to_remove = [ "//gn:no_exceptions" ]
661
662 sources = [
663 "src/codec/SkRawAdapterCodec.cpp",
664 "src/codec/SkRawCodec.cpp",
665 ]
666}
667
mtklein3cc22182016-08-29 13:26:14 -0700668optional("typeface_freetype") {
669 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700670
671 deps = [
672 "//third_party/freetype2",
673 ]
674 sources = [
675 "src/ports/SkFontHost_FreeType.cpp",
676 "src/ports/SkFontHost_FreeType_common.cpp",
677 ]
678}
679
mtklein457b42a2016-08-23 13:56:37 -0700680optional("webp") {
681 enabled = skia_use_libwebp
682 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
683
mtklein457b42a2016-08-23 13:56:37 -0700684 deps = [
685 "//third_party/libwebp",
686 ]
687 sources = [
688 "src/codec/SkWebpAdapterCodec.cpp",
689 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400690 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700691 ]
mtkleineb3c4252016-08-23 07:38:09 -0700692}
693
mtklein63213812016-08-24 09:55:56 -0700694optional("xml") {
695 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000696 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700697
mtklein63213812016-08-24 09:55:56 -0700698 deps = [
699 "//third_party/expat",
700 ]
701 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500702 "src/svg/SkSVGCanvas.cpp",
703 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700704 "src/xml/SkDOM.cpp",
705 "src/xml/SkXMLParser.cpp",
706 "src/xml/SkXMLWriter.cpp",
707 ]
708}
709
mtkleinc04ff472016-06-23 10:29:30 -0700710component("skia") {
711 public_configs = [ ":skia_public" ]
712 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700713
714 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700715 ":arm64",
716 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700717 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700718 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500719 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700720 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700721 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700722 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700723 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700724 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400725 ":heif",
mtklein63213812016-08-24 09:55:56 -0700726 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700727 ":none",
mtklein63213812016-08-24 09:55:56 -0700728 ":pdf",
729 ":png",
scroggof84ad642016-10-31 09:02:57 -0700730 ":raw",
mtklein9b8583d2016-08-24 17:32:30 -0700731 ":sse2",
732 ":sse41",
733 ":sse42",
734 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700735 ":webp",
mtklein63213812016-08-24 09:55:56 -0700736 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700737 ]
738
Chinmay Garde43f115c2016-11-16 15:04:12 -0800739 # This file (and all GN files in Skia) are designed to work with an
740 # empty sources assignment filter; we handle all that explicitly.
741 # We clear the filter here for clients who may have set up a global filter.
742 set_sources_assignment_filter([])
743
mtkleinc04ff472016-06-23 10:29:30 -0700744 sources = []
brettwb9447282016-09-01 14:24:39 -0700745 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700746 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500747 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700748 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400749 "src/android/SkAndroidFrameworkUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700750 "src/android/SkBitmapRegionCodec.cpp",
751 "src/android/SkBitmapRegionDecoder.cpp",
752 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400753 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700754 "src/codec/SkBmpCodec.cpp",
755 "src/codec/SkBmpMaskCodec.cpp",
756 "src/codec/SkBmpRLECodec.cpp",
757 "src/codec/SkBmpStandardCodec.cpp",
758 "src/codec/SkCodec.cpp",
759 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700760 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700761 "src/codec/SkMaskSwizzler.cpp",
762 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700763 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700764 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700765 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700766 "src/codec/SkSwizzler.cpp",
767 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700768 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700769 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700770 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700771 "src/ports/SkMemory_malloc.cpp",
772 "src/ports/SkOSFile_stdio.cpp",
773 "src/sfnt/SkOTTable_name.cpp",
774 "src/sfnt/SkOTUtils.cpp",
775 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700776 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700777 ]
brettwb9447282016-09-01 14:24:39 -0700778
mtklein7d6fb2c2016-08-25 14:50:44 -0700779 libs = []
780
mtkleinc04ff472016-06-23 10:29:30 -0700781 if (is_win) {
782 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400783 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700784 "src/ports/SkDebug_win.cpp",
785 "src/ports/SkFontHost_win.cpp",
786 "src/ports/SkFontMgr_win_dw.cpp",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500787 "src/ports/SkFontMgr_win_dw_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700788 "src/ports/SkImageEncoder_WIC.cpp",
789 "src/ports/SkImageGeneratorWIC.cpp",
790 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700791 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700792 "src/ports/SkScalerContext_win_dw.cpp",
793 "src/ports/SkTLS_win.cpp",
794 "src/ports/SkTypeface_win_dw.cpp",
795 ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400796 libs += [
797 "FontSub.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500798 "Gdi32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400799 "Ole32.lib",
800 "OleAut32.lib",
801 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -0500802 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -0400803 ]
mtkleinc04ff472016-06-23 10:29:30 -0700804 } else {
805 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700806 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700807 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700808 "src/ports/SkTLS_pthread.cpp",
809 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400810 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700811 }
812
mtklein7d6fb2c2016-08-25 14:50:44 -0700813 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500814 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500815 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500816 deps += [ "//third_party/cpu-features" ]
817 }
mtklein06c35c02016-09-20 12:28:12 -0700818 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700819 libs += [
820 "EGL",
821 "GLESv2",
822 "log",
823 ]
824 }
825
mtkleinc04ff472016-06-23 10:29:30 -0700826 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700827 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700828 }
829
830 if (is_mac) {
831 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700832 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700833 "src/ports/SkFontHost_mac.cpp",
834 "src/ports/SkImageEncoder_CG.cpp",
835 "src/ports/SkImageGeneratorCG.cpp",
836 ]
mtklein09e61f72016-08-23 13:35:28 -0700837 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400838 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
839 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700840 "ApplicationServices.framework",
841 "OpenGL.framework",
842 ]
mtkleinc04ff472016-06-23 10:29:30 -0700843 }
abarth6fc8ff02016-07-15 15:15:15 -0700844
Mike Klein7d302882016-11-03 14:06:31 -0400845 if (is_ios) {
846 sources += [
847 "src/ports/SkDebug_stdio.cpp",
848 "src/ports/SkFontHost_mac.cpp",
849 "src/ports/SkImageEncoder_CG.cpp",
850 "src/ports/SkImageGeneratorCG.cpp",
851 ]
852 libs += [
853 "CoreFoundation.framework",
854 "CoreGraphics.framework",
855 "CoreText.framework",
856 "ImageIO.framework",
857 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400858
859 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
860 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400861 ]
862 }
863
abarth6fc8ff02016-07-15 15:15:15 -0700864 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700865 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700866 }
mtkleinc04ff472016-06-23 10:29:30 -0700867}
868
mtkleinc095df52016-08-24 12:23:52 -0700869# Targets guarded by skia_enable_tools may use //third_party freely.
870if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -0500871 # Used by gn_to_bp.py to list our public include dirs.
872 source_set("public") {
873 configs += [ ":skia_public" ]
874 }
875
Mike Kleinc36dedf2016-11-18 09:35:28 -0500876 config("skia.h_config") {
877 include_dirs = [ "$target_gen_dir" ]
878 }
879 action("skia.h") {
880 public_configs = [ ":skia.h_config" ]
881 skia_h = "$target_gen_dir/skia.h"
882 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -0400883 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000884 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -0500885 depfile = "$skia_h.deps"
886 outputs = [
887 skia_h,
888 ]
889 }
890
891 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -0500892 executable("fiddle") {
893 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -0500894 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -0500895 "tools/fiddle/draw.cpp",
896 "tools/fiddle/fiddle_main.cpp",
897 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -0400898
899 if (skia_use_egl) {
900 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -0400901 } else {
902 sources += [ "tools/fiddle/null_context.cpp" ]
903 }
Joe Gregorio1e735c02017-04-19 14:05:14 -0400904 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -0500905 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -0400906 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -0500907 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -0500908 ":skia",
909 ":skia.h",
910 ]
911 }
912 }
913
914 if (skia_enable_gpu) {
915 source_set("public_headers_warnings_check") {
916 sources = [
917 "tools/public_headers_warnings_check.cpp",
918 ]
919 configs -= [ "//gn:warnings_except_public_headers" ]
920 deps = [
921 ":skia",
922 ":skia.h",
923 ]
924 }
925 }
926
mtkleinc095df52016-08-24 12:23:52 -0700927 template("test_lib") {
928 config(target_name + "_config") {
929 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700930 if (defined(invoker.public_defines)) {
931 defines = invoker.public_defines
932 }
mtklein25c81d42016-07-27 13:55:26 -0700933 }
mtkleinc095df52016-08-24 12:23:52 -0700934 source_set(target_name) {
935 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
936 public_configs = [
937 ":" + target_name + "_config",
938 ":skia_private",
939 ]
940
941 if (!defined(deps)) {
942 deps = []
943 }
944 deps += [ ":skia" ]
945 testonly = true
946 }
mtklein25c81d42016-07-27 13:55:26 -0700947 }
mtklein25c81d42016-07-27 13:55:26 -0700948
Mike Kleine6682eb2017-01-05 10:54:57 -0500949 template("test_app") {
950 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
951 shared_library("lib" + target_name) {
952 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400953 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500954 testonly = true
955 }
956 } else {
Mike Klein7d921032017-01-05 12:20:41 -0500957 _executable = target_name
958 executable(_executable) {
Mike Kleine6682eb2017-01-05 10:54:57 -0500959 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400960 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500961 testonly = true
962 }
963 }
Mike Klein7d921032017-01-05 12:20:41 -0500964 if (is_android && skia_android_serial != "" && defined(_executable)) {
965 action("push_" + target_name) {
966 script = "gn/push_to_android.py"
967 deps = [
968 ":" + _executable,
969 ]
970 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
971 outputs = [
972 _stamp,
973 ]
974 args = [
975 rebase_path("$root_build_dir/$_executable"),
976 skia_android_serial,
977 rebase_path(_stamp),
978 ]
979 testonly = true
980 }
981 }
Mike Kleine6682eb2017-01-05 10:54:57 -0500982 }
983
mtkleinc095df52016-08-24 12:23:52 -0700984 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700985 public_include_dirs = []
986 if (skia_enable_gpu) {
987 public_defines = []
988 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700989
990 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700991 sources = [
992 "tools/gpu/GrContextFactory.cpp",
993 "tools/gpu/GrTest.cpp",
994 "tools/gpu/TestContext.cpp",
995 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -0700996 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -0700997 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
998 "tools/gpu/gl/debug/GrBufferObj.cpp",
999 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1000 "tools/gpu/gl/debug/GrProgramObj.cpp",
1001 "tools/gpu/gl/debug/GrShaderObj.cpp",
1002 "tools/gpu/gl/debug/GrTextureObj.cpp",
1003 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1004 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001005 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001006 ]
1007 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001008
Kevin Lubick4a24e102017-03-29 11:19:01 -04001009 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001010 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001011 } else if (is_ios) {
1012 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1013 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001014 } else if (is_linux) {
1015 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001016 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001017 } else if (is_mac) {
1018 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001019 } else if (is_win) {
1020 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1021 libs += [
1022 "Gdi32.lib",
1023 "OpenGL32.lib",
1024 ]
mtklein38925aa2016-09-21 10:11:25 -07001025 }
mtklein6ef69992016-09-14 06:12:09 -07001026
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001027 cflags_objcc = [ "-fobjc-arc" ]
1028
Mike Kleinc168a3a2016-11-14 14:53:13 +00001029 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001030 deps += [ "//third_party/angle2" ]
1031 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1032 }
mtkleind68f9b02016-09-23 13:18:41 -07001033 if (skia_use_vulkan) {
1034 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001035 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001036 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001037 if (skia_use_metal) {
1038 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1039 }
mtkleina627b5c2016-09-20 13:36:47 -07001040 }
mtklein25c81d42016-07-27 13:55:26 -07001041 }
mtklein25c81d42016-07-27 13:55:26 -07001042
mtkleinc095df52016-08-24 12:23:52 -07001043 test_lib("flags") {
1044 public_include_dirs = [ "tools/flags" ]
1045 sources = [
1046 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001047 ]
1048 }
1049 test_lib("common_flags") {
1050 public_include_dirs = [ "tools/flags" ]
1051 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001052 "tools/flags/SkCommonFlags.cpp",
1053 "tools/flags/SkCommonFlagsConfig.cpp",
1054 ]
1055 deps = [
mtklein046cb562016-09-16 10:23:12 -07001056 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001057 ":gpu_tool_utils",
1058 ]
1059 }
mtklein25c81d42016-07-27 13:55:26 -07001060
mtkleinc095df52016-08-24 12:23:52 -07001061 test_lib("tool_utils") {
1062 public_include_dirs = [
1063 "tools",
1064 "tools/debugger",
1065 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001066 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001067 ]
1068 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001069 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001070 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001071 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001072 "tools/ProcStats.cpp",
1073 "tools/Resources.cpp",
Mike Klein10d66cc2017-11-10 11:33:43 -05001074 "tools/SkRandomScalerContext.cpp",
1075 "tools/SkTestScalerContext.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001076 "tools/ThermalManager.cpp",
1077 "tools/UrlDataManager.cpp",
1078 "tools/debugger/SkDebugCanvas.cpp",
1079 "tools/debugger/SkDrawCommand.cpp",
1080 "tools/debugger/SkJsonWriteBuffer.cpp",
1081 "tools/debugger/SkObjectParser.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001082 "tools/picture_utils.cpp",
1083 "tools/random_parse_path.cpp",
1084 "tools/sk_tool_utils.cpp",
1085 "tools/sk_tool_utils_font.cpp",
1086 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001087 "tools/trace/SkChromeTracingTracer.cpp",
1088 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001089 "tools/trace/SkDebugfTracer.cpp",
1090 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001091 "tools/trace/SkEventTracingPriv.cpp",
1092 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001093 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001094 libs = []
1095 if (is_ios) {
1096 sources += [ "tools/ios_utils.m" ]
1097 libs += [ "Foundation.framework" ]
1098 }
mtkleinc095df52016-08-24 12:23:52 -07001099 deps = [
mtklein046cb562016-09-16 10:23:12 -07001100 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001101 ":flags",
1102 "//third_party/libpng",
1103 ]
1104 public_deps = [
1105 "//third_party/jsoncpp",
1106 ]
1107 }
mtklein25c81d42016-07-27 13:55:26 -07001108
Mike Klein6e744122016-10-27 12:21:40 -04001109 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001110 test_lib("gm") {
1111 public_include_dirs = [ "gm" ]
1112 sources = gm_sources
1113 deps = [
scroggo19b91532016-10-24 09:03:26 -07001114 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001115 ":gpu_tool_utils",
1116 ":skia",
1117 ":tool_utils",
1118 ]
1119 }
mtklein25c81d42016-07-27 13:55:26 -07001120
Mike Klein6e744122016-10-27 12:21:40 -04001121 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001122 test_lib("tests") {
1123 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001124 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001125 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001126 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001127 }
mtkleinc095df52016-08-24 12:23:52 -07001128 deps = [
fmalita6cf896d2016-08-25 08:44:35 -07001129 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001130 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001131 ":skia",
1132 ":tool_utils",
1133 "//third_party/libpng",
1134 "//third_party/zlib",
1135 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001136 public_deps = [
1137 ":gpu_tool_utils", # Test.h #includes headers from this target.
1138 ]
mtkleinc095df52016-08-24 12:23:52 -07001139 }
mtklein2f3416d2016-08-02 16:02:05 -07001140
Mike Klein6e744122016-10-27 12:21:40 -04001141 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001142 test_lib("bench") {
1143 public_include_dirs = [ "bench" ]
1144 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001145 deps = [
1146 ":flags",
1147 ":gm",
1148 ":gpu_tool_utils",
1149 ":skia",
1150 ":tool_utils",
1151 ]
1152 }
mtklein2b6870c2016-07-28 14:17:33 -07001153
mtkleinc095df52016-08-24 12:23:52 -07001154 test_lib("experimental_svg_model") {
1155 public_include_dirs = [ "experimental/svg/model" ]
1156 sources = [
1157 "experimental/svg/model/SkSVGAttribute.cpp",
1158 "experimental/svg/model/SkSVGAttributeParser.cpp",
1159 "experimental/svg/model/SkSVGCircle.cpp",
Florin Malitace8840e2016-12-08 09:26:47 -05001160 "experimental/svg/model/SkSVGClipPath.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001161 "experimental/svg/model/SkSVGContainer.cpp",
1162 "experimental/svg/model/SkSVGDOM.cpp",
1163 "experimental/svg/model/SkSVGEllipse.cpp",
Florin Malitadf007e12017-10-09 15:14:13 -04001164 "experimental/svg/model/SkSVGGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001165 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001166 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001167 "experimental/svg/model/SkSVGNode.cpp",
1168 "experimental/svg/model/SkSVGPath.cpp",
Florin Malita1aa1bb62017-10-11 14:34:33 -04001169 "experimental/svg/model/SkSVGPattern.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001170 "experimental/svg/model/SkSVGPoly.cpp",
Florin Malitacc6cc292017-10-09 16:05:30 -04001171 "experimental/svg/model/SkSVGRadialGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001172 "experimental/svg/model/SkSVGRect.cpp",
1173 "experimental/svg/model/SkSVGRenderContext.cpp",
1174 "experimental/svg/model/SkSVGSVG.cpp",
1175 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001176 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001177 "experimental/svg/model/SkSVGTransformableNode.cpp",
Florin Malita6a69c052017-10-11 14:02:11 -04001178 "experimental/svg/model/SkSVGUse.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001179 "experimental/svg/model/SkSVGValue.cpp",
1180 ]
1181 deps = [
1182 ":skia",
1183 ]
1184 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001185
Kevin Lubickebf648e2017-09-21 13:45:16 -04001186 if (target_cpu != "wasm") {
1187 test_lib("views") {
1188 public_include_dirs = [ "include/views" ]
1189 sources = [
1190 "src/views/SkEvent.cpp",
1191 "src/views/SkEventSink.cpp",
1192 "src/views/SkOSMenu.cpp",
1193 "src/views/SkTagList.cpp",
1194 "src/views/SkTouchGesture.cpp",
1195 "src/views/SkView.cpp",
1196 "src/views/SkViewPriv.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001197 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001198 libs = []
1199 deps = []
1200 if (!is_android) {
1201 sources += [ "src/views/SkWindow.cpp" ]
1202 }
1203 if (is_linux) {
1204 public_include_dirs += [ "src/views/unix" ]
1205 sources += [
1206 "src/views/unix/SkOSWindow_Unix.cpp",
1207 "src/views/unix/keysym2ucs.c",
1208 ]
1209 libs += [
1210 "GL",
1211 "X11",
1212 ]
1213 } else if (is_mac) {
1214 sources += [
1215 "src/views/mac/SkEventNotifier.mm",
1216 "src/views/mac/SkNSView.mm",
1217 "src/views/mac/SkOSWindow_Mac.mm",
1218 "src/views/mac/SkTextFieldCell.m",
1219 ]
1220 libs += [
1221 "QuartzCore.framework",
1222 "Cocoa.framework",
1223 "Foundation.framework",
1224 ]
1225 } else if (is_win) {
1226 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1227 } else if (is_ios) {
1228 sources += [ "src/views/mac/SkEventNotifier.mm" ]
1229 }
1230 if (skia_use_angle) {
1231 deps += [ "//third_party/angle2" ]
1232 }
Brian Osman34755e22016-12-05 09:46:02 -05001233 }
Brian Osman16adfa32016-10-18 14:42:44 -04001234 }
1235
Mike Klein38af9432016-11-11 11:39:44 -05001236 if (skia_use_lua) {
1237 test_lib("lua") {
1238 public_include_dirs = []
1239 sources = [
1240 "src/utils/SkLua.cpp",
1241 "src/utils/SkLuaCanvas.cpp",
1242 ]
1243 deps = [
1244 "//third_party/lua",
1245 ]
1246 }
1247
Mike Kleine6682eb2017-01-05 10:54:57 -05001248 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001249 sources = [
1250 "tools/lua/lua_app.cpp",
1251 ]
1252 deps = [
1253 ":lua",
1254 ":skia",
1255 "//third_party/lua",
1256 ]
Mike Klein38af9432016-11-11 11:39:44 -05001257 }
1258
Mike Kleine6682eb2017-01-05 10:54:57 -05001259 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001260 sources = [
1261 "tools/lua/lua_pictures.cpp",
1262 ]
1263 deps = [
1264 ":flags",
1265 ":lua",
1266 ":skia",
1267 ":tool_utils",
1268 "//third_party/lua",
1269 ]
Mike Klein38af9432016-11-11 11:39:44 -05001270 }
1271 }
1272
Cary Clark8032b982017-07-28 11:04:54 -04001273 test_app("bookmaker") {
1274 sources = [
1275 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001276 "tools/bookmaker/cataloger.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001277 "tools/bookmaker/fiddleParser.cpp",
1278 "tools/bookmaker/includeParser.cpp",
1279 "tools/bookmaker/includeWriter.cpp",
1280 "tools/bookmaker/mdOut.cpp",
1281 "tools/bookmaker/parserCommon.cpp",
1282 "tools/bookmaker/spellCheck.cpp",
1283 ]
1284 deps = [
1285 ":flags",
1286 ":skia",
1287 ":tool_utils",
1288 ]
1289 }
1290
Kevin Lubickebf648e2017-09-21 13:45:16 -04001291 if (target_cpu != "wasm") {
1292 import("gn/samples.gni")
1293 test_lib("samples") {
1294 public_include_dirs = [ "samplecode" ]
1295 include_dirs = [ "experimental" ]
1296 sources = samples_sources + [
1297 "experimental/SkSetPoly3To3.cpp",
1298 "experimental/SkSetPoly3To3_A.cpp",
1299 "experimental/SkSetPoly3To3_D.cpp",
Brian Osmancff94e42017-06-26 13:12:37 -04001300
Kevin Lubickebf648e2017-09-21 13:45:16 -04001301 # Relocating these files here, so that clients don't try to build them while they're
1302 # still in active development. Clang's thread safety analysis gets tripped up by
1303 # conditional locks.
1304 "src/core/SkThreadedBMPDevice.cpp",
1305 "src/core/SkThreadedBMPDevice.h",
1306 ]
1307 deps = [
1308 ":experimental_svg_model",
1309 ":flags",
1310 ":gm",
1311 ":tool_utils",
1312 ":views",
1313 ":xml",
1314 ]
Mike Klein38af9432016-11-11 11:39:44 -05001315
Kevin Lubickebf648e2017-09-21 13:45:16 -04001316 if (skia_use_lua) {
1317 sources += [ "samplecode/SampleLua.cpp" ]
1318 deps += [
1319 ":lua",
1320 "//third_party/lua",
1321 ]
1322 }
1323 }
1324 test_app("dm") {
1325 sources = [
1326 "dm/DM.cpp",
Mike Klein31868212017-11-06 12:02:47 -05001327 "dm/DMFontMgr.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001328 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001329 "dm/DMJsonWriter.cpp",
1330 "dm/DMSrcSink.cpp",
1331 ]
1332 include_dirs = [ "tests" ]
1333 deps = [
1334 ":common_flags",
1335 ":experimental_svg_model",
1336 ":flags",
1337 ":gm",
1338 ":gpu_tool_utils",
1339 ":skia",
1340 ":tests",
1341 ":tool_utils",
1342 "//third_party/jsoncpp",
1343 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001344 ]
1345 }
Brian Osman16adfa32016-10-18 14:42:44 -04001346 }
1347
Mike Klein06432b22017-03-21 13:14:33 -04001348 test_app("ok") {
1349 sources = [
Mike Klein361dde02017-11-07 08:14:52 -05001350 "dm/DMFontMgr.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001351 "tools/ok.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001352 "tools/ok_dsts.cpp",
Mike Klein154e6da2017-07-26 15:13:47 -04001353 "tools/ok_engines.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001354 "tools/ok_srcs.cpp",
Mike Kleind63442d2017-03-27 14:16:04 -04001355 "tools/ok_test.cpp",
Mike Kleinf5d1a552017-03-25 12:32:22 -04001356 "tools/ok_vias.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001357 ]
1358 deps = [
Mike Klein4f6e2712017-08-11 10:37:35 -04001359 ":bench",
Mike Klein06432b22017-03-21 13:14:33 -04001360 ":gm",
1361 ":skia",
Mike Kleind63442d2017-03-27 14:16:04 -04001362 ":tests",
Mike Klein62669ad2017-05-09 16:03:07 -04001363 ":tool_utils",
Mike Klein06432b22017-03-21 13:14:33 -04001364 ]
1365 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001366 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001367 sources = [
1368 "bench/nanobench.cpp",
1369 ]
1370 deps = [
1371 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001372 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001373 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001374 ":flags",
1375 ":gm",
1376 ":gpu_tool_utils",
1377 ":skia",
1378 ":tool_utils",
1379 "//third_party/jsoncpp",
1380 ]
mtklein2b6870c2016-07-28 14:17:33 -07001381 }
halcanary19a97202016-08-03 15:08:04 -07001382
Ravi Mistry10d36c52017-01-31 09:49:18 -05001383 test_app("skpinfo") {
1384 sources = [
1385 "tools/skpinfo.cpp",
1386 ]
1387 deps = [
1388 ":flags",
1389 ":skia",
1390 ]
1391 }
1392
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001393 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001394 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001395 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001396 "samplecode/SampleApp.cpp",
1397 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001398 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001399 if (is_mac) {
1400 sources += [ "src/views/mac/skia_mac.mm" ]
1401 } else if (is_win) {
1402 sources += [ "src/views/win/skia_win.cpp" ]
1403 } else if (is_linux) {
1404 sources += [ "src/views/unix/skia_unix.cpp" ]
1405 }
mtklein38925aa2016-09-21 10:11:25 -07001406 deps = [
1407 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001408 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001409 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001410 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001411 ":skia",
1412 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001413 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001414 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001415 if (skia_use_angle) {
1416 deps += [ "//third_party/angle2" ]
1417 }
mtklein38925aa2016-09-21 10:11:25 -07001418 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001419 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001420
Jim Van Verthc1720d42017-10-09 10:16:01 -04001421 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
1422 test_app("HelloWorld") {
1423 sources = [
1424 "example/HelloWorld.cpp",
1425 ]
1426 if (is_mac) {
1427 sources += [ "src/views/mac/skia_mac.mm" ]
1428 } else if (is_win) {
1429 sources += [ "src/views/win/skia_win.cpp" ]
1430 } else if (is_linux) {
1431 sources += [ "src/views/unix/skia_unix.cpp" ]
1432 }
1433 deps = [
1434 ":gpu_tool_utils",
1435 ":skia",
1436 ":views",
1437 ]
1438 }
1439 }
1440
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001441 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001442 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001443 sources = [
1444 "tools/skpbench/skpbench.cpp",
1445 ]
1446 deps = [
1447 ":flags",
1448 ":gpu_tool_utils",
1449 ":skia",
1450 ":tool_utils",
1451 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001452 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001453 }
1454
Mike Klein7d302882016-11-03 14:06:31 -04001455 # We can't yet build ICU on iOS or Windows.
Kevin Lubickebf648e2017-09-21 13:45:16 -04001456 if (!is_ios && !is_win && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001457 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001458 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001459 "tools/shape/SkShaper_harfbuzz.cpp",
1460 "tools/shape/using_skia_and_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001461 ]
1462 deps = [
1463 ":skia",
1464 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001465 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001466 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001467 }
halcanary19a97202016-08-03 15:08:04 -07001468 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001469 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001470 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001471 "tools/shape/SkShaper_primitive.cpp",
1472 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001473 ]
1474 deps = [
1475 ":skia",
1476 ]
halcanary3eee9d92016-09-10 07:01:53 -07001477 }
mtklein046cb562016-09-16 10:23:12 -07001478
Matt Sarett9f1c4032017-05-17 10:06:32 -04001479 test_app("create_flutter_test_images") {
1480 sources = [
1481 "tools/create_flutter_test_images.cpp",
1482 ]
1483 deps = [
1484 ":skia",
1485 ":tool_utils",
1486 ]
1487 }
1488
Ben Wagner219f3622017-07-17 15:32:25 -04001489 test_app("create_test_font") {
1490 sources = [
1491 "tools/create_test_font.cpp",
1492 ]
1493 deps = [
1494 ":skia",
1495 ]
1496 assert_no_deps = [
1497 # tool_utils requires the output of this app.
1498 ":tool_utils",
1499 ]
1500 }
1501
Mike Kleine6682eb2017-01-05 10:54:57 -05001502 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001503 sources = [
1504 "tools/get_images_from_skps.cpp",
1505 ]
1506 deps = [
1507 ":flags",
1508 ":skia",
1509 "//third_party/jsoncpp",
1510 ]
mtklein046cb562016-09-16 10:23:12 -07001511 }
mtkleinecbc5262016-09-22 11:51:24 -07001512
Mike Kleine6682eb2017-01-05 10:54:57 -05001513 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001514 sources = [
1515 "tools/colorspaceinfo.cpp",
1516 ]
1517 deps = [
1518 ":flags",
1519 ":skia",
1520 ":tool_utils",
1521 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001522 }
1523
Kevin Lubickebf648e2017-09-21 13:45:16 -04001524 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001525 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001526 sources = [
1527 "tools/skiaserve/Request.cpp",
1528 "tools/skiaserve/Response.cpp",
1529 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001530 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1531 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1532 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1533 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1534 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1535 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1536 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1537 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1538 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001539 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1540 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001541 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1542 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1543 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1544 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1545 ]
1546 deps = [
1547 ":flags",
1548 ":gpu_tool_utils",
1549 ":skia",
1550 ":tool_utils",
1551 "//third_party/jsoncpp",
1552 "//third_party/libmicrohttpd",
1553 "//third_party/libpng",
1554 ]
Mike Klein7d302882016-11-03 14:06:31 -04001555 }
mtkleinecbc5262016-09-22 11:51:24 -07001556 }
kjlubick14f984b2016-10-03 11:49:45 -07001557
Mike Kleine6682eb2017-01-05 10:54:57 -05001558 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001559 sources = [
1560 "fuzz/FilterFuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001561 "fuzz/FuzzCanvas.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001562 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001563 "fuzz/FuzzGradients.cpp",
1564 "fuzz/FuzzParsePath.cpp",
1565 "fuzz/FuzzPathop.cpp",
1566 "fuzz/FuzzScaleToSides.cpp",
1567 "fuzz/fuzz.cpp",
1568 ]
1569 deps = [
1570 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001571 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001572 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001573 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001574 ]
kjlubick14f984b2016-10-03 11:49:45 -07001575 }
Mike Klein38312422016-10-05 15:41:01 -04001576
Mike Kleine6682eb2017-01-05 10:54:57 -05001577 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001578 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001579 rebase_path("tests/skia_test.cpp"),
1580 rebase_path("tests/Test.cpp"),
1581 ]
caryclark9feb6322016-10-25 08:58:26 -07001582 deps = [
1583 ":flags",
1584 ":gpu_tool_utils",
1585 ":skia",
1586 ":tool_utils",
1587 ]
caryclark9feb6322016-10-25 08:58:26 -07001588 }
1589
Mike Kleine6682eb2017-01-05 10:54:57 -05001590 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001591 sources = [
1592 "tools/DumpRecord.cpp",
1593 "tools/dump_record.cpp",
1594 ]
1595 deps = [
1596 ":flags",
1597 ":skia",
1598 ]
Mike Klein38312422016-10-05 15:41:01 -04001599 }
bungemanfe917272016-10-13 17:36:40 -04001600
Mike Kleine6682eb2017-01-05 10:54:57 -05001601 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001602 sources = [
1603 "tools/skdiff/skdiff.cpp",
1604 "tools/skdiff/skdiff_html.cpp",
1605 "tools/skdiff/skdiff_main.cpp",
1606 "tools/skdiff/skdiff_utils.cpp",
1607 ]
1608 deps = [
1609 ":skia",
1610 ":tool_utils",
1611 ]
bungemanfe917272016-10-13 17:36:40 -04001612 }
halcanarya73d76a2016-10-17 13:19:02 -07001613
Mike Kleine6682eb2017-01-05 10:54:57 -05001614 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001615 sources = [
1616 "tools/skp_parser.cpp",
1617 ]
1618 deps = [
1619 ":skia",
1620 ":tool_utils",
1621 "//third_party/jsoncpp",
1622 ]
halcanarya73d76a2016-10-17 13:19:02 -07001623 }
Brian Osman16adfa32016-10-18 14:42:44 -04001624
Hal Canary75427132017-10-11 16:00:31 -04001625 if (!is_win) {
1626 test_app("gpucts") {
1627 sources = [
1628 "dm/DMGpuTestProcs.cpp",
1629 "tools/gpucts/gm_knowledge.c",
1630 "tools/gpucts/gm_runner.cpp",
1631 "tools/gpucts/gpucts.cpp",
1632 ]
1633 deps = [
1634 ":gm",
1635 ":gpu_tool_utils",
1636 ":skia",
1637 ":tests",
1638 "//third_party/googletest",
1639 ]
1640 }
1641 }
1642
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001643 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001644 test_app("viewer") {
1645 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001646 sources = [
1647 "tools/viewer/GMSlide.cpp",
1648 "tools/viewer/ImageSlide.cpp",
1649 "tools/viewer/SKPSlide.cpp",
1650 "tools/viewer/SampleSlide.cpp",
1651 "tools/viewer/Viewer.cpp",
1652 "tools/viewer/sk_app/CommandSet.cpp",
1653 "tools/viewer/sk_app/GLWindowContext.cpp",
1654 "tools/viewer/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001655 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001656 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001657
Jim Van Verth4e56a912016-10-21 10:58:52 -04001658 if (is_android) {
1659 sources += [
1660 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1661 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1662 "tools/viewer/sk_app/android/Window_android.cpp",
1663 "tools/viewer/sk_app/android/main_android.cpp",
1664 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1665 ]
Brian Osman462334e2017-02-09 11:22:57 -05001666 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001667 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001668 sources += [
1669 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1670 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1671 "tools/viewer/sk_app/unix/Window_unix.cpp",
1672 "tools/viewer/sk_app/unix/main_unix.cpp",
1673 ]
1674 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001675 sources += [
1676 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1677 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1678 "tools/viewer/sk_app/win/Window_win.cpp",
1679 "tools/viewer/sk_app/win/main_win.cpp",
1680 ]
Brian Salomon194db172017-08-17 14:37:06 -04001681 if (skia_use_angle) {
1682 sources += [ "tools/viewer/sk_app/win/ANGLEWindowContext_win.cpp" ]
1683 }
Mike Klein43c25262016-10-20 10:17:47 -04001684 } else if (is_mac) {
1685 sources += [
1686 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1687 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1688 "tools/viewer/sk_app/mac/Window_mac.cpp",
1689 "tools/viewer/sk_app/mac/main_mac.cpp",
1690 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001691 } else if (is_ios) {
1692 sources += [
1693 "tools/viewer/sk_app/ios/GLWindowContext_ios.cpp",
1694 "tools/viewer/sk_app/ios/RasterWindowContext_ios.cpp",
1695 "tools/viewer/sk_app/ios/Window_ios.cpp",
1696 "tools/viewer/sk_app/ios/main_ios.cpp",
1697 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001698 }
1699
1700 if (skia_use_vulkan) {
1701 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001702 if (is_android) {
1703 sources +=
1704 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001705 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001706 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1707 libs += [ "X11-xcb" ]
1708 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001709 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1710 }
1711 }
1712
1713 include_dirs = []
1714 deps = [
1715 ":flags",
1716 ":gm",
1717 ":gpu_tool_utils",
1718 ":samples",
1719 ":skia",
1720 ":tool_utils",
1721 ":views",
Brian Osman79086b92017-02-10 13:36:16 -05001722 "//third_party/imgui",
Brian Osman16adfa32016-10-18 14:42:44 -04001723 "//third_party/jsoncpp",
1724 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001725 if (is_android) {
1726 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001727 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04001728 deps += [ "//third_party/libsdl" ]
1729 }
Brian Salomon194db172017-08-17 14:37:06 -04001730 if (skia_use_angle) {
1731 deps += [ "//third_party/angle2" ]
1732 }
Mike Kleina92c3832016-12-08 09:49:39 -05001733 }
Brian Osman16adfa32016-10-18 14:42:44 -04001734 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001735
Jim Van Verthecfed2b2017-08-30 14:02:50 -04001736 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04001737 test_app("SkiaSDLExample") {
1738 sources = [
1739 "example/SkiaSDLExample.cpp",
1740 ]
1741 libs = []
1742 include_dirs = []
1743 deps = [
1744 ":gpu_tool_utils",
1745 ":skia",
1746 "//third_party/libsdl",
1747 ]
1748 }
1749 }
1750
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001751 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
1752 action_foreach("generate_mocs") {
1753 script = "gn/call.py"
1754 sources = [
1755 "tools/mdbviz/MainWindow.h",
1756 ]
1757 outputs = [
1758 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
1759 ]
1760 args = [
1761 "$skia_qt_path" + "/bin/moc",
1762 "{{source}}",
1763 "-o",
1764 "gen/mdbviz/{{source_name_part}}_moc.cpp",
1765 ]
1766 }
1767 action_foreach("generate_resources") {
1768 script = "gn/call.py"
1769 sources = [
1770 "tools/mdbviz/resources.qrc",
1771 ]
1772 outputs = [
1773 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
1774 ]
1775 args = [
1776 "$skia_qt_path" + "/bin/rcc",
1777 "{{source}}",
1778 "-o",
1779 "gen/mdbviz/{{source_name_part}}_res.cpp",
1780 ]
1781 }
1782 test_app("mdbviz") {
1783 if (is_win) {
1784 # on Windows we need to disable some exception handling warnings due to the Qt headers
1785 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
1786 }
1787 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001788 "tools/UrlDataManager.cpp",
1789 "tools/debugger/SkDebugCanvas.cpp",
1790 "tools/debugger/SkDrawCommand.cpp",
1791 "tools/debugger/SkJsonWriteBuffer.cpp",
1792 "tools/debugger/SkObjectParser.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001793 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04001794 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001795 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001796 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001797
1798 # generated files
1799 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
1800 "$target_gen_dir/mdbviz/resources_res.cpp",
1801 ]
1802 lib_dirs = [ "$skia_qt_path/lib" ]
1803 libs = [
1804 "Qt5Core.lib",
1805 "Qt5Gui.lib",
1806 "Qt5Widgets.lib",
1807 ]
1808 include_dirs = [
1809 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04001810 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001811 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001812 "tools",
1813 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001814 ]
1815 deps = [
1816 ":generate_mocs",
1817 ":generate_resources",
1818 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001819 "//third_party/jsoncpp",
1820 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001821 ]
1822 }
1823 }
1824
Mike Kleine459afd2017-03-03 09:21:30 -05001825 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05001826 copy("gdbserver") {
1827 sources = [
1828 "$ndk/$ndk_gdbserver",
1829 ]
1830 outputs = [
1831 "$root_out_dir/gdbserver",
1832 ]
1833 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05001834 }
mtklein25c81d42016-07-27 13:55:26 -07001835}
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001836
1837if (skia_jumper_clang != "") {
1838 action("regen_jumper") {
1839 script = "src/jumper/build_stages.py"
1840
1841 inputs = [
1842 "src/jumper/SkJumper_stages.cpp",
Mike Klein9b2f69b2017-09-12 16:40:53 -04001843 "src/jumper/SkJumper_stages_lowp.cpp",
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001844 ]
1845
1846 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it.
1847 outputs = [
1848 "$target_out_dir/" +
1849 rebase_path("src/jumper/SkJumper_generated.S", target_out_dir),
1850 "$target_out_dir/" +
1851 rebase_path("src/jumper/SkJumper_generated_win.S", target_out_dir),
1852 ]
1853
1854 args = [
1855 skia_jumper_clang,
1856 skia_jumper_objdump,
1857 skia_jumper_ccache,
1858 ] + rebase_path(inputs) + rebase_path(outputs)
1859 }
1860}