blob: bf57a64327a9e40d2da973b7f8f87d579fc73662 [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
Brian Osman16adfa32016-10-18 14:42:44 -04001193 test_lib("views") {
1194 public_include_dirs = [ "include/views" ]
1195 sources = [
1196 "src/views/SkEvent.cpp",
1197 "src/views/SkEventSink.cpp",
1198 "src/views/SkOSMenu.cpp",
1199 "src/views/SkTagList.cpp",
1200 "src/views/SkTouchGesture.cpp",
1201 "src/views/SkView.cpp",
1202 "src/views/SkViewPriv.cpp",
1203 ]
1204 libs = []
Brian Osman34755e22016-12-05 09:46:02 -05001205 deps = []
Brian Osman16adfa32016-10-18 14:42:44 -04001206 if (!is_android) {
1207 sources += [ "src/views/SkWindow.cpp" ]
1208 }
Jim Van Verth4e56a912016-10-21 10:58:52 -04001209 if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001210 public_include_dirs += [ "src/views/unix" ]
1211 sources += [
1212 "src/views/unix/SkOSWindow_Unix.cpp",
1213 "src/views/unix/keysym2ucs.c",
1214 ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001215 libs += [
1216 "GL",
1217 "X11",
1218 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001219 } else if (is_mac) {
1220 sources += [
1221 "src/views/mac/SkEventNotifier.mm",
1222 "src/views/mac/SkNSView.mm",
1223 "src/views/mac/SkOSWindow_Mac.mm",
1224 "src/views/mac/SkTextFieldCell.m",
1225 ]
1226 libs += [
1227 "QuartzCore.framework",
1228 "Cocoa.framework",
1229 "Foundation.framework",
1230 ]
1231 } else if (is_win) {
1232 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001233 } else if (is_ios) {
1234 sources += [ "src/views/mac/SkEventNotifier.mm" ]
Brian Osman16adfa32016-10-18 14:42:44 -04001235 }
Brian Osman34755e22016-12-05 09:46:02 -05001236 if (skia_use_angle) {
1237 deps += [ "//third_party/angle2" ]
1238 }
Brian Osman16adfa32016-10-18 14:42:44 -04001239 }
1240
Mike Klein38af9432016-11-11 11:39:44 -05001241 if (skia_use_lua) {
1242 test_lib("lua") {
1243 public_include_dirs = []
1244 sources = [
1245 "src/utils/SkLua.cpp",
1246 "src/utils/SkLuaCanvas.cpp",
1247 ]
1248 deps = [
1249 "//third_party/lua",
1250 ]
1251 }
1252
Mike Kleine6682eb2017-01-05 10:54:57 -05001253 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001254 sources = [
1255 "tools/lua/lua_app.cpp",
1256 ]
1257 deps = [
1258 ":lua",
1259 ":skia",
1260 "//third_party/lua",
1261 ]
Mike Klein38af9432016-11-11 11:39:44 -05001262 }
1263
Mike Kleine6682eb2017-01-05 10:54:57 -05001264 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001265 sources = [
1266 "tools/lua/lua_pictures.cpp",
1267 ]
1268 deps = [
1269 ":flags",
1270 ":lua",
1271 ":skia",
1272 ":tool_utils",
1273 "//third_party/lua",
1274 ]
Mike Klein38af9432016-11-11 11:39:44 -05001275 }
1276 }
1277
Cary Clark8032b982017-07-28 11:04:54 -04001278 test_app("bookmaker") {
1279 sources = [
1280 "tools/bookmaker/bookmaker.cpp",
1281 "tools/bookmaker/fiddleParser.cpp",
1282 "tools/bookmaker/includeParser.cpp",
1283 "tools/bookmaker/includeWriter.cpp",
1284 "tools/bookmaker/mdOut.cpp",
1285 "tools/bookmaker/parserCommon.cpp",
1286 "tools/bookmaker/spellCheck.cpp",
1287 ]
1288 deps = [
1289 ":flags",
1290 ":skia",
1291 ":tool_utils",
1292 ]
1293 }
1294
Mike Klein6e744122016-10-27 12:21:40 -04001295 import("gn/samples.gni")
Brian Osman16adfa32016-10-18 14:42:44 -04001296 test_lib("samples") {
Brian Osman16adfa32016-10-18 14:42:44 -04001297 public_include_dirs = [ "samplecode" ]
Mike Klein6e744122016-10-27 12:21:40 -04001298 include_dirs = [ "experimental" ]
1299 sources = samples_sources + [
Mike Klein6e744122016-10-27 12:21:40 -04001300 "experimental/SkSetPoly3To3.cpp",
1301 "experimental/SkSetPoly3To3_A.cpp",
1302 "experimental/SkSetPoly3To3_D.cpp",
Brian Osmancff94e42017-06-26 13:12:37 -04001303
1304 # Relocating these files here, so that clients don't try to build them while they're
1305 # still in active development. Clang's thread safety analysis gets tripped up by
1306 # conditional locks.
1307 "src/core/SkThreadedBMPDevice.cpp",
1308 "src/core/SkThreadedBMPDevice.h",
Mike Klein6e744122016-10-27 12:21:40 -04001309 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001310 deps = [
1311 ":experimental_svg_model",
csmartdalton8c679092017-03-27 12:32:29 -06001312 ":flags",
Mike Klein6e744122016-10-27 12:21:40 -04001313 ":gm",
Brian Osman16adfa32016-10-18 14:42:44 -04001314 ":tool_utils",
1315 ":views",
1316 ":xml",
1317 ]
Mike Klein38af9432016-11-11 11:39:44 -05001318
1319 if (skia_use_lua) {
1320 sources += [ "samplecode/SampleLua.cpp" ]
1321 deps += [
1322 ":lua",
1323 "//third_party/lua",
1324 ]
1325 }
Brian Osman16adfa32016-10-18 14:42:44 -04001326 }
1327
Mike Kleine6682eb2017-01-05 10:54:57 -05001328 test_app("dm") {
mtklein2b6870c2016-07-28 14:17:33 -07001329 sources = [
1330 "dm/DM.cpp",
1331 "dm/DMJsonWriter.cpp",
1332 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -07001333 ]
1334 include_dirs = [ "tests" ]
1335 deps = [
mtklein046cb562016-09-16 10:23:12 -07001336 ":common_flags",
fmalitaa2b9fdf2016-08-03 19:53:36 -07001337 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001338 ":flags",
1339 ":gm",
1340 ":gpu_tool_utils",
1341 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -07001342 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -07001343 ":tool_utils",
1344 "//third_party/jsoncpp",
1345 "//third_party/libpng",
1346 ]
mtklein2b6870c2016-07-28 14:17:33 -07001347 }
1348
Mike Klein06432b22017-03-21 13:14:33 -04001349 test_app("ok") {
1350 sources = [
1351 "tools/ok.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001352 "tools/ok_dsts.cpp",
Mike Klein154e6da2017-07-26 15:13:47 -04001353 "tools/ok_engines.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001354 "tools/ok_srcs.cpp",
Mike Kleind63442d2017-03-27 14:16:04 -04001355 "tools/ok_test.cpp",
Mike Kleinf5d1a552017-03-25 12:32:22 -04001356 "tools/ok_vias.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001357 ]
1358 deps = [
Mike Klein4f6e2712017-08-11 10:37:35 -04001359 ":bench",
Mike Klein06432b22017-03-21 13:14:33 -04001360 ":gm",
1361 ":skia",
Mike Kleind63442d2017-03-27 14:16:04 -04001362 ":tests",
Mike Klein62669ad2017-05-09 16:03:07 -04001363 ":tool_utils",
Mike Klein06432b22017-03-21 13:14:33 -04001364 ]
1365 }
1366
Mike Kleine6682eb2017-01-05 10:54:57 -05001367 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001368 sources = [
1369 "bench/nanobench.cpp",
1370 ]
1371 deps = [
1372 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001373 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001374 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001375 ":flags",
1376 ":gm",
1377 ":gpu_tool_utils",
1378 ":skia",
1379 ":tool_utils",
1380 "//third_party/jsoncpp",
1381 ]
mtklein2b6870c2016-07-28 14:17:33 -07001382 }
halcanary19a97202016-08-03 15:08:04 -07001383
Ravi Mistry10d36c52017-01-31 09:49:18 -05001384 test_app("skpinfo") {
1385 sources = [
1386 "tools/skpinfo.cpp",
1387 ]
1388 deps = [
1389 ":flags",
1390 ":skia",
1391 ]
1392 }
1393
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001394 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001395 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001396 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001397 "samplecode/SampleApp.cpp",
1398 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001399 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001400 if (is_mac) {
1401 sources += [ "src/views/mac/skia_mac.mm" ]
1402 } else if (is_win) {
1403 sources += [ "src/views/win/skia_win.cpp" ]
1404 } else if (is_linux) {
1405 sources += [ "src/views/unix/skia_unix.cpp" ]
1406 }
mtklein38925aa2016-09-21 10:11:25 -07001407 deps = [
1408 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001409 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001410 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001411 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001412 ":skia",
1413 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001414 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001415 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001416 if (skia_use_angle) {
1417 deps += [ "//third_party/angle2" ]
1418 }
mtklein38925aa2016-09-21 10:11:25 -07001419 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001420 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001421
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001422 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001423 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001424 sources = [
1425 "tools/skpbench/skpbench.cpp",
1426 ]
1427 deps = [
1428 ":flags",
1429 ":gpu_tool_utils",
1430 ":skia",
1431 ":tool_utils",
1432 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001433 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001434 }
1435
Mike Klein7d302882016-11-03 14:06:31 -04001436 # We can't yet build ICU on iOS or Windows.
1437 if (!is_ios && !is_win) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001438 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001439 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001440 "tools/shape/SkShaper_harfbuzz.cpp",
1441 "tools/shape/using_skia_and_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001442 ]
1443 deps = [
1444 ":skia",
1445 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001446 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001447 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001448 }
halcanary19a97202016-08-03 15:08:04 -07001449 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001450 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001451 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001452 "tools/shape/SkShaper_primitive.cpp",
1453 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001454 ]
1455 deps = [
1456 ":skia",
1457 ]
halcanary3eee9d92016-09-10 07:01:53 -07001458 }
mtklein046cb562016-09-16 10:23:12 -07001459
Matt Sarett9f1c4032017-05-17 10:06:32 -04001460 test_app("create_flutter_test_images") {
1461 sources = [
1462 "tools/create_flutter_test_images.cpp",
1463 ]
1464 deps = [
1465 ":skia",
1466 ":tool_utils",
1467 ]
1468 }
1469
Ben Wagner219f3622017-07-17 15:32:25 -04001470 test_app("create_test_font") {
1471 sources = [
1472 "tools/create_test_font.cpp",
1473 ]
1474 deps = [
1475 ":skia",
1476 ]
1477 assert_no_deps = [
1478 # tool_utils requires the output of this app.
1479 ":tool_utils",
1480 ]
1481 }
1482
Mike Kleine6682eb2017-01-05 10:54:57 -05001483 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001484 sources = [
1485 "tools/get_images_from_skps.cpp",
1486 ]
1487 deps = [
1488 ":flags",
1489 ":skia",
1490 "//third_party/jsoncpp",
1491 ]
mtklein046cb562016-09-16 10:23:12 -07001492 }
mtkleinecbc5262016-09-22 11:51:24 -07001493
Mike Kleine6682eb2017-01-05 10:54:57 -05001494 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001495 sources = [
1496 "tools/colorspaceinfo.cpp",
1497 ]
1498 deps = [
1499 ":flags",
1500 ":skia",
1501 ":tool_utils",
1502 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001503 }
1504
Mike Klein7d302882016-11-03 14:06:31 -04001505 if (!is_ios) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001506 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001507 sources = [
1508 "tools/skiaserve/Request.cpp",
1509 "tools/skiaserve/Response.cpp",
1510 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001511 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1512 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1513 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1514 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1515 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1516 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1517 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1518 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1519 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001520 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1521 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001522 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1523 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1524 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1525 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1526 ]
1527 deps = [
1528 ":flags",
1529 ":gpu_tool_utils",
1530 ":skia",
1531 ":tool_utils",
1532 "//third_party/jsoncpp",
1533 "//third_party/libmicrohttpd",
1534 "//third_party/libpng",
1535 ]
Mike Klein7d302882016-11-03 14:06:31 -04001536 }
mtkleinecbc5262016-09-22 11:51:24 -07001537 }
kjlubick14f984b2016-10-03 11:49:45 -07001538
Mike Kleine6682eb2017-01-05 10:54:57 -05001539 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001540 sources = [
1541 "fuzz/FilterFuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001542 "fuzz/FuzzCanvas.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001543 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001544 "fuzz/FuzzGradients.cpp",
1545 "fuzz/FuzzParsePath.cpp",
1546 "fuzz/FuzzPathop.cpp",
1547 "fuzz/FuzzScaleToSides.cpp",
1548 "fuzz/fuzz.cpp",
1549 ]
1550 deps = [
1551 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001552 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001553 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001554 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001555 ]
kjlubick14f984b2016-10-03 11:49:45 -07001556 }
Mike Klein38312422016-10-05 15:41:01 -04001557
Mike Kleine6682eb2017-01-05 10:54:57 -05001558 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001559 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001560 rebase_path("tests/skia_test.cpp"),
1561 rebase_path("tests/Test.cpp"),
1562 ]
caryclark9feb6322016-10-25 08:58:26 -07001563 deps = [
1564 ":flags",
1565 ":gpu_tool_utils",
1566 ":skia",
1567 ":tool_utils",
1568 ]
caryclark9feb6322016-10-25 08:58:26 -07001569 }
1570
Mike Kleine6682eb2017-01-05 10:54:57 -05001571 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001572 sources = [
1573 "tools/DumpRecord.cpp",
1574 "tools/dump_record.cpp",
1575 ]
1576 deps = [
1577 ":flags",
1578 ":skia",
1579 ]
Mike Klein38312422016-10-05 15:41:01 -04001580 }
bungemanfe917272016-10-13 17:36:40 -04001581
Mike Kleine6682eb2017-01-05 10:54:57 -05001582 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001583 sources = [
1584 "tools/skdiff/skdiff.cpp",
1585 "tools/skdiff/skdiff_html.cpp",
1586 "tools/skdiff/skdiff_main.cpp",
1587 "tools/skdiff/skdiff_utils.cpp",
1588 ]
1589 deps = [
1590 ":skia",
1591 ":tool_utils",
1592 ]
bungemanfe917272016-10-13 17:36:40 -04001593 }
halcanarya73d76a2016-10-17 13:19:02 -07001594
Mike Kleine6682eb2017-01-05 10:54:57 -05001595 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001596 sources = [
1597 "tools/skp_parser.cpp",
1598 ]
1599 deps = [
1600 ":skia",
1601 ":tool_utils",
1602 "//third_party/jsoncpp",
1603 ]
halcanarya73d76a2016-10-17 13:19:02 -07001604 }
Brian Osman16adfa32016-10-18 14:42:44 -04001605
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001606 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001607 test_app("viewer") {
1608 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001609 sources = [
1610 "tools/viewer/GMSlide.cpp",
1611 "tools/viewer/ImageSlide.cpp",
1612 "tools/viewer/SKPSlide.cpp",
1613 "tools/viewer/SampleSlide.cpp",
1614 "tools/viewer/Viewer.cpp",
1615 "tools/viewer/sk_app/CommandSet.cpp",
1616 "tools/viewer/sk_app/GLWindowContext.cpp",
1617 "tools/viewer/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001618 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001619 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001620
Jim Van Verth4e56a912016-10-21 10:58:52 -04001621 if (is_android) {
1622 sources += [
1623 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1624 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1625 "tools/viewer/sk_app/android/Window_android.cpp",
1626 "tools/viewer/sk_app/android/main_android.cpp",
1627 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1628 ]
Brian Osman462334e2017-02-09 11:22:57 -05001629 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001630 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001631 sources += [
1632 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1633 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1634 "tools/viewer/sk_app/unix/Window_unix.cpp",
1635 "tools/viewer/sk_app/unix/main_unix.cpp",
1636 ]
1637 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001638 sources += [
1639 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1640 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1641 "tools/viewer/sk_app/win/Window_win.cpp",
1642 "tools/viewer/sk_app/win/main_win.cpp",
1643 ]
Brian Salomon194db172017-08-17 14:37:06 -04001644 if (skia_use_angle) {
1645 sources += [ "tools/viewer/sk_app/win/ANGLEWindowContext_win.cpp" ]
1646 }
Mike Klein43c25262016-10-20 10:17:47 -04001647 } else if (is_mac) {
1648 sources += [
1649 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1650 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1651 "tools/viewer/sk_app/mac/Window_mac.cpp",
1652 "tools/viewer/sk_app/mac/main_mac.cpp",
1653 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001654 } else if (is_ios) {
1655 sources += [
1656 "tools/viewer/sk_app/ios/GLWindowContext_ios.cpp",
1657 "tools/viewer/sk_app/ios/RasterWindowContext_ios.cpp",
1658 "tools/viewer/sk_app/ios/Window_ios.cpp",
1659 "tools/viewer/sk_app/ios/main_ios.cpp",
1660 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001661 }
1662
1663 if (skia_use_vulkan) {
1664 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001665 if (is_android) {
1666 sources +=
1667 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001668 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001669 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1670 libs += [ "X11-xcb" ]
1671 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001672 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1673 }
1674 }
1675
1676 include_dirs = []
1677 deps = [
1678 ":flags",
1679 ":gm",
1680 ":gpu_tool_utils",
1681 ":samples",
1682 ":skia",
1683 ":tool_utils",
1684 ":views",
Brian Osman79086b92017-02-10 13:36:16 -05001685 "//third_party/imgui",
Brian Osman16adfa32016-10-18 14:42:44 -04001686 "//third_party/jsoncpp",
1687 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001688 if (is_android) {
1689 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001690 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04001691 deps += [ "//third_party/libsdl" ]
1692 }
Brian Salomon194db172017-08-17 14:37:06 -04001693 if (skia_use_angle) {
1694 deps += [ "//third_party/angle2" ]
1695 }
Mike Kleina92c3832016-12-08 09:49:39 -05001696 }
Brian Osman16adfa32016-10-18 14:42:44 -04001697 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001698
Jim Van Verthecfed2b2017-08-30 14:02:50 -04001699 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04001700 test_app("SkiaSDLExample") {
1701 sources = [
1702 "example/SkiaSDLExample.cpp",
1703 ]
1704 libs = []
1705 include_dirs = []
1706 deps = [
1707 ":gpu_tool_utils",
1708 ":skia",
1709 "//third_party/libsdl",
1710 ]
1711 }
1712 }
1713
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001714 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
1715 action_foreach("generate_mocs") {
1716 script = "gn/call.py"
1717 sources = [
1718 "tools/mdbviz/MainWindow.h",
1719 ]
1720 outputs = [
1721 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
1722 ]
1723 args = [
1724 "$skia_qt_path" + "/bin/moc",
1725 "{{source}}",
1726 "-o",
1727 "gen/mdbviz/{{source_name_part}}_moc.cpp",
1728 ]
1729 }
1730 action_foreach("generate_resources") {
1731 script = "gn/call.py"
1732 sources = [
1733 "tools/mdbviz/resources.qrc",
1734 ]
1735 outputs = [
1736 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
1737 ]
1738 args = [
1739 "$skia_qt_path" + "/bin/rcc",
1740 "{{source}}",
1741 "-o",
1742 "gen/mdbviz/{{source_name_part}}_res.cpp",
1743 ]
1744 }
1745 test_app("mdbviz") {
1746 if (is_win) {
1747 # on Windows we need to disable some exception handling warnings due to the Qt headers
1748 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
1749 }
1750 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001751 "tools/UrlDataManager.cpp",
1752 "tools/debugger/SkDebugCanvas.cpp",
1753 "tools/debugger/SkDrawCommand.cpp",
1754 "tools/debugger/SkJsonWriteBuffer.cpp",
1755 "tools/debugger/SkObjectParser.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001756 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04001757 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001758 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001759 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001760
1761 # generated files
1762 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
1763 "$target_gen_dir/mdbviz/resources_res.cpp",
1764 ]
1765 lib_dirs = [ "$skia_qt_path/lib" ]
1766 libs = [
1767 "Qt5Core.lib",
1768 "Qt5Gui.lib",
1769 "Qt5Widgets.lib",
1770 ]
1771 include_dirs = [
1772 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04001773 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001774 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001775 "tools",
1776 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001777 ]
1778 deps = [
1779 ":generate_mocs",
1780 ":generate_resources",
1781 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001782 "//third_party/jsoncpp",
1783 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001784 ]
1785 }
1786 }
1787
Mike Kleine459afd2017-03-03 09:21:30 -05001788 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05001789 copy("gdbserver") {
1790 sources = [
1791 "$ndk/$ndk_gdbserver",
1792 ]
1793 outputs = [
1794 "$root_out_dir/gdbserver",
1795 ]
1796 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05001797 }
mtklein25c81d42016-07-27 13:55:26 -07001798}
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001799
1800if (skia_jumper_clang != "") {
1801 action("regen_jumper") {
1802 script = "src/jumper/build_stages.py"
1803
1804 inputs = [
1805 "src/jumper/SkJumper_stages.cpp",
Mike Klein9b2f69b2017-09-12 16:40:53 -04001806 "src/jumper/SkJumper_stages_lowp.cpp",
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001807 ]
1808
1809 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it.
1810 outputs = [
1811 "$target_out_dir/" +
1812 rebase_path("src/jumper/SkJumper_generated.S", target_out_dir),
1813 "$target_out_dir/" +
1814 rebase_path("src/jumper/SkJumper_generated_win.S", target_out_dir),
1815 ]
1816
1817 args = [
1818 skia_jumper_clang,
1819 skia_jumper_objdump,
1820 skia_jumper_ccache,
1821 ] + rebase_path(inputs) + rebase_path(outputs)
1822 }
1823}