blob: ece39b05d9cd9d1d1247ad7c93ac13ca536a578c [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 Klein69f6ed42016-10-13 15:45:07 -040024 skia_use_gdi = false
Mike Klein7d302882016-11-03 14:06:31 -040025 skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows
mtklein63213812016-08-24 09:55:56 -070026 skia_use_libjpeg_turbo = true
27 skia_use_libpng = true
mtkleineb3c4252016-08-23 07:38:09 -070028 skia_use_libwebp = !is_fuchsia
Mike Klein38af9432016-11-11 11:39:44 -050029 skia_use_lua = false
mtkleina627b5c2016-09-20 13:36:47 -070030 skia_use_mesa = false
Mike Klein10d665d2016-11-01 11:46:10 -040031 skia_use_piex = !is_win
mtklein63213812016-08-24 09:55:56 -070032 skia_use_zlib = true
Greg Daniele5ddff52017-07-05 16:49:36 -040033 skia_use_metal = false
Leon Scroggins III04be2b52017-08-17 15:13:20 -040034 skia_use_libheif = false
mtklein1bd72ba2016-09-16 07:45:52 -070035
Mike Klein7d921032017-01-05 12:20:41 -050036 skia_android_serial = ""
Brian Osman3f375d02016-12-28 11:19:22 -050037 skia_enable_discrete_gpu = true
Mike Kleina04bb452017-02-09 12:24:07 -050038 skia_enable_effects = true
Brian Osmanf2c90142017-07-13 15:50:03 -040039 skia_enable_flutter_defines = false
mtklein06c35c02016-09-20 12:28:12 -070040 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050041 skia_enable_pdf = true
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040042 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050043 skia_enable_tools = is_skia_dev_build
44 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Daniel686bb212016-10-27 10:48:48 -040045 skia_vulkan_sdk = getenv("VULKAN_SDK")
Robert Phillipsa6d2d702017-09-01 12:17:03 -040046 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040047 skia_compile_processors = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070048 skia_lex = false
Mike Kleinc55a6cb2017-06-28 13:21:47 -040049
50 skia_jumper_clang = ""
51 skia_jumper_objdump = ""
52 skia_jumper_ccache = ""
mtkleinc04ff472016-06-23 10:29:30 -070053}
Brian Salomon23d73ea2016-10-27 13:31:37 -040054declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040055 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040056 skia_use_sfntly = skia_use_icu
57
Mike Klein4d598a32016-10-31 13:44:49 -040058 if (is_android) {
59 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070060 } else if (is_fuchsia) {
61 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040062 } else {
63 skia_use_vulkan = skia_vulkan_sdk != ""
64 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040065}
Greg Danielec6ae522017-04-25 13:38:26 -040066declare_args() {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000067 skia_vulkan_headers = ""
Greg Danielec6ae522017-04-25 13:38:26 -040068 if (skia_use_vulkan) {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000069 # 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 -040070 if (is_fuchsia) {
71 skia_vulkan_headers = "$fuchsia_vulkan_sdk/include"
72 } else if (is_linux || is_win) {
73 skia_vulkan_headers = "$skia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040074 }
Greg Danielec6ae522017-04-25 13:38:26 -040075 }
76}
Brian Salomon789e25e2016-09-30 13:41:03 -040077
mtklein38925aa2016-09-21 10:11:25 -070078# Our tools require static linking (they use non-exported symbols).
79skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070080
mtkleina45be612016-08-29 15:22:10 -070081fontmgr_android_enabled = skia_use_expat && skia_use_freetype
82
mtklein1211e0c2016-07-26 13:55:45 -070083skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070084 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070085 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070086 "include/codec",
87 "include/config",
88 "include/core",
89 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -040090 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -070091 "include/gpu",
92 "include/gpu/gl",
mtklein1211e0c2016-07-26 13:55:45 -070093 "include/pathops",
94 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070095 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070096 "include/utils",
97 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -070098]
99
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000100if (skia_use_vulkan) {
101 skia_public_includes += [ "include/gpu/vk" ]
102}
Greg Daniele5ddff52017-07-05 16:49:36 -0400103if (skia_use_metal) {
104 skia_public_includes += [ "include/gpu/mtl" ]
105}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000106
mtkleinc04ff472016-06-23 10:29:30 -0700107# Skia public API, generally provided by :skia.
108config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700109 include_dirs = skia_public_includes
Greg Danielec6ae522017-04-25 13:38:26 -0400110 if (skia_vulkan_headers != "") {
111 include_dirs += [ skia_vulkan_headers ]
112 }
Mike Kleinae7e6712016-10-11 17:49:33 -0400113 defines = []
114 if (is_component_build) {
115 defines += [ "SKIA_DLL" ]
116 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400117 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700118 defines += [ "SK_SAMPLES_FOR_X" ]
119 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400120 if (skia_enable_flutter_defines) {
121 defines += flutter_defines
122 }
mtklein06c35c02016-09-20 12:28:12 -0700123 if (!skia_enable_gpu) {
124 defines += [ "SK_SUPPORT_GPU=0" ]
125 }
mtkleinc04ff472016-06-23 10:29:30 -0700126}
127
128# Skia internal APIs, used by Skia itself and a few test tools.
129config("skia_private") {
130 visibility = [ ":*" ]
131
132 include_dirs = [
133 "include/private",
134 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700135 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700136 "src/core",
137 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700138 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700139 "src/image",
140 "src/images",
141 "src/lazy",
142 "src/opts",
143 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700144 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700145 "src/ports",
146 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400147 "src/shaders",
148 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700149 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700150 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700151 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500152 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700153 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700154 ]
mtklein150d1132016-08-01 06:56:40 -0700155
Mike Reeda9e241d2017-05-03 10:52:00 -0400156 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700157 if (is_android) {
158 defines += [
159 "SK_GAMMA_EXPONENT=1.4",
160 "SK_GAMMA_CONTRAST=0.0",
161 ]
162 }
mtklein88a7ac02016-09-14 11:16:49 -0700163 if (is_official_build || is_android) {
164 # TODO(bsalomon): it'd be nice to make Android normal.
165 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
166 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400167 libs = []
168 lib_dirs = []
169 if (skia_use_vulkan) {
Michael Jurkada3e5962017-04-14 17:44:09 -0700170 if (skia_vulkan_sdk != "" && !is_android && !is_fuchsia) {
Mike Klein487bfc22016-10-14 14:04:56 -0400171 if (is_win) {
Brian Salomon3b5bf352017-03-20 15:54:41 -0400172 lib_dirs += [
173 "$skia_vulkan_sdk/Bin",
174 "$skia_vulkan_sdk/Lib",
175 ]
Mike Klein487bfc22016-10-14 14:04:56 -0400176 } else {
Greg Daniel686bb212016-10-27 10:48:48 -0400177 lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
Mike Klein487bfc22016-10-14 14:04:56 -0400178 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400179 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400180 }
Brian Salomon03e05842017-02-23 12:23:47 -0500181 if (skia_enable_gpu) {
182 include_dirs += [ "src/gpu" ]
183 }
Brian Osman34755e22016-12-05 09:46:02 -0500184 if (skia_use_angle) {
185 defines += [ "SK_ANGLE" ]
186 }
Brian Osman3f375d02016-12-28 11:19:22 -0500187 if (skia_enable_discrete_gpu) {
188 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
189 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400190 if (!is_official_build) {
191 defines += [ "GR_TEST_UTILS=1" ]
192 }
mtkleinc04ff472016-06-23 10:29:30 -0700193}
194
195# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
196config("skia_library") {
197 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700198 defines = [ "SKIA_IMPLEMENTATION=1" ]
199}
200
201skia_library_configs = [
202 ":skia_public",
203 ":skia_private",
204 ":skia_library",
205]
206
mtklein9b8583d2016-08-24 17:32:30 -0700207# Use for CPU-specific Skia code that needs particular compiler flags.
208template("opts") {
209 if (invoker.enabled) {
210 source_set(target_name) {
211 forward_variables_from(invoker, "*")
212 configs += skia_library_configs
213 }
214 } else {
215 # If not enabled, a phony empty target that swallows all otherwise unused variables.
216 source_set(target_name) {
217 forward_variables_from(invoker,
218 "*",
219 [
220 "sources",
221 "cflags",
222 ])
223 }
224 }
anmittala7eaf2e2016-08-17 13:57:26 -0700225}
226
mtklein422310d2016-08-16 18:28:43 -0700227is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700228
mtklein7d6fb2c2016-08-25 14:50:44 -0700229opts("none") {
230 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700231 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700232 cflags = []
233}
234
mtklein7d6fb2c2016-08-25 14:50:44 -0700235opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700236 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700237 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700238 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700239}
240
241opts("arm64") {
242 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700243 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700244 cflags = []
245}
246
247opts("crc32") {
248 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700249 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700250 cflags = [ "-march=armv8-a+crc" ]
251}
252
mtklein9b8583d2016-08-24 17:32:30 -0700253opts("sse2") {
254 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700255 sources = skia_opts.sse2_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_SSE2" ]
258 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400259 cflags = [ "-msse2" ]
260 }
mtklein9b8583d2016-08-24 17:32:30 -0700261}
mtkleinc04ff472016-06-23 10:29:30 -0700262
mtklein9b8583d2016-08-24 17:32:30 -0700263opts("ssse3") {
264 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700265 sources = skia_opts.ssse3_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_SSSE3" ]
268 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400269 cflags = [ "-mssse3" ]
270 }
mtklein9b8583d2016-08-24 17:32:30 -0700271}
mtkleinc04ff472016-06-23 10:29:30 -0700272
mtklein9b8583d2016-08-24 17:32:30 -0700273opts("sse41") {
274 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700275 sources = skia_opts.sse41_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_SSE41" ]
278 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400279 cflags = [ "-msse4.1" ]
280 }
mtklein9b8583d2016-08-24 17:32:30 -0700281}
mtklein4e976072016-08-08 09:06:27 -0700282
mtklein9b8583d2016-08-24 17:32:30 -0700283opts("sse42") {
284 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700285 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400286 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400287 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
288 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400289 cflags = [ "-msse4.2" ]
290 }
mtklein9b8583d2016-08-24 17:32:30 -0700291}
292
293opts("avx") {
294 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700295 sources = skia_opts.avx_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400296 if (!is_clang && is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000297 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400298 } else {
299 cflags = [ "-mavx" ]
300 }
mtkleinc04ff472016-06-23 10:29:30 -0700301}
302
mtkleinc095df52016-08-24 12:23:52 -0700303# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700304template("optional") {
305 if (invoker.enabled) {
306 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700307 if (defined(invoker.public_defines)) {
308 defines = invoker.public_defines
309 }
mtklein457b42a2016-08-23 13:56:37 -0700310 }
311 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700312 forward_variables_from(invoker,
313 "*",
314 [
315 "public_defines",
316 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700317 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700318 ])
mtklein457b42a2016-08-23 13:56:37 -0700319 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700320 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700321 if (defined(invoker.configs_to_remove)) {
322 configs -= invoker.configs_to_remove
323 }
mtklein457b42a2016-08-23 13:56:37 -0700324 }
325 } else {
mtklein457b42a2016-08-23 13:56:37 -0700326 source_set(target_name) {
327 forward_variables_from(invoker,
328 "*",
329 [
330 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700331 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700332 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700333 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700334 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700335 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700336 ])
mtkleincd01b032016-08-31 04:58:19 -0700337 if (defined(invoker.sources_when_disabled)) {
338 sources = invoker.sources_when_disabled
339 }
340 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700341 }
mtkleineb3c4252016-08-23 07:38:09 -0700342 }
mtklein457b42a2016-08-23 13:56:37 -0700343}
mtklein457b42a2016-08-23 13:56:37 -0700344
Mike Kleina04bb452017-02-09 12:24:07 -0500345optional("effects") {
346 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400347 deps = [
348 ":compile_processors",
349 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500350 sources =
351 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
352 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
353}
354
mtkleina45be612016-08-29 15:22:10 -0700355optional("fontmgr_android") {
356 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700357
358 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500359 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700360 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700361 ]
362 sources = [
363 "src/ports/SkFontMgr_android.cpp",
364 "src/ports/SkFontMgr_android_factory.cpp",
365 "src/ports/SkFontMgr_android_parser.cpp",
366 ]
367}
368
mtkleind2e39db2016-09-07 07:52:55 -0700369optional("fontmgr_custom") {
370 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
371
372 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500373 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700374 ]
375 sources = [
376 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500377 "src/ports/SkFontMgr_custom.h",
378 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700379 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500380 "src/ports/SkFontMgr_custom_embedded.cpp",
381 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700382 ]
383}
384
mtklein3cc22182016-08-29 13:26:14 -0700385optional("fontmgr_fontconfig") {
386 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700387
388 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500389 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700390 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700391 ]
392 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700393 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700394 "src/ports/SkFontConfigInterface_direct.cpp",
395 "src/ports/SkFontConfigInterface_direct_factory.cpp",
396 "src/ports/SkFontMgr_FontConfigInterface.cpp",
397 "src/ports/SkFontMgr_fontconfig.cpp",
398 "src/ports/SkFontMgr_fontconfig_factory.cpp",
399 ]
400}
401
mtkleincdedd0e2016-09-12 15:15:44 -0700402optional("fontmgr_fuchsia") {
403 enabled = is_fuchsia && skia_use_freetype
404
405 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500406 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700407 ]
408 sources = [
409 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500410 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700411 "src/ports/SkFontMgr_custom_empty_factory.cpp",
412 ]
413}
414
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700415if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400416 executable("sksllex") {
417 sources = [
418 "src/sksl/lex/Main.cpp",
419 "src/sksl/lex/NFA.cpp",
420 "src/sksl/lex/RegexNode.cpp",
421 "src/sksl/lex/RegexParser.cpp",
422 ]
423 include_dirs = [ "src/sksl/lex" ]
424 }
425
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700426 action("run_sksllex") {
427 script = "gn/run_sksllex.py"
428 sources = [
429 "src/sksl/lex/layout.lex",
430 "src/sksl/lex/sksl.lex",
431 ]
432
433 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
434 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
435 outputs = [
436 "$target_out_dir/" +
437 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
438 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
439 # confused due to the same file being named by two different paths
440 ]
441 sksllex_path = "$root_out_dir/"
442 sksllex_path += "sksllex"
443 if (host_os == "win") {
444 sksllex_path += ".exe"
445 }
446 args = [
447 rebase_path(sksllex_path),
448 rebase_path("bin/clang-format"),
449 rebase_path("src"),
450 ]
451 }
452} else {
453 group("run_sksllex") {
454 }
455}
456
457if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400458 executable("skslc") {
459 defines = [ "SKSL_STANDALONE" ]
460 sources = [
461 "src/sksl/SkSLMain.cpp",
462 ]
463 sources += skia_sksl_sources
464 include_dirs = [
465 "src/gpu",
466 "src/sksl",
467 ]
468 deps = [
469 "//third_party/spirv-tools",
470 ]
471 }
472
473 skia_gpu_processor_outputs = []
474 foreach(src, skia_gpu_processor_sources) {
475 dir = get_path_info(src, "dir")
476 name = get_path_info(src, "name")
477
478 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
479 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
480 skia_gpu_processor_outputs += [
481 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
482 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
483 # confused due to the same file being named by two different paths
484 ]
485 }
486
487 action("compile_processors") {
488 script = "gn/compile_processors.py"
489 deps = [
490 ":skslc(//gn/toolchain:$host_toolchain)",
491 ]
492 sources = skia_gpu_processor_sources
493 outputs = skia_gpu_processor_outputs
494 skslc_path = "$root_out_dir/"
495 if (host_toolchain != default_toolchain_name) {
496 skslc_path += "$host_toolchain/"
497 }
498 skslc_path += "skslc"
499 if (host_os == "win") {
500 skslc_path += ".exe"
501 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400502 args = [
503 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400504 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400505 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400506 args += rebase_path(skia_gpu_processor_sources)
507 }
508} else {
509 skia_gpu_processor_outputs = []
510 group("compile_processors") {
511 }
512}
513
mtklein06c35c02016-09-20 12:28:12 -0700514optional("gpu") {
515 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400516 deps = [
517 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700518 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400519 ]
mtkleine9fb3d52016-09-20 15:11:46 -0700520 public_defines = []
521
Mike Klein29b3e582017-02-09 11:57:32 -0500522 sources = skia_gpu_sources + skia_sksl_sources +
Ethan Nicholas762466e2017-06-29 10:03:38 -0400523 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] +
524 skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700525
526 # These paths need to be absolute to match the ones produced by shared_sources.gni.
527 sources -= get_path_info([
528 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
529 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
530 ],
531 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400532 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700533 if (is_android) {
534 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400535
536 # this lib is required to link against AHardwareBuffer
537 if (defined(ndk_api) && ndk_api >= 26) {
538 libs += [ "android" ]
539 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400540 } else if (skia_use_egl) {
541 sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
542 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700543 } else if (is_linux) {
544 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500545 libs += [
546 "GL",
547 "GLU",
548 ]
mtklein06c35c02016-09-20 12:28:12 -0700549 } else if (is_mac) {
550 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800551 } else if (is_ios) {
552 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400553 } else if (is_win) {
554 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
555 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700556 } else {
557 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
558 }
mtkleine9fb3d52016-09-20 15:11:46 -0700559
560 if (skia_use_vulkan) {
561 public_defines += [ "SK_VULKAN" ]
562 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700563 if (skia_enable_vulkan_debug_layers) {
564 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
565 }
mtkleine9fb3d52016-09-20 15:11:46 -0700566 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400567 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400568 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400569 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
570 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400571
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400572 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400573 if (skia_use_metal) {
574 public_defines += [ "SK_METAL" ]
575 sources += skia_metal_sources
576 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400577 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400578 }
mtklein06c35c02016-09-20 12:28:12 -0700579}
580
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400581optional("heif") {
582 enabled = skia_use_libheif
583 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
584
585 deps = []
586
587 sources = [
588 "src/codec/SkHeifCodec.cpp",
589 ]
590}
591
mtklein63213812016-08-24 09:55:56 -0700592optional("jpeg") {
593 enabled = skia_use_libjpeg_turbo
594 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
595
mtklein63213812016-08-24 09:55:56 -0700596 deps = [
597 "//third_party/libjpeg-turbo:libjpeg",
598 ]
599 sources = [
600 "src/codec/SkJpegCodec.cpp",
601 "src/codec/SkJpegDecoderMgr.cpp",
602 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700603 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400604 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700605 ]
606}
607
608optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500609 enabled = skia_use_zlib && skia_enable_pdf
610 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700611
mtklein63213812016-08-24 09:55:56 -0700612 deps = [
613 "//third_party/zlib",
614 ]
brettwb9447282016-09-01 14:24:39 -0700615 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700616 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700617
618 if (skia_use_sfntly) {
619 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500620 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700621 }
622}
623
624optional("png") {
625 enabled = skia_use_libpng
626 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
627
mtklein63213812016-08-24 09:55:56 -0700628 deps = [
629 "//third_party/libpng",
630 ]
631 sources = [
632 "src/codec/SkIcoCodec.cpp",
633 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400634 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700635 ]
636}
637
scroggof84ad642016-10-31 09:02:57 -0700638optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400639 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700640 public_defines = [ "SK_CODEC_DECODES_RAW" ]
641
642 deps = [
643 "//third_party/dng_sdk",
644 "//third_party/libjpeg-turbo:libjpeg",
645 "//third_party/piex",
646 ]
647
648 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
649 # Skia.
650 configs_to_remove = [ "//gn:no_exceptions" ]
651
652 sources = [
653 "src/codec/SkRawAdapterCodec.cpp",
654 "src/codec/SkRawCodec.cpp",
655 ]
656}
657
mtklein3cc22182016-08-29 13:26:14 -0700658optional("typeface_freetype") {
659 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700660
661 deps = [
662 "//third_party/freetype2",
663 ]
664 sources = [
665 "src/ports/SkFontHost_FreeType.cpp",
666 "src/ports/SkFontHost_FreeType_common.cpp",
667 ]
668}
669
mtklein457b42a2016-08-23 13:56:37 -0700670optional("webp") {
671 enabled = skia_use_libwebp
672 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
673
mtklein457b42a2016-08-23 13:56:37 -0700674 deps = [
675 "//third_party/libwebp",
676 ]
677 sources = [
678 "src/codec/SkWebpAdapterCodec.cpp",
679 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400680 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700681 ]
mtkleineb3c4252016-08-23 07:38:09 -0700682}
683
mtklein63213812016-08-24 09:55:56 -0700684optional("xml") {
685 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000686 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700687
mtklein63213812016-08-24 09:55:56 -0700688 deps = [
689 "//third_party/expat",
690 ]
691 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500692 "src/svg/SkSVGCanvas.cpp",
693 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700694 "src/xml/SkDOM.cpp",
695 "src/xml/SkXMLParser.cpp",
696 "src/xml/SkXMLWriter.cpp",
697 ]
698}
699
mtkleinc04ff472016-06-23 10:29:30 -0700700component("skia") {
701 public_configs = [ ":skia_public" ]
702 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700703
704 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700705 ":arm64",
706 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700707 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700708 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500709 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700710 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700711 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700712 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700713 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700714 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400715 ":heif",
mtklein63213812016-08-24 09:55:56 -0700716 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700717 ":none",
mtklein63213812016-08-24 09:55:56 -0700718 ":pdf",
719 ":png",
scroggof84ad642016-10-31 09:02:57 -0700720 ":raw",
mtklein9b8583d2016-08-24 17:32:30 -0700721 ":sse2",
722 ":sse41",
723 ":sse42",
724 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700725 ":webp",
mtklein63213812016-08-24 09:55:56 -0700726 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700727 ]
728
Chinmay Garde43f115c2016-11-16 15:04:12 -0800729 # This file (and all GN files in Skia) are designed to work with an
730 # empty sources assignment filter; we handle all that explicitly.
731 # We clear the filter here for clients who may have set up a global filter.
732 set_sources_assignment_filter([])
733
mtkleinc04ff472016-06-23 10:29:30 -0700734 sources = []
brettwb9447282016-09-01 14:24:39 -0700735 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700736 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500737 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700738 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400739 "src/android/SkAndroidFrameworkUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700740 "src/android/SkBitmapRegionCodec.cpp",
741 "src/android/SkBitmapRegionDecoder.cpp",
742 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400743 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700744 "src/codec/SkBmpCodec.cpp",
745 "src/codec/SkBmpMaskCodec.cpp",
746 "src/codec/SkBmpRLECodec.cpp",
747 "src/codec/SkBmpStandardCodec.cpp",
748 "src/codec/SkCodec.cpp",
749 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700750 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700751 "src/codec/SkMaskSwizzler.cpp",
752 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700753 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700754 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700755 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700756 "src/codec/SkSwizzler.cpp",
757 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700758 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700759 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700760 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700761 "src/ports/SkMemory_malloc.cpp",
762 "src/ports/SkOSFile_stdio.cpp",
763 "src/sfnt/SkOTTable_name.cpp",
764 "src/sfnt/SkOTUtils.cpp",
765 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700766 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700767 ]
brettwb9447282016-09-01 14:24:39 -0700768
mtklein7d6fb2c2016-08-25 14:50:44 -0700769 libs = []
770
mtkleinc04ff472016-06-23 10:29:30 -0700771 if (is_win) {
772 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400773 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700774 "src/ports/SkDebug_win.cpp",
775 "src/ports/SkFontHost_win.cpp",
776 "src/ports/SkFontMgr_win_dw.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700777 "src/ports/SkImageEncoder_WIC.cpp",
778 "src/ports/SkImageGeneratorWIC.cpp",
779 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700780 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700781 "src/ports/SkScalerContext_win_dw.cpp",
782 "src/ports/SkTLS_win.cpp",
783 "src/ports/SkTypeface_win_dw.cpp",
784 ]
Mike Klein69f6ed42016-10-13 15:45:07 -0400785 if (skia_use_gdi) {
786 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
787 libs += [
788 "Gdi32.lib",
789 "Usp10.lib",
790 ]
791 } else {
792 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
793 }
mtkleinb9be9792016-09-16 14:44:18 -0700794 sources -=
795 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400796 libs += [
797 "FontSub.lib",
798 "Ole32.lib",
799 "OleAut32.lib",
800 "User32.lib",
801 ]
mtkleinc04ff472016-06-23 10:29:30 -0700802 } else {
803 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700804 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700805 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700806 "src/ports/SkTLS_pthread.cpp",
807 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400808 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700809 }
810
mtklein7d6fb2c2016-08-25 14:50:44 -0700811 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500812 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500813 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500814 deps += [ "//third_party/cpu-features" ]
815 }
mtklein06c35c02016-09-20 12:28:12 -0700816 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700817 libs += [
818 "EGL",
819 "GLESv2",
820 "log",
821 ]
822 }
823
mtkleinc04ff472016-06-23 10:29:30 -0700824 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700825 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700826 }
827
828 if (is_mac) {
829 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700830 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700831 "src/ports/SkFontHost_mac.cpp",
832 "src/ports/SkImageEncoder_CG.cpp",
833 "src/ports/SkImageGeneratorCG.cpp",
834 ]
mtklein09e61f72016-08-23 13:35:28 -0700835 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400836 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
837 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700838 "ApplicationServices.framework",
839 "OpenGL.framework",
840 ]
mtkleinc04ff472016-06-23 10:29:30 -0700841 }
abarth6fc8ff02016-07-15 15:15:15 -0700842
Mike Klein7d302882016-11-03 14:06:31 -0400843 if (is_ios) {
844 sources += [
845 "src/ports/SkDebug_stdio.cpp",
846 "src/ports/SkFontHost_mac.cpp",
847 "src/ports/SkImageEncoder_CG.cpp",
848 "src/ports/SkImageGeneratorCG.cpp",
849 ]
850 libs += [
851 "CoreFoundation.framework",
852 "CoreGraphics.framework",
853 "CoreText.framework",
854 "ImageIO.framework",
855 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400856
857 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
858 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400859 ]
860 }
861
abarth6fc8ff02016-07-15 15:15:15 -0700862 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700863 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700864 }
mtkleinc04ff472016-06-23 10:29:30 -0700865}
866
mtkleinc095df52016-08-24 12:23:52 -0700867# Targets guarded by skia_enable_tools may use //third_party freely.
868if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -0500869 # Used by gn_to_bp.py to list our public include dirs.
870 source_set("public") {
871 configs += [ ":skia_public" ]
872 }
873
Mike Kleinc36dedf2016-11-18 09:35:28 -0500874 config("skia.h_config") {
875 include_dirs = [ "$target_gen_dir" ]
876 }
877 action("skia.h") {
878 public_configs = [ ":skia.h_config" ]
879 skia_h = "$target_gen_dir/skia.h"
880 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -0400881 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000882 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -0500883 depfile = "$skia_h.deps"
884 outputs = [
885 skia_h,
886 ]
887 }
888
889 if (skia_enable_gpu && target_cpu == "x64") {
890 # Our bots only have 64-bit libOSMesa installed.
891 # TODO: worth fixing?
892 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" ]
901 } else if (skia_use_mesa) {
902 sources += [ "tools/fiddle/mesa_context.cpp" ]
903 if (is_linux) {
904 libs += [ "OSMesa" ]
905 }
906 } else {
907 sources += [ "tools/fiddle/null_context.cpp" ]
908 }
Joe Gregorio1e735c02017-04-19 14:05:14 -0400909 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -0500910 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -0400911 ":flags",
Mike Kleinc36dedf2016-11-18 09:35:28 -0500912 ":skia",
913 ":skia.h",
914 ]
915 }
916 }
917
918 if (skia_enable_gpu) {
919 source_set("public_headers_warnings_check") {
920 sources = [
921 "tools/public_headers_warnings_check.cpp",
922 ]
923 configs -= [ "//gn:warnings_except_public_headers" ]
924 deps = [
925 ":skia",
926 ":skia.h",
927 ]
928 }
929 }
930
mtkleinc095df52016-08-24 12:23:52 -0700931 template("test_lib") {
932 config(target_name + "_config") {
933 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700934 if (defined(invoker.public_defines)) {
935 defines = invoker.public_defines
936 }
mtklein25c81d42016-07-27 13:55:26 -0700937 }
mtkleinc095df52016-08-24 12:23:52 -0700938 source_set(target_name) {
939 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
940 public_configs = [
941 ":" + target_name + "_config",
942 ":skia_private",
943 ]
944
945 if (!defined(deps)) {
946 deps = []
947 }
948 deps += [ ":skia" ]
949 testonly = true
950 }
mtklein25c81d42016-07-27 13:55:26 -0700951 }
mtklein25c81d42016-07-27 13:55:26 -0700952
Mike Kleine6682eb2017-01-05 10:54:57 -0500953 template("test_app") {
954 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
955 shared_library("lib" + target_name) {
956 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400957 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500958 testonly = true
959 }
960 } else {
Mike Klein7d921032017-01-05 12:20:41 -0500961 _executable = target_name
962 executable(_executable) {
Mike Kleine6682eb2017-01-05 10:54:57 -0500963 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400964 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500965 testonly = true
966 }
967 }
Mike Klein7d921032017-01-05 12:20:41 -0500968 if (is_android && skia_android_serial != "" && defined(_executable)) {
969 action("push_" + target_name) {
970 script = "gn/push_to_android.py"
971 deps = [
972 ":" + _executable,
973 ]
974 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
975 outputs = [
976 _stamp,
977 ]
978 args = [
979 rebase_path("$root_build_dir/$_executable"),
980 skia_android_serial,
981 rebase_path(_stamp),
982 ]
983 testonly = true
984 }
985 }
Mike Kleine6682eb2017-01-05 10:54:57 -0500986 }
987
mtkleinc095df52016-08-24 12:23:52 -0700988 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700989 public_include_dirs = []
990 if (skia_enable_gpu) {
991 public_defines = []
992 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700993
994 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700995 sources = [
996 "tools/gpu/GrContextFactory.cpp",
997 "tools/gpu/GrTest.cpp",
998 "tools/gpu/TestContext.cpp",
999 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001000 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001001 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1002 "tools/gpu/gl/debug/GrBufferObj.cpp",
1003 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1004 "tools/gpu/gl/debug/GrProgramObj.cpp",
1005 "tools/gpu/gl/debug/GrShaderObj.cpp",
1006 "tools/gpu/gl/debug/GrTextureObj.cpp",
1007 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1008 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001009 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001010 ]
1011 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001012
Kevin Lubick4a24e102017-03-29 11:19:01 -04001013 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001014 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001015 } else if (is_ios) {
1016 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1017 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001018 } else if (is_linux) {
1019 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001020 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001021 } else if (is_mac) {
1022 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001023 } else if (is_win) {
1024 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1025 libs += [
1026 "Gdi32.lib",
1027 "OpenGL32.lib",
1028 ]
mtklein38925aa2016-09-21 10:11:25 -07001029 }
mtklein6ef69992016-09-14 06:12:09 -07001030
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001031 cflags_objcc = [ "-fobjc-arc" ]
1032
Mike Kleinc168a3a2016-11-14 14:53:13 +00001033 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001034 deps += [ "//third_party/angle2" ]
1035 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1036 }
mtklein38925aa2016-09-21 10:11:25 -07001037 if (skia_use_mesa) {
1038 public_defines += [ "SK_MESA" ]
1039 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
1040 libs += [ "OSMesa" ]
1041 }
mtkleind68f9b02016-09-23 13:18:41 -07001042 if (skia_use_vulkan) {
1043 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Brian Salomon5db010b2017-04-25 16:05:29 -04001044 if (is_win) {
1045 libs += [ "vulkan-1.lib" ]
1046 } else {
1047 libs += [ "vulkan" ]
1048 }
mtkleind68f9b02016-09-23 13:18:41 -07001049 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001050 if (skia_use_metal) {
1051 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1052 }
mtkleina627b5c2016-09-20 13:36:47 -07001053 }
mtklein25c81d42016-07-27 13:55:26 -07001054 }
mtklein25c81d42016-07-27 13:55:26 -07001055
mtkleinc095df52016-08-24 12:23:52 -07001056 test_lib("flags") {
1057 public_include_dirs = [ "tools/flags" ]
1058 sources = [
1059 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001060 ]
1061 }
1062 test_lib("common_flags") {
1063 public_include_dirs = [ "tools/flags" ]
1064 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001065 "tools/flags/SkCommonFlags.cpp",
1066 "tools/flags/SkCommonFlagsConfig.cpp",
1067 ]
1068 deps = [
mtklein046cb562016-09-16 10:23:12 -07001069 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001070 ":gpu_tool_utils",
1071 ]
1072 }
mtklein25c81d42016-07-27 13:55:26 -07001073
mtkleinc095df52016-08-24 12:23:52 -07001074 test_lib("tool_utils") {
1075 public_include_dirs = [
1076 "tools",
1077 "tools/debugger",
1078 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001079 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001080 ]
1081 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001082 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001083 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001084 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001085 "tools/ProcStats.cpp",
1086 "tools/Resources.cpp",
1087 "tools/ThermalManager.cpp",
1088 "tools/UrlDataManager.cpp",
1089 "tools/debugger/SkDebugCanvas.cpp",
1090 "tools/debugger/SkDrawCommand.cpp",
1091 "tools/debugger/SkJsonWriteBuffer.cpp",
1092 "tools/debugger/SkObjectParser.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001093 "tools/picture_utils.cpp",
1094 "tools/random_parse_path.cpp",
1095 "tools/sk_tool_utils.cpp",
1096 "tools/sk_tool_utils_font.cpp",
1097 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001098 "tools/trace/SkChromeTracingTracer.cpp",
1099 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001100 "tools/trace/SkDebugfTracer.cpp",
1101 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001102 "tools/trace/SkEventTracingPriv.cpp",
1103 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001104 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001105 libs = []
1106 if (is_ios) {
1107 sources += [ "tools/ios_utils.m" ]
1108 libs += [ "Foundation.framework" ]
1109 }
mtkleinc095df52016-08-24 12:23:52 -07001110 deps = [
mtklein046cb562016-09-16 10:23:12 -07001111 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001112 ":flags",
1113 "//third_party/libpng",
1114 ]
1115 public_deps = [
1116 "//third_party/jsoncpp",
1117 ]
1118 }
mtklein25c81d42016-07-27 13:55:26 -07001119
Mike Klein6e744122016-10-27 12:21:40 -04001120 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001121 test_lib("gm") {
1122 public_include_dirs = [ "gm" ]
1123 sources = gm_sources
1124 deps = [
scroggo19b91532016-10-24 09:03:26 -07001125 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001126 ":gpu_tool_utils",
1127 ":skia",
1128 ":tool_utils",
1129 ]
1130 }
mtklein25c81d42016-07-27 13:55:26 -07001131
Mike Klein6e744122016-10-27 12:21:40 -04001132 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001133 test_lib("tests") {
1134 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001135 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001136 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001137 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001138 }
mtkleinc095df52016-08-24 12:23:52 -07001139 deps = [
fmalita6cf896d2016-08-25 08:44:35 -07001140 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001141 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001142 ":skia",
1143 ":tool_utils",
1144 "//third_party/libpng",
1145 "//third_party/zlib",
1146 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001147 public_deps = [
1148 ":gpu_tool_utils", # Test.h #includes headers from this target.
1149 ]
mtkleinc095df52016-08-24 12:23:52 -07001150 }
mtklein2f3416d2016-08-02 16:02:05 -07001151
Mike Klein6e744122016-10-27 12:21:40 -04001152 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001153 test_lib("bench") {
1154 public_include_dirs = [ "bench" ]
1155 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001156 deps = [
1157 ":flags",
1158 ":gm",
1159 ":gpu_tool_utils",
1160 ":skia",
1161 ":tool_utils",
1162 ]
1163 }
mtklein2b6870c2016-07-28 14:17:33 -07001164
mtkleinc095df52016-08-24 12:23:52 -07001165 test_lib("experimental_svg_model") {
1166 public_include_dirs = [ "experimental/svg/model" ]
1167 sources = [
1168 "experimental/svg/model/SkSVGAttribute.cpp",
1169 "experimental/svg/model/SkSVGAttributeParser.cpp",
1170 "experimental/svg/model/SkSVGCircle.cpp",
Florin Malitace8840e2016-12-08 09:26:47 -05001171 "experimental/svg/model/SkSVGClipPath.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001172 "experimental/svg/model/SkSVGContainer.cpp",
1173 "experimental/svg/model/SkSVGDOM.cpp",
1174 "experimental/svg/model/SkSVGEllipse.cpp",
1175 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001176 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001177 "experimental/svg/model/SkSVGNode.cpp",
1178 "experimental/svg/model/SkSVGPath.cpp",
1179 "experimental/svg/model/SkSVGPoly.cpp",
1180 "experimental/svg/model/SkSVGRect.cpp",
1181 "experimental/svg/model/SkSVGRenderContext.cpp",
1182 "experimental/svg/model/SkSVGSVG.cpp",
1183 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001184 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001185 "experimental/svg/model/SkSVGTransformableNode.cpp",
1186 "experimental/svg/model/SkSVGValue.cpp",
1187 ]
1188 deps = [
1189 ":skia",
1190 ]
1191 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001192
Kevin Lubickebf648e2017-09-21 13:45:16 -04001193 if (target_cpu != "wasm") {
1194 test_lib("views") {
1195 public_include_dirs = [ "include/views" ]
1196 sources = [
1197 "src/views/SkEvent.cpp",
1198 "src/views/SkEventSink.cpp",
1199 "src/views/SkOSMenu.cpp",
1200 "src/views/SkTagList.cpp",
1201 "src/views/SkTouchGesture.cpp",
1202 "src/views/SkView.cpp",
1203 "src/views/SkViewPriv.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001204 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001205 libs = []
1206 deps = []
1207 if (!is_android) {
1208 sources += [ "src/views/SkWindow.cpp" ]
1209 }
1210 if (is_linux) {
1211 public_include_dirs += [ "src/views/unix" ]
1212 sources += [
1213 "src/views/unix/SkOSWindow_Unix.cpp",
1214 "src/views/unix/keysym2ucs.c",
1215 ]
1216 libs += [
1217 "GL",
1218 "X11",
1219 ]
1220 } else if (is_mac) {
1221 sources += [
1222 "src/views/mac/SkEventNotifier.mm",
1223 "src/views/mac/SkNSView.mm",
1224 "src/views/mac/SkOSWindow_Mac.mm",
1225 "src/views/mac/SkTextFieldCell.m",
1226 ]
1227 libs += [
1228 "QuartzCore.framework",
1229 "Cocoa.framework",
1230 "Foundation.framework",
1231 ]
1232 } else if (is_win) {
1233 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1234 } else if (is_ios) {
1235 sources += [ "src/views/mac/SkEventNotifier.mm" ]
1236 }
1237 if (skia_use_angle) {
1238 deps += [ "//third_party/angle2" ]
1239 }
Brian Osman34755e22016-12-05 09:46:02 -05001240 }
Brian Osman16adfa32016-10-18 14:42:44 -04001241 }
1242
Mike Klein38af9432016-11-11 11:39:44 -05001243 if (skia_use_lua) {
1244 test_lib("lua") {
1245 public_include_dirs = []
1246 sources = [
1247 "src/utils/SkLua.cpp",
1248 "src/utils/SkLuaCanvas.cpp",
1249 ]
1250 deps = [
1251 "//third_party/lua",
1252 ]
1253 }
1254
Mike Kleine6682eb2017-01-05 10:54:57 -05001255 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001256 sources = [
1257 "tools/lua/lua_app.cpp",
1258 ]
1259 deps = [
1260 ":lua",
1261 ":skia",
1262 "//third_party/lua",
1263 ]
Mike Klein38af9432016-11-11 11:39:44 -05001264 }
1265
Mike Kleine6682eb2017-01-05 10:54:57 -05001266 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001267 sources = [
1268 "tools/lua/lua_pictures.cpp",
1269 ]
1270 deps = [
1271 ":flags",
1272 ":lua",
1273 ":skia",
1274 ":tool_utils",
1275 "//third_party/lua",
1276 ]
Mike Klein38af9432016-11-11 11:39:44 -05001277 }
1278 }
1279
Cary Clark8032b982017-07-28 11:04:54 -04001280 test_app("bookmaker") {
1281 sources = [
1282 "tools/bookmaker/bookmaker.cpp",
1283 "tools/bookmaker/fiddleParser.cpp",
1284 "tools/bookmaker/includeParser.cpp",
1285 "tools/bookmaker/includeWriter.cpp",
1286 "tools/bookmaker/mdOut.cpp",
1287 "tools/bookmaker/parserCommon.cpp",
1288 "tools/bookmaker/spellCheck.cpp",
1289 ]
1290 deps = [
1291 ":flags",
1292 ":skia",
1293 ":tool_utils",
1294 ]
1295 }
1296
Kevin Lubickebf648e2017-09-21 13:45:16 -04001297 if (target_cpu != "wasm") {
1298 import("gn/samples.gni")
1299 test_lib("samples") {
1300 public_include_dirs = [ "samplecode" ]
1301 include_dirs = [ "experimental" ]
1302 sources = samples_sources + [
1303 "experimental/SkSetPoly3To3.cpp",
1304 "experimental/SkSetPoly3To3_A.cpp",
1305 "experimental/SkSetPoly3To3_D.cpp",
Brian Osmancff94e42017-06-26 13:12:37 -04001306
Kevin Lubickebf648e2017-09-21 13:45:16 -04001307 # Relocating these files here, so that clients don't try to build them while they're
1308 # still in active development. Clang's thread safety analysis gets tripped up by
1309 # conditional locks.
1310 "src/core/SkThreadedBMPDevice.cpp",
1311 "src/core/SkThreadedBMPDevice.h",
1312 ]
1313 deps = [
1314 ":experimental_svg_model",
1315 ":flags",
1316 ":gm",
1317 ":tool_utils",
1318 ":views",
1319 ":xml",
1320 ]
Mike Klein38af9432016-11-11 11:39:44 -05001321
Kevin Lubickebf648e2017-09-21 13:45:16 -04001322 if (skia_use_lua) {
1323 sources += [ "samplecode/SampleLua.cpp" ]
1324 deps += [
1325 ":lua",
1326 "//third_party/lua",
1327 ]
1328 }
1329 }
1330 test_app("dm") {
1331 sources = [
1332 "dm/DM.cpp",
1333 "dm/DMJsonWriter.cpp",
1334 "dm/DMSrcSink.cpp",
1335 ]
1336 include_dirs = [ "tests" ]
1337 deps = [
1338 ":common_flags",
1339 ":experimental_svg_model",
1340 ":flags",
1341 ":gm",
1342 ":gpu_tool_utils",
1343 ":skia",
1344 ":tests",
1345 ":tool_utils",
1346 "//third_party/jsoncpp",
1347 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001348 ]
1349 }
Brian Osman16adfa32016-10-18 14:42:44 -04001350 }
1351
Mike Klein06432b22017-03-21 13:14:33 -04001352 test_app("ok") {
1353 sources = [
1354 "tools/ok.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001355 "tools/ok_dsts.cpp",
Mike Klein154e6da2017-07-26 15:13:47 -04001356 "tools/ok_engines.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001357 "tools/ok_srcs.cpp",
Mike Kleind63442d2017-03-27 14:16:04 -04001358 "tools/ok_test.cpp",
Mike Kleinf5d1a552017-03-25 12:32:22 -04001359 "tools/ok_vias.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001360 ]
1361 deps = [
Mike Klein4f6e2712017-08-11 10:37:35 -04001362 ":bench",
Mike Klein06432b22017-03-21 13:14:33 -04001363 ":gm",
1364 ":skia",
Mike Kleind63442d2017-03-27 14:16:04 -04001365 ":tests",
Mike Klein62669ad2017-05-09 16:03:07 -04001366 ":tool_utils",
Mike Klein06432b22017-03-21 13:14:33 -04001367 ]
1368 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001369 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001370 sources = [
1371 "bench/nanobench.cpp",
1372 ]
1373 deps = [
1374 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001375 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001376 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001377 ":flags",
1378 ":gm",
1379 ":gpu_tool_utils",
1380 ":skia",
1381 ":tool_utils",
1382 "//third_party/jsoncpp",
1383 ]
mtklein2b6870c2016-07-28 14:17:33 -07001384 }
halcanary19a97202016-08-03 15:08:04 -07001385
Ravi Mistry10d36c52017-01-31 09:49:18 -05001386 test_app("skpinfo") {
1387 sources = [
1388 "tools/skpinfo.cpp",
1389 ]
1390 deps = [
1391 ":flags",
1392 ":skia",
1393 ]
1394 }
1395
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001396 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001397 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001398 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001399 "samplecode/SampleApp.cpp",
1400 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001401 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001402 if (is_mac) {
1403 sources += [ "src/views/mac/skia_mac.mm" ]
1404 } else if (is_win) {
1405 sources += [ "src/views/win/skia_win.cpp" ]
1406 } else if (is_linux) {
1407 sources += [ "src/views/unix/skia_unix.cpp" ]
1408 }
mtklein38925aa2016-09-21 10:11:25 -07001409 deps = [
1410 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001411 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001412 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001413 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001414 ":skia",
1415 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001416 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001417 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001418 if (skia_use_angle) {
1419 deps += [ "//third_party/angle2" ]
1420 }
mtklein38925aa2016-09-21 10:11:25 -07001421 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001422 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001423
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001424 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001425 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001426 sources = [
1427 "tools/skpbench/skpbench.cpp",
1428 ]
1429 deps = [
1430 ":flags",
1431 ":gpu_tool_utils",
1432 ":skia",
1433 ":tool_utils",
1434 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001435 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001436 }
1437
Mike Klein7d302882016-11-03 14:06:31 -04001438 # We can't yet build ICU on iOS or Windows.
Kevin Lubickebf648e2017-09-21 13:45:16 -04001439 if (!is_ios && !is_win && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001440 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001441 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001442 "tools/shape/SkShaper_harfbuzz.cpp",
1443 "tools/shape/using_skia_and_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001444 ]
1445 deps = [
1446 ":skia",
1447 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001448 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001449 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001450 }
halcanary19a97202016-08-03 15:08:04 -07001451 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001452 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001453 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001454 "tools/shape/SkShaper_primitive.cpp",
1455 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001456 ]
1457 deps = [
1458 ":skia",
1459 ]
halcanary3eee9d92016-09-10 07:01:53 -07001460 }
mtklein046cb562016-09-16 10:23:12 -07001461
Matt Sarett9f1c4032017-05-17 10:06:32 -04001462 test_app("create_flutter_test_images") {
1463 sources = [
1464 "tools/create_flutter_test_images.cpp",
1465 ]
1466 deps = [
1467 ":skia",
1468 ":tool_utils",
1469 ]
1470 }
1471
Ben Wagner219f3622017-07-17 15:32:25 -04001472 test_app("create_test_font") {
1473 sources = [
1474 "tools/create_test_font.cpp",
1475 ]
1476 deps = [
1477 ":skia",
1478 ]
1479 assert_no_deps = [
1480 # tool_utils requires the output of this app.
1481 ":tool_utils",
1482 ]
1483 }
1484
Mike Kleine6682eb2017-01-05 10:54:57 -05001485 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001486 sources = [
1487 "tools/get_images_from_skps.cpp",
1488 ]
1489 deps = [
1490 ":flags",
1491 ":skia",
1492 "//third_party/jsoncpp",
1493 ]
mtklein046cb562016-09-16 10:23:12 -07001494 }
mtkleinecbc5262016-09-22 11:51:24 -07001495
Mike Kleine6682eb2017-01-05 10:54:57 -05001496 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001497 sources = [
1498 "tools/colorspaceinfo.cpp",
1499 ]
1500 deps = [
1501 ":flags",
1502 ":skia",
1503 ":tool_utils",
1504 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001505 }
1506
Kevin Lubickebf648e2017-09-21 13:45:16 -04001507 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001508 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001509 sources = [
1510 "tools/skiaserve/Request.cpp",
1511 "tools/skiaserve/Response.cpp",
1512 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001513 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1514 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1515 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1516 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1517 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1518 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1519 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1520 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1521 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001522 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1523 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001524 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1525 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1526 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1527 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1528 ]
1529 deps = [
1530 ":flags",
1531 ":gpu_tool_utils",
1532 ":skia",
1533 ":tool_utils",
1534 "//third_party/jsoncpp",
1535 "//third_party/libmicrohttpd",
1536 "//third_party/libpng",
1537 ]
Mike Klein7d302882016-11-03 14:06:31 -04001538 }
mtkleinecbc5262016-09-22 11:51:24 -07001539 }
kjlubick14f984b2016-10-03 11:49:45 -07001540
Mike Kleine6682eb2017-01-05 10:54:57 -05001541 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001542 sources = [
1543 "fuzz/FilterFuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001544 "fuzz/FuzzCanvas.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001545 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001546 "fuzz/FuzzGradients.cpp",
1547 "fuzz/FuzzParsePath.cpp",
1548 "fuzz/FuzzPathop.cpp",
1549 "fuzz/FuzzScaleToSides.cpp",
1550 "fuzz/fuzz.cpp",
1551 ]
1552 deps = [
1553 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001554 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001555 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001556 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001557 ]
kjlubick14f984b2016-10-03 11:49:45 -07001558 }
Mike Klein38312422016-10-05 15:41:01 -04001559
Mike Kleine6682eb2017-01-05 10:54:57 -05001560 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001561 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001562 rebase_path("tests/skia_test.cpp"),
1563 rebase_path("tests/Test.cpp"),
1564 ]
caryclark9feb6322016-10-25 08:58:26 -07001565 deps = [
1566 ":flags",
1567 ":gpu_tool_utils",
1568 ":skia",
1569 ":tool_utils",
1570 ]
caryclark9feb6322016-10-25 08:58:26 -07001571 }
1572
Mike Kleine6682eb2017-01-05 10:54:57 -05001573 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001574 sources = [
1575 "tools/DumpRecord.cpp",
1576 "tools/dump_record.cpp",
1577 ]
1578 deps = [
1579 ":flags",
1580 ":skia",
1581 ]
Mike Klein38312422016-10-05 15:41:01 -04001582 }
bungemanfe917272016-10-13 17:36:40 -04001583
Mike Kleine6682eb2017-01-05 10:54:57 -05001584 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001585 sources = [
1586 "tools/skdiff/skdiff.cpp",
1587 "tools/skdiff/skdiff_html.cpp",
1588 "tools/skdiff/skdiff_main.cpp",
1589 "tools/skdiff/skdiff_utils.cpp",
1590 ]
1591 deps = [
1592 ":skia",
1593 ":tool_utils",
1594 ]
bungemanfe917272016-10-13 17:36:40 -04001595 }
halcanarya73d76a2016-10-17 13:19:02 -07001596
Mike Kleine6682eb2017-01-05 10:54:57 -05001597 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001598 sources = [
1599 "tools/skp_parser.cpp",
1600 ]
1601 deps = [
1602 ":skia",
1603 ":tool_utils",
1604 "//third_party/jsoncpp",
1605 ]
halcanarya73d76a2016-10-17 13:19:02 -07001606 }
Brian Osman16adfa32016-10-18 14:42:44 -04001607
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001608 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001609 test_app("viewer") {
1610 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001611 sources = [
1612 "tools/viewer/GMSlide.cpp",
1613 "tools/viewer/ImageSlide.cpp",
1614 "tools/viewer/SKPSlide.cpp",
1615 "tools/viewer/SampleSlide.cpp",
1616 "tools/viewer/Viewer.cpp",
1617 "tools/viewer/sk_app/CommandSet.cpp",
1618 "tools/viewer/sk_app/GLWindowContext.cpp",
1619 "tools/viewer/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001620 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001621 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001622
Jim Van Verth4e56a912016-10-21 10:58:52 -04001623 if (is_android) {
1624 sources += [
1625 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1626 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1627 "tools/viewer/sk_app/android/Window_android.cpp",
1628 "tools/viewer/sk_app/android/main_android.cpp",
1629 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1630 ]
Brian Osman462334e2017-02-09 11:22:57 -05001631 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001632 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001633 sources += [
1634 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1635 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1636 "tools/viewer/sk_app/unix/Window_unix.cpp",
1637 "tools/viewer/sk_app/unix/main_unix.cpp",
1638 ]
1639 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001640 sources += [
1641 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1642 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1643 "tools/viewer/sk_app/win/Window_win.cpp",
1644 "tools/viewer/sk_app/win/main_win.cpp",
1645 ]
Brian Salomon194db172017-08-17 14:37:06 -04001646 if (skia_use_angle) {
1647 sources += [ "tools/viewer/sk_app/win/ANGLEWindowContext_win.cpp" ]
1648 }
Mike Klein43c25262016-10-20 10:17:47 -04001649 } else if (is_mac) {
1650 sources += [
1651 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1652 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1653 "tools/viewer/sk_app/mac/Window_mac.cpp",
1654 "tools/viewer/sk_app/mac/main_mac.cpp",
1655 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001656 } else if (is_ios) {
1657 sources += [
1658 "tools/viewer/sk_app/ios/GLWindowContext_ios.cpp",
1659 "tools/viewer/sk_app/ios/RasterWindowContext_ios.cpp",
1660 "tools/viewer/sk_app/ios/Window_ios.cpp",
1661 "tools/viewer/sk_app/ios/main_ios.cpp",
1662 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001663 }
1664
1665 if (skia_use_vulkan) {
1666 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001667 if (is_android) {
1668 sources +=
1669 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001670 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001671 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1672 libs += [ "X11-xcb" ]
1673 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001674 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1675 }
1676 }
1677
1678 include_dirs = []
1679 deps = [
1680 ":flags",
1681 ":gm",
1682 ":gpu_tool_utils",
1683 ":samples",
1684 ":skia",
1685 ":tool_utils",
1686 ":views",
Brian Osman79086b92017-02-10 13:36:16 -05001687 "//third_party/imgui",
Brian Osman16adfa32016-10-18 14:42:44 -04001688 "//third_party/jsoncpp",
1689 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001690 if (is_android) {
1691 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001692 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04001693 deps += [ "//third_party/libsdl" ]
1694 }
Brian Salomon194db172017-08-17 14:37:06 -04001695 if (skia_use_angle) {
1696 deps += [ "//third_party/angle2" ]
1697 }
Mike Kleina92c3832016-12-08 09:49:39 -05001698 }
Brian Osman16adfa32016-10-18 14:42:44 -04001699 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001700
Jim Van Verthecfed2b2017-08-30 14:02:50 -04001701 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04001702 test_app("SkiaSDLExample") {
1703 sources = [
1704 "example/SkiaSDLExample.cpp",
1705 ]
1706 libs = []
1707 include_dirs = []
1708 deps = [
1709 ":gpu_tool_utils",
1710 ":skia",
1711 "//third_party/libsdl",
1712 ]
1713 }
1714 }
1715
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001716 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
1717 action_foreach("generate_mocs") {
1718 script = "gn/call.py"
1719 sources = [
1720 "tools/mdbviz/MainWindow.h",
1721 ]
1722 outputs = [
1723 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
1724 ]
1725 args = [
1726 "$skia_qt_path" + "/bin/moc",
1727 "{{source}}",
1728 "-o",
1729 "gen/mdbviz/{{source_name_part}}_moc.cpp",
1730 ]
1731 }
1732 action_foreach("generate_resources") {
1733 script = "gn/call.py"
1734 sources = [
1735 "tools/mdbviz/resources.qrc",
1736 ]
1737 outputs = [
1738 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
1739 ]
1740 args = [
1741 "$skia_qt_path" + "/bin/rcc",
1742 "{{source}}",
1743 "-o",
1744 "gen/mdbviz/{{source_name_part}}_res.cpp",
1745 ]
1746 }
1747 test_app("mdbviz") {
1748 if (is_win) {
1749 # on Windows we need to disable some exception handling warnings due to the Qt headers
1750 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
1751 }
1752 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001753 "tools/UrlDataManager.cpp",
1754 "tools/debugger/SkDebugCanvas.cpp",
1755 "tools/debugger/SkDrawCommand.cpp",
1756 "tools/debugger/SkJsonWriteBuffer.cpp",
1757 "tools/debugger/SkObjectParser.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001758 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04001759 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001760 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001761 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001762
1763 # generated files
1764 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
1765 "$target_gen_dir/mdbviz/resources_res.cpp",
1766 ]
1767 lib_dirs = [ "$skia_qt_path/lib" ]
1768 libs = [
1769 "Qt5Core.lib",
1770 "Qt5Gui.lib",
1771 "Qt5Widgets.lib",
1772 ]
1773 include_dirs = [
1774 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04001775 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001776 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001777 "tools",
1778 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001779 ]
1780 deps = [
1781 ":generate_mocs",
1782 ":generate_resources",
1783 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001784 "//third_party/jsoncpp",
1785 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001786 ]
1787 }
1788 }
1789
Mike Kleine459afd2017-03-03 09:21:30 -05001790 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05001791 copy("gdbserver") {
1792 sources = [
1793 "$ndk/$ndk_gdbserver",
1794 ]
1795 outputs = [
1796 "$root_out_dir/gdbserver",
1797 ]
1798 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05001799 }
mtklein25c81d42016-07-27 13:55:26 -07001800}
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001801
1802if (skia_jumper_clang != "") {
1803 action("regen_jumper") {
1804 script = "src/jumper/build_stages.py"
1805
1806 inputs = [
1807 "src/jumper/SkJumper_stages.cpp",
Mike Klein9b2f69b2017-09-12 16:40:53 -04001808 "src/jumper/SkJumper_stages_lowp.cpp",
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001809 ]
1810
1811 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it.
1812 outputs = [
1813 "$target_out_dir/" +
1814 rebase_path("src/jumper/SkJumper_generated.S", target_out_dir),
1815 "$target_out_dir/" +
1816 rebase_path("src/jumper/SkJumper_generated_win.S", target_out_dir),
1817 ]
1818
1819 args = [
1820 skia_jumper_clang,
1821 skia_jumper_objdump,
1822 skia_jumper_ccache,
1823 ] + rebase_path(inputs) + rebase_path(outputs)
1824 }
1825}