blob: 2a8b8d30c1ee653c431c7ea20565350f50b80c5b [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",
Mike Kleinc36dedf2016-11-18 09:35:28 -0500907 ":skia",
908 ":skia.h",
909 ]
910 }
911 }
912
913 if (skia_enable_gpu) {
914 source_set("public_headers_warnings_check") {
915 sources = [
916 "tools/public_headers_warnings_check.cpp",
917 ]
918 configs -= [ "//gn:warnings_except_public_headers" ]
919 deps = [
920 ":skia",
921 ":skia.h",
922 ]
923 }
924 }
925
mtkleinc095df52016-08-24 12:23:52 -0700926 template("test_lib") {
927 config(target_name + "_config") {
928 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700929 if (defined(invoker.public_defines)) {
930 defines = invoker.public_defines
931 }
mtklein25c81d42016-07-27 13:55:26 -0700932 }
mtkleinc095df52016-08-24 12:23:52 -0700933 source_set(target_name) {
934 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
935 public_configs = [
936 ":" + target_name + "_config",
937 ":skia_private",
938 ]
939
940 if (!defined(deps)) {
941 deps = []
942 }
943 deps += [ ":skia" ]
944 testonly = true
945 }
mtklein25c81d42016-07-27 13:55:26 -0700946 }
mtklein25c81d42016-07-27 13:55:26 -0700947
Mike Kleine6682eb2017-01-05 10:54:57 -0500948 template("test_app") {
949 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
950 shared_library("lib" + target_name) {
951 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400952 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500953 testonly = true
954 }
955 } else {
Mike Klein7d921032017-01-05 12:20:41 -0500956 _executable = target_name
957 executable(_executable) {
Mike Kleine6682eb2017-01-05 10:54:57 -0500958 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400959 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500960 testonly = true
961 }
962 }
Mike Klein7d921032017-01-05 12:20:41 -0500963 if (is_android && skia_android_serial != "" && defined(_executable)) {
964 action("push_" + target_name) {
965 script = "gn/push_to_android.py"
966 deps = [
967 ":" + _executable,
968 ]
969 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
970 outputs = [
971 _stamp,
972 ]
973 args = [
974 rebase_path("$root_build_dir/$_executable"),
975 skia_android_serial,
976 rebase_path(_stamp),
977 ]
978 testonly = true
979 }
980 }
Mike Kleine6682eb2017-01-05 10:54:57 -0500981 }
982
mtkleinc095df52016-08-24 12:23:52 -0700983 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700984 public_include_dirs = []
985 if (skia_enable_gpu) {
986 public_defines = []
987 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700988
989 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700990 sources = [
991 "tools/gpu/GrContextFactory.cpp",
992 "tools/gpu/GrTest.cpp",
993 "tools/gpu/TestContext.cpp",
994 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -0700995 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -0700996 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
997 "tools/gpu/gl/debug/GrBufferObj.cpp",
998 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
999 "tools/gpu/gl/debug/GrProgramObj.cpp",
1000 "tools/gpu/gl/debug/GrShaderObj.cpp",
1001 "tools/gpu/gl/debug/GrTextureObj.cpp",
1002 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1003 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001004 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001005 ]
1006 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001007
Kevin Lubick4a24e102017-03-29 11:19:01 -04001008 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001009 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001010 } else if (is_ios) {
1011 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1012 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001013 } else if (is_linux) {
1014 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001015 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001016 } else if (is_mac) {
1017 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001018 } else if (is_win) {
1019 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1020 libs += [
1021 "Gdi32.lib",
1022 "OpenGL32.lib",
1023 ]
mtklein38925aa2016-09-21 10:11:25 -07001024 }
mtklein6ef69992016-09-14 06:12:09 -07001025
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001026 cflags_objcc = [ "-fobjc-arc" ]
1027
Mike Kleinc168a3a2016-11-14 14:53:13 +00001028 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001029 deps += [ "//third_party/angle2" ]
1030 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1031 }
mtkleind68f9b02016-09-23 13:18:41 -07001032 if (skia_use_vulkan) {
1033 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001034 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001035 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001036 if (skia_use_metal) {
1037 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1038 }
mtkleina627b5c2016-09-20 13:36:47 -07001039 }
mtklein25c81d42016-07-27 13:55:26 -07001040 }
mtklein25c81d42016-07-27 13:55:26 -07001041
mtkleinc095df52016-08-24 12:23:52 -07001042 test_lib("flags") {
1043 public_include_dirs = [ "tools/flags" ]
1044 sources = [
1045 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001046 ]
1047 }
1048 test_lib("common_flags") {
1049 public_include_dirs = [ "tools/flags" ]
1050 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001051 "tools/flags/SkCommonFlags.cpp",
1052 "tools/flags/SkCommonFlagsConfig.cpp",
1053 ]
1054 deps = [
mtklein046cb562016-09-16 10:23:12 -07001055 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001056 ":gpu_tool_utils",
1057 ]
1058 }
mtklein25c81d42016-07-27 13:55:26 -07001059
mtkleinc095df52016-08-24 12:23:52 -07001060 test_lib("tool_utils") {
1061 public_include_dirs = [
1062 "tools",
1063 "tools/debugger",
1064 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001065 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001066 ]
1067 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001068 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001069 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001070 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001071 "tools/ProcStats.cpp",
1072 "tools/Resources.cpp",
Mike Klein10d66cc2017-11-10 11:33:43 -05001073 "tools/SkRandomScalerContext.cpp",
1074 "tools/SkTestScalerContext.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001075 "tools/ThermalManager.cpp",
1076 "tools/UrlDataManager.cpp",
1077 "tools/debugger/SkDebugCanvas.cpp",
1078 "tools/debugger/SkDrawCommand.cpp",
1079 "tools/debugger/SkJsonWriteBuffer.cpp",
1080 "tools/debugger/SkObjectParser.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001081 "tools/picture_utils.cpp",
1082 "tools/random_parse_path.cpp",
1083 "tools/sk_tool_utils.cpp",
1084 "tools/sk_tool_utils_font.cpp",
1085 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001086 "tools/trace/SkChromeTracingTracer.cpp",
1087 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001088 "tools/trace/SkDebugfTracer.cpp",
1089 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001090 "tools/trace/SkEventTracingPriv.cpp",
1091 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001092 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001093 libs = []
1094 if (is_ios) {
1095 sources += [ "tools/ios_utils.m" ]
1096 libs += [ "Foundation.framework" ]
1097 }
mtkleinc095df52016-08-24 12:23:52 -07001098 deps = [
mtklein046cb562016-09-16 10:23:12 -07001099 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001100 ":flags",
1101 "//third_party/libpng",
1102 ]
1103 public_deps = [
1104 "//third_party/jsoncpp",
1105 ]
1106 }
mtklein25c81d42016-07-27 13:55:26 -07001107
Mike Klein6e744122016-10-27 12:21:40 -04001108 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001109 test_lib("gm") {
1110 public_include_dirs = [ "gm" ]
1111 sources = gm_sources
1112 deps = [
scroggo19b91532016-10-24 09:03:26 -07001113 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001114 ":gpu_tool_utils",
1115 ":skia",
1116 ":tool_utils",
1117 ]
1118 }
mtklein25c81d42016-07-27 13:55:26 -07001119
Mike Klein6e744122016-10-27 12:21:40 -04001120 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001121 test_lib("tests") {
1122 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001123 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001124 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001125 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001126 }
mtkleinc095df52016-08-24 12:23:52 -07001127 deps = [
fmalita6cf896d2016-08-25 08:44:35 -07001128 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001129 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001130 ":skia",
1131 ":tool_utils",
1132 "//third_party/libpng",
1133 "//third_party/zlib",
1134 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001135 public_deps = [
1136 ":gpu_tool_utils", # Test.h #includes headers from this target.
1137 ]
mtkleinc095df52016-08-24 12:23:52 -07001138 }
mtklein2f3416d2016-08-02 16:02:05 -07001139
Mike Klein6e744122016-10-27 12:21:40 -04001140 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001141 test_lib("bench") {
1142 public_include_dirs = [ "bench" ]
1143 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001144 deps = [
1145 ":flags",
1146 ":gm",
1147 ":gpu_tool_utils",
1148 ":skia",
1149 ":tool_utils",
1150 ]
1151 }
mtklein2b6870c2016-07-28 14:17:33 -07001152
mtkleinc095df52016-08-24 12:23:52 -07001153 test_lib("experimental_svg_model") {
1154 public_include_dirs = [ "experimental/svg/model" ]
1155 sources = [
1156 "experimental/svg/model/SkSVGAttribute.cpp",
1157 "experimental/svg/model/SkSVGAttributeParser.cpp",
1158 "experimental/svg/model/SkSVGCircle.cpp",
Florin Malitace8840e2016-12-08 09:26:47 -05001159 "experimental/svg/model/SkSVGClipPath.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001160 "experimental/svg/model/SkSVGContainer.cpp",
1161 "experimental/svg/model/SkSVGDOM.cpp",
1162 "experimental/svg/model/SkSVGEllipse.cpp",
Florin Malitadf007e12017-10-09 15:14:13 -04001163 "experimental/svg/model/SkSVGGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001164 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001165 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001166 "experimental/svg/model/SkSVGNode.cpp",
1167 "experimental/svg/model/SkSVGPath.cpp",
Florin Malita1aa1bb62017-10-11 14:34:33 -04001168 "experimental/svg/model/SkSVGPattern.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001169 "experimental/svg/model/SkSVGPoly.cpp",
Florin Malitacc6cc292017-10-09 16:05:30 -04001170 "experimental/svg/model/SkSVGRadialGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001171 "experimental/svg/model/SkSVGRect.cpp",
1172 "experimental/svg/model/SkSVGRenderContext.cpp",
1173 "experimental/svg/model/SkSVGSVG.cpp",
1174 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001175 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001176 "experimental/svg/model/SkSVGTransformableNode.cpp",
Florin Malita6a69c052017-10-11 14:02:11 -04001177 "experimental/svg/model/SkSVGUse.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001178 "experimental/svg/model/SkSVGValue.cpp",
1179 ]
1180 deps = [
1181 ":skia",
1182 ]
1183 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001184
Kevin Lubickebf648e2017-09-21 13:45:16 -04001185 if (target_cpu != "wasm") {
1186 test_lib("views") {
1187 public_include_dirs = [ "include/views" ]
1188 sources = [
1189 "src/views/SkEvent.cpp",
1190 "src/views/SkEventSink.cpp",
1191 "src/views/SkOSMenu.cpp",
1192 "src/views/SkTagList.cpp",
1193 "src/views/SkTouchGesture.cpp",
1194 "src/views/SkView.cpp",
1195 "src/views/SkViewPriv.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001196 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001197 libs = []
1198 deps = []
1199 if (!is_android) {
1200 sources += [ "src/views/SkWindow.cpp" ]
1201 }
1202 if (is_linux) {
1203 public_include_dirs += [ "src/views/unix" ]
1204 sources += [
1205 "src/views/unix/SkOSWindow_Unix.cpp",
1206 "src/views/unix/keysym2ucs.c",
1207 ]
1208 libs += [
1209 "GL",
1210 "X11",
1211 ]
1212 } else if (is_mac) {
1213 sources += [
1214 "src/views/mac/SkEventNotifier.mm",
1215 "src/views/mac/SkNSView.mm",
1216 "src/views/mac/SkOSWindow_Mac.mm",
1217 "src/views/mac/SkTextFieldCell.m",
1218 ]
1219 libs += [
1220 "QuartzCore.framework",
1221 "Cocoa.framework",
1222 "Foundation.framework",
1223 ]
1224 } else if (is_win) {
1225 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1226 } else if (is_ios) {
1227 sources += [ "src/views/mac/SkEventNotifier.mm" ]
1228 }
1229 if (skia_use_angle) {
1230 deps += [ "//third_party/angle2" ]
1231 }
Brian Osman34755e22016-12-05 09:46:02 -05001232 }
Brian Osman16adfa32016-10-18 14:42:44 -04001233 }
1234
Mike Klein38af9432016-11-11 11:39:44 -05001235 if (skia_use_lua) {
1236 test_lib("lua") {
1237 public_include_dirs = []
1238 sources = [
1239 "src/utils/SkLua.cpp",
1240 "src/utils/SkLuaCanvas.cpp",
1241 ]
1242 deps = [
1243 "//third_party/lua",
1244 ]
1245 }
1246
Mike Kleine6682eb2017-01-05 10:54:57 -05001247 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001248 sources = [
1249 "tools/lua/lua_app.cpp",
1250 ]
1251 deps = [
1252 ":lua",
1253 ":skia",
1254 "//third_party/lua",
1255 ]
Mike Klein38af9432016-11-11 11:39:44 -05001256 }
1257
Mike Kleine6682eb2017-01-05 10:54:57 -05001258 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001259 sources = [
1260 "tools/lua/lua_pictures.cpp",
1261 ]
1262 deps = [
1263 ":flags",
1264 ":lua",
1265 ":skia",
1266 ":tool_utils",
1267 "//third_party/lua",
1268 ]
Mike Klein38af9432016-11-11 11:39:44 -05001269 }
1270 }
1271
Cary Clark8032b982017-07-28 11:04:54 -04001272 test_app("bookmaker") {
1273 sources = [
1274 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001275 "tools/bookmaker/cataloger.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001276 "tools/bookmaker/fiddleParser.cpp",
1277 "tools/bookmaker/includeParser.cpp",
1278 "tools/bookmaker/includeWriter.cpp",
1279 "tools/bookmaker/mdOut.cpp",
1280 "tools/bookmaker/parserCommon.cpp",
1281 "tools/bookmaker/spellCheck.cpp",
1282 ]
1283 deps = [
1284 ":flags",
1285 ":skia",
1286 ":tool_utils",
1287 ]
1288 }
1289
Kevin Lubickebf648e2017-09-21 13:45:16 -04001290 if (target_cpu != "wasm") {
1291 import("gn/samples.gni")
1292 test_lib("samples") {
1293 public_include_dirs = [ "samplecode" ]
1294 include_dirs = [ "experimental" ]
1295 sources = samples_sources + [
1296 "experimental/SkSetPoly3To3.cpp",
1297 "experimental/SkSetPoly3To3_A.cpp",
1298 "experimental/SkSetPoly3To3_D.cpp",
Brian Osmancff94e42017-06-26 13:12:37 -04001299
Kevin Lubickebf648e2017-09-21 13:45:16 -04001300 # Relocating these files here, so that clients don't try to build them while they're
1301 # still in active development. Clang's thread safety analysis gets tripped up by
1302 # conditional locks.
1303 "src/core/SkThreadedBMPDevice.cpp",
1304 "src/core/SkThreadedBMPDevice.h",
1305 ]
1306 deps = [
1307 ":experimental_svg_model",
1308 ":flags",
1309 ":gm",
1310 ":tool_utils",
1311 ":views",
1312 ":xml",
1313 ]
Mike Klein38af9432016-11-11 11:39:44 -05001314
Kevin Lubickebf648e2017-09-21 13:45:16 -04001315 if (skia_use_lua) {
1316 sources += [ "samplecode/SampleLua.cpp" ]
1317 deps += [
1318 ":lua",
1319 "//third_party/lua",
1320 ]
1321 }
1322 }
1323 test_app("dm") {
1324 sources = [
1325 "dm/DM.cpp",
Mike Klein31868212017-11-06 12:02:47 -05001326 "dm/DMFontMgr.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001327 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001328 "dm/DMJsonWriter.cpp",
1329 "dm/DMSrcSink.cpp",
1330 ]
1331 include_dirs = [ "tests" ]
1332 deps = [
1333 ":common_flags",
1334 ":experimental_svg_model",
1335 ":flags",
1336 ":gm",
1337 ":gpu_tool_utils",
1338 ":skia",
1339 ":tests",
1340 ":tool_utils",
1341 "//third_party/jsoncpp",
1342 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001343 ]
1344 }
Brian Osman16adfa32016-10-18 14:42:44 -04001345 }
1346
Mike Klein06432b22017-03-21 13:14:33 -04001347 test_app("ok") {
1348 sources = [
Mike Klein361dde02017-11-07 08:14:52 -05001349 "dm/DMFontMgr.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001350 "tools/ok.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001351 "tools/ok_dsts.cpp",
Mike Klein154e6da2017-07-26 15:13:47 -04001352 "tools/ok_engines.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001353 "tools/ok_srcs.cpp",
Mike Kleind63442d2017-03-27 14:16:04 -04001354 "tools/ok_test.cpp",
Mike Kleinf5d1a552017-03-25 12:32:22 -04001355 "tools/ok_vias.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001356 ]
1357 deps = [
Mike Klein4f6e2712017-08-11 10:37:35 -04001358 ":bench",
Mike Klein06432b22017-03-21 13:14:33 -04001359 ":gm",
1360 ":skia",
Mike Kleind63442d2017-03-27 14:16:04 -04001361 ":tests",
Mike Klein62669ad2017-05-09 16:03:07 -04001362 ":tool_utils",
Mike Klein06432b22017-03-21 13:14:33 -04001363 ]
1364 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001365 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001366 sources = [
1367 "bench/nanobench.cpp",
1368 ]
1369 deps = [
1370 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001371 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001372 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001373 ":flags",
1374 ":gm",
1375 ":gpu_tool_utils",
1376 ":skia",
1377 ":tool_utils",
1378 "//third_party/jsoncpp",
1379 ]
mtklein2b6870c2016-07-28 14:17:33 -07001380 }
halcanary19a97202016-08-03 15:08:04 -07001381
Ravi Mistry10d36c52017-01-31 09:49:18 -05001382 test_app("skpinfo") {
1383 sources = [
1384 "tools/skpinfo.cpp",
1385 ]
1386 deps = [
1387 ":flags",
1388 ":skia",
1389 ]
1390 }
1391
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001392 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001393 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001394 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001395 "samplecode/SampleApp.cpp",
1396 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001397 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001398 if (is_mac) {
1399 sources += [ "src/views/mac/skia_mac.mm" ]
1400 } else if (is_win) {
1401 sources += [ "src/views/win/skia_win.cpp" ]
1402 } else if (is_linux) {
1403 sources += [ "src/views/unix/skia_unix.cpp" ]
1404 }
mtklein38925aa2016-09-21 10:11:25 -07001405 deps = [
1406 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001407 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001408 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001409 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001410 ":skia",
1411 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001412 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001413 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001414 if (skia_use_angle) {
1415 deps += [ "//third_party/angle2" ]
1416 }
mtklein38925aa2016-09-21 10:11:25 -07001417 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001418 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001419
Jim Van Verthc1720d42017-10-09 10:16:01 -04001420 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
1421 test_app("HelloWorld") {
1422 sources = [
1423 "example/HelloWorld.cpp",
1424 ]
1425 if (is_mac) {
1426 sources += [ "src/views/mac/skia_mac.mm" ]
1427 } else if (is_win) {
1428 sources += [ "src/views/win/skia_win.cpp" ]
1429 } else if (is_linux) {
1430 sources += [ "src/views/unix/skia_unix.cpp" ]
1431 }
1432 deps = [
1433 ":gpu_tool_utils",
1434 ":skia",
1435 ":views",
1436 ]
1437 }
1438 }
1439
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001440 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001441 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001442 sources = [
1443 "tools/skpbench/skpbench.cpp",
1444 ]
1445 deps = [
1446 ":flags",
1447 ":gpu_tool_utils",
1448 ":skia",
1449 ":tool_utils",
1450 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001451 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001452 }
1453
Mike Klein7d302882016-11-03 14:06:31 -04001454 # We can't yet build ICU on iOS or Windows.
Kevin Lubickebf648e2017-09-21 13:45:16 -04001455 if (!is_ios && !is_win && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001456 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001457 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001458 "tools/shape/SkShaper_harfbuzz.cpp",
1459 "tools/shape/using_skia_and_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001460 ]
1461 deps = [
1462 ":skia",
1463 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001464 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001465 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001466 }
halcanary19a97202016-08-03 15:08:04 -07001467 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001468 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001469 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001470 "tools/shape/SkShaper_primitive.cpp",
1471 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001472 ]
1473 deps = [
1474 ":skia",
1475 ]
halcanary3eee9d92016-09-10 07:01:53 -07001476 }
mtklein046cb562016-09-16 10:23:12 -07001477
Matt Sarett9f1c4032017-05-17 10:06:32 -04001478 test_app("create_flutter_test_images") {
1479 sources = [
1480 "tools/create_flutter_test_images.cpp",
1481 ]
1482 deps = [
1483 ":skia",
1484 ":tool_utils",
1485 ]
1486 }
1487
Ben Wagner219f3622017-07-17 15:32:25 -04001488 test_app("create_test_font") {
1489 sources = [
1490 "tools/create_test_font.cpp",
1491 ]
1492 deps = [
1493 ":skia",
1494 ]
1495 assert_no_deps = [
1496 # tool_utils requires the output of this app.
1497 ":tool_utils",
1498 ]
1499 }
1500
Mike Kleine6682eb2017-01-05 10:54:57 -05001501 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001502 sources = [
1503 "tools/get_images_from_skps.cpp",
1504 ]
1505 deps = [
1506 ":flags",
1507 ":skia",
1508 "//third_party/jsoncpp",
1509 ]
mtklein046cb562016-09-16 10:23:12 -07001510 }
mtkleinecbc5262016-09-22 11:51:24 -07001511
Mike Kleine6682eb2017-01-05 10:54:57 -05001512 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001513 sources = [
1514 "tools/colorspaceinfo.cpp",
1515 ]
1516 deps = [
1517 ":flags",
1518 ":skia",
1519 ":tool_utils",
1520 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001521 }
1522
Kevin Lubickebf648e2017-09-21 13:45:16 -04001523 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001524 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001525 sources = [
1526 "tools/skiaserve/Request.cpp",
1527 "tools/skiaserve/Response.cpp",
1528 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001529 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1530 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1531 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1532 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1533 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1534 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1535 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1536 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1537 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001538 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1539 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001540 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1541 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1542 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1543 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1544 ]
1545 deps = [
1546 ":flags",
1547 ":gpu_tool_utils",
1548 ":skia",
1549 ":tool_utils",
1550 "//third_party/jsoncpp",
1551 "//third_party/libmicrohttpd",
1552 "//third_party/libpng",
1553 ]
Mike Klein7d302882016-11-03 14:06:31 -04001554 }
mtkleinecbc5262016-09-22 11:51:24 -07001555 }
kjlubick14f984b2016-10-03 11:49:45 -07001556
Mike Kleine6682eb2017-01-05 10:54:57 -05001557 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001558 sources = [
1559 "fuzz/FilterFuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001560 "fuzz/FuzzCanvas.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001561 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001562 "fuzz/FuzzGradients.cpp",
1563 "fuzz/FuzzParsePath.cpp",
1564 "fuzz/FuzzPathop.cpp",
1565 "fuzz/FuzzScaleToSides.cpp",
1566 "fuzz/fuzz.cpp",
1567 ]
1568 deps = [
1569 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001570 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001571 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001572 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001573 ]
kjlubick14f984b2016-10-03 11:49:45 -07001574 }
Mike Klein38312422016-10-05 15:41:01 -04001575
Mike Kleine6682eb2017-01-05 10:54:57 -05001576 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001577 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001578 rebase_path("tests/skia_test.cpp"),
1579 rebase_path("tests/Test.cpp"),
1580 ]
caryclark9feb6322016-10-25 08:58:26 -07001581 deps = [
1582 ":flags",
1583 ":gpu_tool_utils",
1584 ":skia",
1585 ":tool_utils",
1586 ]
caryclark9feb6322016-10-25 08:58:26 -07001587 }
1588
Mike Kleine6682eb2017-01-05 10:54:57 -05001589 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001590 sources = [
1591 "tools/DumpRecord.cpp",
1592 "tools/dump_record.cpp",
1593 ]
1594 deps = [
1595 ":flags",
1596 ":skia",
1597 ]
Mike Klein38312422016-10-05 15:41:01 -04001598 }
bungemanfe917272016-10-13 17:36:40 -04001599
Mike Kleine6682eb2017-01-05 10:54:57 -05001600 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001601 sources = [
1602 "tools/skdiff/skdiff.cpp",
1603 "tools/skdiff/skdiff_html.cpp",
1604 "tools/skdiff/skdiff_main.cpp",
1605 "tools/skdiff/skdiff_utils.cpp",
1606 ]
1607 deps = [
1608 ":skia",
1609 ":tool_utils",
1610 ]
bungemanfe917272016-10-13 17:36:40 -04001611 }
halcanarya73d76a2016-10-17 13:19:02 -07001612
Mike Kleine6682eb2017-01-05 10:54:57 -05001613 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001614 sources = [
1615 "tools/skp_parser.cpp",
1616 ]
1617 deps = [
1618 ":skia",
1619 ":tool_utils",
1620 "//third_party/jsoncpp",
1621 ]
halcanarya73d76a2016-10-17 13:19:02 -07001622 }
Brian Osman16adfa32016-10-18 14:42:44 -04001623
Hal Canary75427132017-10-11 16:00:31 -04001624 if (!is_win) {
1625 test_app("gpucts") {
1626 sources = [
1627 "dm/DMGpuTestProcs.cpp",
1628 "tools/gpucts/gm_knowledge.c",
1629 "tools/gpucts/gm_runner.cpp",
1630 "tools/gpucts/gpucts.cpp",
1631 ]
1632 deps = [
1633 ":gm",
1634 ":gpu_tool_utils",
1635 ":skia",
1636 ":tests",
1637 "//third_party/googletest",
1638 ]
1639 }
1640 }
1641
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001642 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001643 test_app("viewer") {
1644 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001645 sources = [
1646 "tools/viewer/GMSlide.cpp",
1647 "tools/viewer/ImageSlide.cpp",
1648 "tools/viewer/SKPSlide.cpp",
1649 "tools/viewer/SampleSlide.cpp",
1650 "tools/viewer/Viewer.cpp",
1651 "tools/viewer/sk_app/CommandSet.cpp",
1652 "tools/viewer/sk_app/GLWindowContext.cpp",
1653 "tools/viewer/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001654 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001655 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001656
Jim Van Verth4e56a912016-10-21 10:58:52 -04001657 if (is_android) {
1658 sources += [
1659 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1660 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1661 "tools/viewer/sk_app/android/Window_android.cpp",
1662 "tools/viewer/sk_app/android/main_android.cpp",
1663 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1664 ]
Brian Osman462334e2017-02-09 11:22:57 -05001665 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001666 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001667 sources += [
1668 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1669 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1670 "tools/viewer/sk_app/unix/Window_unix.cpp",
1671 "tools/viewer/sk_app/unix/main_unix.cpp",
1672 ]
1673 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001674 sources += [
1675 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1676 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1677 "tools/viewer/sk_app/win/Window_win.cpp",
1678 "tools/viewer/sk_app/win/main_win.cpp",
1679 ]
Brian Salomon194db172017-08-17 14:37:06 -04001680 if (skia_use_angle) {
1681 sources += [ "tools/viewer/sk_app/win/ANGLEWindowContext_win.cpp" ]
1682 }
Mike Klein43c25262016-10-20 10:17:47 -04001683 } else if (is_mac) {
1684 sources += [
1685 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1686 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1687 "tools/viewer/sk_app/mac/Window_mac.cpp",
1688 "tools/viewer/sk_app/mac/main_mac.cpp",
1689 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001690 } else if (is_ios) {
1691 sources += [
1692 "tools/viewer/sk_app/ios/GLWindowContext_ios.cpp",
1693 "tools/viewer/sk_app/ios/RasterWindowContext_ios.cpp",
1694 "tools/viewer/sk_app/ios/Window_ios.cpp",
1695 "tools/viewer/sk_app/ios/main_ios.cpp",
1696 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001697 }
1698
1699 if (skia_use_vulkan) {
1700 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001701 if (is_android) {
1702 sources +=
1703 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001704 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001705 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1706 libs += [ "X11-xcb" ]
1707 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001708 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1709 }
1710 }
1711
1712 include_dirs = []
1713 deps = [
1714 ":flags",
1715 ":gm",
1716 ":gpu_tool_utils",
1717 ":samples",
1718 ":skia",
1719 ":tool_utils",
1720 ":views",
Brian Osman79086b92017-02-10 13:36:16 -05001721 "//third_party/imgui",
Brian Osman16adfa32016-10-18 14:42:44 -04001722 "//third_party/jsoncpp",
1723 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001724 if (is_android) {
1725 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001726 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04001727 deps += [ "//third_party/libsdl" ]
1728 }
Brian Salomon194db172017-08-17 14:37:06 -04001729 if (skia_use_angle) {
1730 deps += [ "//third_party/angle2" ]
1731 }
Mike Kleina92c3832016-12-08 09:49:39 -05001732 }
Brian Osman16adfa32016-10-18 14:42:44 -04001733 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001734
Jim Van Verthecfed2b2017-08-30 14:02:50 -04001735 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04001736 test_app("SkiaSDLExample") {
1737 sources = [
1738 "example/SkiaSDLExample.cpp",
1739 ]
1740 libs = []
1741 include_dirs = []
1742 deps = [
1743 ":gpu_tool_utils",
1744 ":skia",
1745 "//third_party/libsdl",
1746 ]
1747 }
1748 }
1749
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001750 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
1751 action_foreach("generate_mocs") {
1752 script = "gn/call.py"
1753 sources = [
1754 "tools/mdbviz/MainWindow.h",
1755 ]
1756 outputs = [
1757 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
1758 ]
1759 args = [
1760 "$skia_qt_path" + "/bin/moc",
1761 "{{source}}",
1762 "-o",
1763 "gen/mdbviz/{{source_name_part}}_moc.cpp",
1764 ]
1765 }
1766 action_foreach("generate_resources") {
1767 script = "gn/call.py"
1768 sources = [
1769 "tools/mdbviz/resources.qrc",
1770 ]
1771 outputs = [
1772 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
1773 ]
1774 args = [
1775 "$skia_qt_path" + "/bin/rcc",
1776 "{{source}}",
1777 "-o",
1778 "gen/mdbviz/{{source_name_part}}_res.cpp",
1779 ]
1780 }
1781 test_app("mdbviz") {
1782 if (is_win) {
1783 # on Windows we need to disable some exception handling warnings due to the Qt headers
1784 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
1785 }
1786 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001787 "tools/UrlDataManager.cpp",
1788 "tools/debugger/SkDebugCanvas.cpp",
1789 "tools/debugger/SkDrawCommand.cpp",
1790 "tools/debugger/SkJsonWriteBuffer.cpp",
1791 "tools/debugger/SkObjectParser.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001792 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04001793 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001794 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001795 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001796
1797 # generated files
1798 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
1799 "$target_gen_dir/mdbviz/resources_res.cpp",
1800 ]
1801 lib_dirs = [ "$skia_qt_path/lib" ]
1802 libs = [
1803 "Qt5Core.lib",
1804 "Qt5Gui.lib",
1805 "Qt5Widgets.lib",
1806 ]
1807 include_dirs = [
1808 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04001809 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001810 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001811 "tools",
1812 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001813 ]
1814 deps = [
1815 ":generate_mocs",
1816 ":generate_resources",
1817 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001818 "//third_party/jsoncpp",
1819 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001820 ]
1821 }
1822 }
1823
Mike Kleine459afd2017-03-03 09:21:30 -05001824 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05001825 copy("gdbserver") {
1826 sources = [
1827 "$ndk/$ndk_gdbserver",
1828 ]
1829 outputs = [
1830 "$root_out_dir/gdbserver",
1831 ]
1832 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05001833 }
mtklein25c81d42016-07-27 13:55:26 -07001834}
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001835
1836if (skia_jumper_clang != "") {
1837 action("regen_jumper") {
1838 script = "src/jumper/build_stages.py"
1839
1840 inputs = [
1841 "src/jumper/SkJumper_stages.cpp",
Mike Klein9b2f69b2017-09-12 16:40:53 -04001842 "src/jumper/SkJumper_stages_lowp.cpp",
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001843 ]
1844
1845 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it.
1846 outputs = [
1847 "$target_out_dir/" +
1848 rebase_path("src/jumper/SkJumper_generated.S", target_out_dir),
1849 "$target_out_dir/" +
1850 rebase_path("src/jumper/SkJumper_generated_win.S", target_out_dir),
1851 ]
1852
1853 args = [
1854 skia_jumper_clang,
1855 skia_jumper_objdump,
1856 skia_jumper_ccache,
1857 ] + rebase_path(inputs) + rebase_path(outputs)
1858 }
1859}