blob: 1c328b04524bb74db504defa60dec9392c36b47b [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
Mike Kleinc55a6cb2017-06-28 13:21:47 -040048
49 skia_jumper_clang = ""
50 skia_jumper_objdump = ""
51 skia_jumper_ccache = ""
mtkleinc04ff472016-06-23 10:29:30 -070052}
Brian Salomon23d73ea2016-10-27 13:31:37 -040053declare_args() {
Matt Sarett189491c2017-03-20 18:09:30 -040054 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040055 skia_use_sfntly = skia_use_icu
56
Mike Klein4d598a32016-10-31 13:44:49 -040057 if (is_android) {
58 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
Forrest Reiling30229ac2017-04-17 13:36:39 -070059 } else if (is_fuchsia) {
60 skia_use_vulkan = fuchsia_use_vulkan
Mike Klein4d598a32016-10-31 13:44:49 -040061 } else {
62 skia_use_vulkan = skia_vulkan_sdk != ""
63 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040064}
Greg Danielec6ae522017-04-25 13:38:26 -040065declare_args() {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000066 skia_vulkan_headers = ""
Greg Danielec6ae522017-04-25 13:38:26 -040067 if (skia_use_vulkan) {
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000068 # 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 -040069 if (is_fuchsia) {
70 skia_vulkan_headers = "$fuchsia_vulkan_sdk/include"
71 } else if (is_linux || is_win) {
72 skia_vulkan_headers = "$skia_vulkan_sdk/include"
Greg Danielec6ae522017-04-25 13:38:26 -040073 }
Greg Danielec6ae522017-04-25 13:38:26 -040074 }
75}
Brian Salomon789e25e2016-09-30 13:41:03 -040076
mtklein38925aa2016-09-21 10:11:25 -070077# Our tools require static linking (they use non-exported symbols).
78skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070079
mtkleina45be612016-08-29 15:22:10 -070080fontmgr_android_enabled = skia_use_expat && skia_use_freetype
81
mtklein1211e0c2016-07-26 13:55:45 -070082skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070083 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070084 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070085 "include/codec",
86 "include/config",
87 "include/core",
88 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -040089 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -070090 "include/gpu",
91 "include/gpu/gl",
mtklein1211e0c2016-07-26 13:55:45 -070092 "include/pathops",
93 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070094 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070095 "include/utils",
96 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -070097]
98
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +000099if (skia_use_vulkan) {
100 skia_public_includes += [ "include/gpu/vk" ]
101}
Greg Daniele5ddff52017-07-05 16:49:36 -0400102if (skia_use_metal) {
103 skia_public_includes += [ "include/gpu/mtl" ]
104}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000105
mtkleinc04ff472016-06-23 10:29:30 -0700106# Skia public API, generally provided by :skia.
107config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700108 include_dirs = skia_public_includes
Greg Danielec6ae522017-04-25 13:38:26 -0400109 if (skia_vulkan_headers != "") {
110 include_dirs += [ skia_vulkan_headers ]
111 }
Mike Kleinae7e6712016-10-11 17:49:33 -0400112 defines = []
113 if (is_component_build) {
114 defines += [ "SKIA_DLL" ]
115 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400116 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700117 defines += [ "SK_SAMPLES_FOR_X" ]
118 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400119 if (skia_enable_flutter_defines) {
120 defines += flutter_defines
121 }
mtklein06c35c02016-09-20 12:28:12 -0700122 if (!skia_enable_gpu) {
123 defines += [ "SK_SUPPORT_GPU=0" ]
124 }
mtkleinc04ff472016-06-23 10:29:30 -0700125}
126
127# Skia internal APIs, used by Skia itself and a few test tools.
128config("skia_private") {
129 visibility = [ ":*" ]
130
131 include_dirs = [
132 "include/private",
133 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700134 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700135 "src/core",
136 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700137 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700138 "src/image",
139 "src/images",
140 "src/lazy",
141 "src/opts",
142 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700143 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700144 "src/ports",
145 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400146 "src/shaders",
147 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700148 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700149 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700150 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500151 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700152 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700153 ]
mtklein150d1132016-08-01 06:56:40 -0700154
Mike Reeda9e241d2017-05-03 10:52:00 -0400155 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700156 if (is_android) {
157 defines += [
158 "SK_GAMMA_EXPONENT=1.4",
159 "SK_GAMMA_CONTRAST=0.0",
160 ]
161 }
mtklein88a7ac02016-09-14 11:16:49 -0700162 if (is_official_build || is_android) {
163 # TODO(bsalomon): it'd be nice to make Android normal.
164 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
165 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400166 libs = []
167 lib_dirs = []
168 if (skia_use_vulkan) {
Michael Jurkada3e5962017-04-14 17:44:09 -0700169 if (skia_vulkan_sdk != "" && !is_android && !is_fuchsia) {
Mike Klein487bfc22016-10-14 14:04:56 -0400170 if (is_win) {
Brian Salomon3b5bf352017-03-20 15:54:41 -0400171 lib_dirs += [
172 "$skia_vulkan_sdk/Bin",
173 "$skia_vulkan_sdk/Lib",
174 ]
Mike Klein487bfc22016-10-14 14:04:56 -0400175 } else {
Greg Daniel686bb212016-10-27 10:48:48 -0400176 lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
Mike Klein487bfc22016-10-14 14:04:56 -0400177 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400178 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400179 }
Brian Salomon03e05842017-02-23 12:23:47 -0500180 if (skia_enable_gpu) {
181 include_dirs += [ "src/gpu" ]
182 }
Brian Osman34755e22016-12-05 09:46:02 -0500183 if (skia_use_angle) {
184 defines += [ "SK_ANGLE" ]
185 }
Brian Osman3f375d02016-12-28 11:19:22 -0500186 if (skia_enable_discrete_gpu) {
187 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
188 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400189 if (!is_official_build) {
190 defines += [ "GR_TEST_UTILS=1" ]
191 }
mtkleinc04ff472016-06-23 10:29:30 -0700192}
193
194# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
195config("skia_library") {
196 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700197 defines = [ "SKIA_IMPLEMENTATION=1" ]
198}
199
200skia_library_configs = [
201 ":skia_public",
202 ":skia_private",
203 ":skia_library",
204]
205
mtklein9b8583d2016-08-24 17:32:30 -0700206# Use for CPU-specific Skia code that needs particular compiler flags.
207template("opts") {
208 if (invoker.enabled) {
209 source_set(target_name) {
210 forward_variables_from(invoker, "*")
211 configs += skia_library_configs
212 }
213 } else {
214 # If not enabled, a phony empty target that swallows all otherwise unused variables.
215 source_set(target_name) {
216 forward_variables_from(invoker,
217 "*",
218 [
219 "sources",
220 "cflags",
221 ])
222 }
223 }
anmittala7eaf2e2016-08-17 13:57:26 -0700224}
225
mtklein422310d2016-08-16 18:28:43 -0700226is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700227
mtklein7d6fb2c2016-08-25 14:50:44 -0700228opts("none") {
229 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700230 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700231 cflags = []
232}
233
mtklein7d6fb2c2016-08-25 14:50:44 -0700234opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700235 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700236 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700237 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700238}
239
240opts("arm64") {
241 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700242 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700243 cflags = []
244}
245
246opts("crc32") {
247 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700248 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700249 cflags = [ "-march=armv8-a+crc" ]
250}
251
mtklein9b8583d2016-08-24 17:32:30 -0700252opts("sse2") {
253 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700254 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400255 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400256 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
257 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400258 cflags = [ "-msse2" ]
259 }
mtklein9b8583d2016-08-24 17:32:30 -0700260}
mtkleinc04ff472016-06-23 10:29:30 -0700261
mtklein9b8583d2016-08-24 17:32:30 -0700262opts("ssse3") {
263 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700264 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400265 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400266 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
267 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400268 cflags = [ "-mssse3" ]
269 }
mtklein9b8583d2016-08-24 17:32:30 -0700270}
mtkleinc04ff472016-06-23 10:29:30 -0700271
mtklein9b8583d2016-08-24 17:32:30 -0700272opts("sse41") {
273 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700274 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400275 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400276 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
277 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400278 cflags = [ "-msse4.1" ]
279 }
mtklein9b8583d2016-08-24 17:32:30 -0700280}
mtklein4e976072016-08-08 09:06:27 -0700281
mtklein9b8583d2016-08-24 17:32:30 -0700282opts("sse42") {
283 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700284 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400285 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400286 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
287 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400288 cflags = [ "-msse4.2" ]
289 }
mtklein9b8583d2016-08-24 17:32:30 -0700290}
291
292opts("avx") {
293 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700294 sources = skia_opts.avx_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400295 if (!is_clang && is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000296 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400297 } else {
298 cflags = [ "-mavx" ]
299 }
mtkleinc04ff472016-06-23 10:29:30 -0700300}
301
mtkleinc095df52016-08-24 12:23:52 -0700302# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700303template("optional") {
304 if (invoker.enabled) {
305 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700306 if (defined(invoker.public_defines)) {
307 defines = invoker.public_defines
308 }
mtklein457b42a2016-08-23 13:56:37 -0700309 }
310 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700311 forward_variables_from(invoker,
312 "*",
313 [
314 "public_defines",
315 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700316 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700317 ])
mtklein457b42a2016-08-23 13:56:37 -0700318 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700319 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700320 if (defined(invoker.configs_to_remove)) {
321 configs -= invoker.configs_to_remove
322 }
mtklein457b42a2016-08-23 13:56:37 -0700323 }
324 } else {
mtklein457b42a2016-08-23 13:56:37 -0700325 source_set(target_name) {
326 forward_variables_from(invoker,
327 "*",
328 [
329 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700330 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700331 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700332 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700333 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700334 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700335 ])
mtkleincd01b032016-08-31 04:58:19 -0700336 if (defined(invoker.sources_when_disabled)) {
337 sources = invoker.sources_when_disabled
338 }
339 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700340 }
mtkleineb3c4252016-08-23 07:38:09 -0700341 }
mtklein457b42a2016-08-23 13:56:37 -0700342}
mtklein457b42a2016-08-23 13:56:37 -0700343
Mike Kleina04bb452017-02-09 12:24:07 -0500344optional("effects") {
345 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400346 deps = [
347 ":compile_processors",
348 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500349 sources =
350 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
351 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
352}
353
mtkleina45be612016-08-29 15:22:10 -0700354optional("fontmgr_android") {
355 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700356
357 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500358 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700359 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700360 ]
361 sources = [
362 "src/ports/SkFontMgr_android.cpp",
363 "src/ports/SkFontMgr_android_factory.cpp",
364 "src/ports/SkFontMgr_android_parser.cpp",
365 ]
366}
367
mtkleind2e39db2016-09-07 07:52:55 -0700368optional("fontmgr_custom") {
369 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
370
371 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500372 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700373 ]
374 sources = [
375 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500376 "src/ports/SkFontMgr_custom.h",
377 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700378 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500379 "src/ports/SkFontMgr_custom_embedded.cpp",
380 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700381 ]
382}
383
mtklein3cc22182016-08-29 13:26:14 -0700384optional("fontmgr_fontconfig") {
385 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700386
387 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500388 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700389 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700390 ]
391 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700392 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700393 "src/ports/SkFontConfigInterface_direct.cpp",
394 "src/ports/SkFontConfigInterface_direct_factory.cpp",
395 "src/ports/SkFontMgr_FontConfigInterface.cpp",
396 "src/ports/SkFontMgr_fontconfig.cpp",
397 "src/ports/SkFontMgr_fontconfig_factory.cpp",
398 ]
399}
400
mtkleincdedd0e2016-09-12 15:15:44 -0700401optional("fontmgr_fuchsia") {
402 enabled = is_fuchsia && skia_use_freetype
403
404 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500405 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700406 ]
407 sources = [
408 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500409 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700410 "src/ports/SkFontMgr_custom_empty_factory.cpp",
411 ]
412}
413
Ethan Nicholas762466e2017-06-29 10:03:38 -0400414if (skia_compile_processors) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400415 executable("sksllex") {
416 sources = [
417 "src/sksl/lex/Main.cpp",
418 "src/sksl/lex/NFA.cpp",
419 "src/sksl/lex/RegexNode.cpp",
420 "src/sksl/lex/RegexParser.cpp",
421 ]
422 include_dirs = [ "src/sksl/lex" ]
423 }
424
Ethan Nicholas762466e2017-06-29 10:03:38 -0400425 executable("skslc") {
426 defines = [ "SKSL_STANDALONE" ]
427 sources = [
428 "src/sksl/SkSLMain.cpp",
429 ]
430 sources += skia_sksl_sources
431 include_dirs = [
432 "src/gpu",
433 "src/sksl",
434 ]
435 deps = [
436 "//third_party/spirv-tools",
437 ]
438 }
439
440 skia_gpu_processor_outputs = []
441 foreach(src, skia_gpu_processor_sources) {
442 dir = get_path_info(src, "dir")
443 name = get_path_info(src, "name")
444
445 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
446 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
447 skia_gpu_processor_outputs += [
448 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
449 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
450 # confused due to the same file being named by two different paths
451 ]
452 }
453
454 action("compile_processors") {
455 script = "gn/compile_processors.py"
456 deps = [
457 ":skslc(//gn/toolchain:$host_toolchain)",
458 ]
459 sources = skia_gpu_processor_sources
460 outputs = skia_gpu_processor_outputs
461 skslc_path = "$root_out_dir/"
462 if (host_toolchain != default_toolchain_name) {
463 skslc_path += "$host_toolchain/"
464 }
465 skslc_path += "skslc"
466 if (host_os == "win") {
467 skslc_path += ".exe"
468 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400469 args = [
470 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400471 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400472 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400473 args += rebase_path(skia_gpu_processor_sources)
474 }
475} else {
476 skia_gpu_processor_outputs = []
477 group("compile_processors") {
478 }
479}
480
mtklein06c35c02016-09-20 12:28:12 -0700481optional("gpu") {
482 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400483 deps = [
484 ":compile_processors",
485 ]
mtkleine9fb3d52016-09-20 15:11:46 -0700486 public_defines = []
487
Mike Klein29b3e582017-02-09 11:57:32 -0500488 sources = skia_gpu_sources + skia_sksl_sources +
Ethan Nicholas762466e2017-06-29 10:03:38 -0400489 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] +
490 skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700491
492 # These paths need to be absolute to match the ones produced by shared_sources.gni.
493 sources -= get_path_info([
494 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
495 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
496 ],
497 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400498 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700499 if (is_android) {
500 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400501
502 # this lib is required to link against AHardwareBuffer
503 if (defined(ndk_api) && ndk_api >= 26) {
504 libs += [ "android" ]
505 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400506 } else if (skia_use_egl) {
507 sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
508 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700509 } else if (is_linux) {
510 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500511 libs += [
512 "GL",
513 "GLU",
514 ]
mtklein06c35c02016-09-20 12:28:12 -0700515 } else if (is_mac) {
516 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800517 } else if (is_ios) {
518 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400519 } else if (is_win) {
520 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
521 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700522 } else {
523 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
524 }
mtkleine9fb3d52016-09-20 15:11:46 -0700525
526 if (skia_use_vulkan) {
527 public_defines += [ "SK_VULKAN" ]
528 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700529 if (skia_enable_vulkan_debug_layers) {
530 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
531 }
mtkleine9fb3d52016-09-20 15:11:46 -0700532 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400533 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400534 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400535 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
536 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400537
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400538 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400539 if (skia_use_metal) {
540 public_defines += [ "SK_METAL" ]
541 sources += skia_metal_sources
542 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400543 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400544 }
mtklein06c35c02016-09-20 12:28:12 -0700545}
546
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400547optional("heif") {
548 enabled = skia_use_libheif
549 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
550
551 deps = []
552
553 sources = [
554 "src/codec/SkHeifCodec.cpp",
555 ]
556}
557
mtklein63213812016-08-24 09:55:56 -0700558optional("jpeg") {
559 enabled = skia_use_libjpeg_turbo
560 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
561
mtklein63213812016-08-24 09:55:56 -0700562 deps = [
563 "//third_party/libjpeg-turbo:libjpeg",
564 ]
565 sources = [
566 "src/codec/SkJpegCodec.cpp",
567 "src/codec/SkJpegDecoderMgr.cpp",
568 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700569 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400570 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700571 ]
572}
573
574optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500575 enabled = skia_use_zlib && skia_enable_pdf
576 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700577
mtklein63213812016-08-24 09:55:56 -0700578 deps = [
579 "//third_party/zlib",
580 ]
brettwb9447282016-09-01 14:24:39 -0700581 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700582 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700583
584 if (skia_use_sfntly) {
585 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500586 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700587 }
588}
589
590optional("png") {
591 enabled = skia_use_libpng
592 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
593
mtklein63213812016-08-24 09:55:56 -0700594 deps = [
595 "//third_party/libpng",
596 ]
597 sources = [
598 "src/codec/SkIcoCodec.cpp",
599 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400600 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700601 ]
602}
603
scroggof84ad642016-10-31 09:02:57 -0700604optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400605 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700606 public_defines = [ "SK_CODEC_DECODES_RAW" ]
607
608 deps = [
609 "//third_party/dng_sdk",
610 "//third_party/libjpeg-turbo:libjpeg",
611 "//third_party/piex",
612 ]
613
614 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
615 # Skia.
616 configs_to_remove = [ "//gn:no_exceptions" ]
617
618 sources = [
619 "src/codec/SkRawAdapterCodec.cpp",
620 "src/codec/SkRawCodec.cpp",
621 ]
622}
623
mtklein3cc22182016-08-29 13:26:14 -0700624optional("typeface_freetype") {
625 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700626
627 deps = [
628 "//third_party/freetype2",
629 ]
630 sources = [
631 "src/ports/SkFontHost_FreeType.cpp",
632 "src/ports/SkFontHost_FreeType_common.cpp",
633 ]
634}
635
mtklein457b42a2016-08-23 13:56:37 -0700636optional("webp") {
637 enabled = skia_use_libwebp
638 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
639
mtklein457b42a2016-08-23 13:56:37 -0700640 deps = [
641 "//third_party/libwebp",
642 ]
643 sources = [
644 "src/codec/SkWebpAdapterCodec.cpp",
645 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400646 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700647 ]
mtkleineb3c4252016-08-23 07:38:09 -0700648}
649
mtklein63213812016-08-24 09:55:56 -0700650optional("xml") {
651 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000652 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700653
mtklein63213812016-08-24 09:55:56 -0700654 deps = [
655 "//third_party/expat",
656 ]
657 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500658 "src/svg/SkSVGCanvas.cpp",
659 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700660 "src/xml/SkDOM.cpp",
661 "src/xml/SkXMLParser.cpp",
662 "src/xml/SkXMLWriter.cpp",
663 ]
664}
665
mtkleinc04ff472016-06-23 10:29:30 -0700666component("skia") {
667 public_configs = [ ":skia_public" ]
668 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700669
670 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700671 ":arm64",
672 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700673 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700674 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500675 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700676 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700677 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700678 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700679 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700680 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400681 ":heif",
mtklein63213812016-08-24 09:55:56 -0700682 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700683 ":none",
mtklein63213812016-08-24 09:55:56 -0700684 ":pdf",
685 ":png",
scroggof84ad642016-10-31 09:02:57 -0700686 ":raw",
mtklein9b8583d2016-08-24 17:32:30 -0700687 ":sse2",
688 ":sse41",
689 ":sse42",
690 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700691 ":webp",
mtklein63213812016-08-24 09:55:56 -0700692 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700693 ]
694
Chinmay Garde43f115c2016-11-16 15:04:12 -0800695 # This file (and all GN files in Skia) are designed to work with an
696 # empty sources assignment filter; we handle all that explicitly.
697 # We clear the filter here for clients who may have set up a global filter.
698 set_sources_assignment_filter([])
699
mtkleinc04ff472016-06-23 10:29:30 -0700700 sources = []
brettwb9447282016-09-01 14:24:39 -0700701 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700702 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500703 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700704 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400705 "src/android/SkAndroidFrameworkUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700706 "src/android/SkBitmapRegionCodec.cpp",
707 "src/android/SkBitmapRegionDecoder.cpp",
708 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400709 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700710 "src/codec/SkBmpCodec.cpp",
711 "src/codec/SkBmpMaskCodec.cpp",
712 "src/codec/SkBmpRLECodec.cpp",
713 "src/codec/SkBmpStandardCodec.cpp",
714 "src/codec/SkCodec.cpp",
715 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700716 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700717 "src/codec/SkMaskSwizzler.cpp",
718 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700719 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700720 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700721 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700722 "src/codec/SkSwizzler.cpp",
723 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700724 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700725 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700726 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700727 "src/ports/SkMemory_malloc.cpp",
728 "src/ports/SkOSFile_stdio.cpp",
729 "src/sfnt/SkOTTable_name.cpp",
730 "src/sfnt/SkOTUtils.cpp",
731 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700732 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700733 ]
brettwb9447282016-09-01 14:24:39 -0700734
mtklein7d6fb2c2016-08-25 14:50:44 -0700735 libs = []
736
mtkleinc04ff472016-06-23 10:29:30 -0700737 if (is_win) {
738 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400739 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700740 "src/ports/SkDebug_win.cpp",
741 "src/ports/SkFontHost_win.cpp",
742 "src/ports/SkFontMgr_win_dw.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700743 "src/ports/SkImageEncoder_WIC.cpp",
744 "src/ports/SkImageGeneratorWIC.cpp",
745 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700746 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700747 "src/ports/SkScalerContext_win_dw.cpp",
748 "src/ports/SkTLS_win.cpp",
749 "src/ports/SkTypeface_win_dw.cpp",
750 ]
Mike Klein69f6ed42016-10-13 15:45:07 -0400751 if (skia_use_gdi) {
752 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
753 libs += [
754 "Gdi32.lib",
755 "Usp10.lib",
756 ]
757 } else {
758 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
759 }
mtkleinb9be9792016-09-16 14:44:18 -0700760 sources -=
761 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400762 libs += [
763 "FontSub.lib",
764 "Ole32.lib",
765 "OleAut32.lib",
766 "User32.lib",
767 ]
mtkleinc04ff472016-06-23 10:29:30 -0700768 } else {
769 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700770 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700771 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700772 "src/ports/SkTLS_pthread.cpp",
773 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400774 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700775 }
776
mtklein7d6fb2c2016-08-25 14:50:44 -0700777 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500778 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500779 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500780 deps += [ "//third_party/cpu-features" ]
781 }
mtklein06c35c02016-09-20 12:28:12 -0700782 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700783 libs += [
784 "EGL",
785 "GLESv2",
786 "log",
787 ]
788 }
789
mtkleinc04ff472016-06-23 10:29:30 -0700790 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700791 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700792 }
793
794 if (is_mac) {
795 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700796 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700797 "src/ports/SkFontHost_mac.cpp",
798 "src/ports/SkImageEncoder_CG.cpp",
799 "src/ports/SkImageGeneratorCG.cpp",
800 ]
mtklein09e61f72016-08-23 13:35:28 -0700801 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400802 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
803 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700804 "ApplicationServices.framework",
805 "OpenGL.framework",
806 ]
mtkleinc04ff472016-06-23 10:29:30 -0700807 }
abarth6fc8ff02016-07-15 15:15:15 -0700808
Mike Klein7d302882016-11-03 14:06:31 -0400809 if (is_ios) {
810 sources += [
811 "src/ports/SkDebug_stdio.cpp",
812 "src/ports/SkFontHost_mac.cpp",
813 "src/ports/SkImageEncoder_CG.cpp",
814 "src/ports/SkImageGeneratorCG.cpp",
815 ]
816 libs += [
817 "CoreFoundation.framework",
818 "CoreGraphics.framework",
819 "CoreText.framework",
820 "ImageIO.framework",
821 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400822
823 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
824 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400825 ]
826 }
827
abarth6fc8ff02016-07-15 15:15:15 -0700828 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700829 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700830 }
mtkleinc04ff472016-06-23 10:29:30 -0700831}
832
mtkleinc095df52016-08-24 12:23:52 -0700833# Targets guarded by skia_enable_tools may use //third_party freely.
834if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -0500835 # Used by gn_to_bp.py to list our public include dirs.
836 source_set("public") {
837 configs += [ ":skia_public" ]
838 }
839
Mike Kleinc36dedf2016-11-18 09:35:28 -0500840 config("skia.h_config") {
841 include_dirs = [ "$target_gen_dir" ]
842 }
843 action("skia.h") {
844 public_configs = [ ":skia.h_config" ]
845 skia_h = "$target_gen_dir/skia.h"
846 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -0400847 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000848 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -0500849 depfile = "$skia_h.deps"
850 outputs = [
851 skia_h,
852 ]
853 }
854
855 if (skia_enable_gpu && target_cpu == "x64") {
856 # Our bots only have 64-bit libOSMesa installed.
857 # TODO: worth fixing?
858 executable("fiddle") {
859 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -0500860 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -0500861 "tools/fiddle/draw.cpp",
862 "tools/fiddle/fiddle_main.cpp",
863 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -0400864
865 if (skia_use_egl) {
866 sources += [ "tools/fiddle/egl_context.cpp" ]
867 } else if (skia_use_mesa) {
868 sources += [ "tools/fiddle/mesa_context.cpp" ]
869 if (is_linux) {
870 libs += [ "OSMesa" ]
871 }
872 } else {
873 sources += [ "tools/fiddle/null_context.cpp" ]
874 }
Joe Gregorio1e735c02017-04-19 14:05:14 -0400875 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -0500876 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -0400877 ":flags",
Mike Kleinc36dedf2016-11-18 09:35:28 -0500878 ":skia",
879 ":skia.h",
880 ]
881 }
882 }
883
884 if (skia_enable_gpu) {
885 source_set("public_headers_warnings_check") {
886 sources = [
887 "tools/public_headers_warnings_check.cpp",
888 ]
889 configs -= [ "//gn:warnings_except_public_headers" ]
890 deps = [
891 ":skia",
892 ":skia.h",
893 ]
894 }
895 }
896
mtkleinc095df52016-08-24 12:23:52 -0700897 template("test_lib") {
898 config(target_name + "_config") {
899 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700900 if (defined(invoker.public_defines)) {
901 defines = invoker.public_defines
902 }
mtklein25c81d42016-07-27 13:55:26 -0700903 }
mtkleinc095df52016-08-24 12:23:52 -0700904 source_set(target_name) {
905 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
906 public_configs = [
907 ":" + target_name + "_config",
908 ":skia_private",
909 ]
910
911 if (!defined(deps)) {
912 deps = []
913 }
914 deps += [ ":skia" ]
915 testonly = true
916 }
mtklein25c81d42016-07-27 13:55:26 -0700917 }
mtklein25c81d42016-07-27 13:55:26 -0700918
Mike Kleine6682eb2017-01-05 10:54:57 -0500919 template("test_app") {
920 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
921 shared_library("lib" + target_name) {
922 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400923 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500924 testonly = true
925 }
926 } else {
Mike Klein7d921032017-01-05 12:20:41 -0500927 _executable = target_name
928 executable(_executable) {
Mike Kleine6682eb2017-01-05 10:54:57 -0500929 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400930 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500931 testonly = true
932 }
933 }
Mike Klein7d921032017-01-05 12:20:41 -0500934 if (is_android && skia_android_serial != "" && defined(_executable)) {
935 action("push_" + target_name) {
936 script = "gn/push_to_android.py"
937 deps = [
938 ":" + _executable,
939 ]
940 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
941 outputs = [
942 _stamp,
943 ]
944 args = [
945 rebase_path("$root_build_dir/$_executable"),
946 skia_android_serial,
947 rebase_path(_stamp),
948 ]
949 testonly = true
950 }
951 }
Mike Kleine6682eb2017-01-05 10:54:57 -0500952 }
953
mtkleinc095df52016-08-24 12:23:52 -0700954 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700955 public_include_dirs = []
956 if (skia_enable_gpu) {
957 public_defines = []
958 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700959
960 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700961 sources = [
962 "tools/gpu/GrContextFactory.cpp",
963 "tools/gpu/GrTest.cpp",
964 "tools/gpu/TestContext.cpp",
965 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -0700966 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -0700967 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
968 "tools/gpu/gl/debug/GrBufferObj.cpp",
969 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
970 "tools/gpu/gl/debug/GrProgramObj.cpp",
971 "tools/gpu/gl/debug/GrShaderObj.cpp",
972 "tools/gpu/gl/debug/GrTextureObj.cpp",
973 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
974 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -0400975 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -0700976 ]
977 libs = []
mtklein25c81d42016-07-27 13:55:26 -0700978
Kevin Lubick4a24e102017-03-29 11:19:01 -0400979 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -0700980 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -0400981 } else if (is_ios) {
982 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
983 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -0700984 } else if (is_linux) {
985 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500986 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -0700987 } else if (is_mac) {
988 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400989 } else if (is_win) {
990 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
991 libs += [
992 "Gdi32.lib",
993 "OpenGL32.lib",
994 ]
mtklein38925aa2016-09-21 10:11:25 -0700995 }
mtklein6ef69992016-09-14 06:12:09 -0700996
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400997 cflags_objcc = [ "-fobjc-arc" ]
998
Mike Kleinc168a3a2016-11-14 14:53:13 +0000999 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001000 deps += [ "//third_party/angle2" ]
1001 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1002 }
mtklein38925aa2016-09-21 10:11:25 -07001003 if (skia_use_mesa) {
1004 public_defines += [ "SK_MESA" ]
1005 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
1006 libs += [ "OSMesa" ]
1007 }
mtkleind68f9b02016-09-23 13:18:41 -07001008 if (skia_use_vulkan) {
1009 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Brian Salomon5db010b2017-04-25 16:05:29 -04001010 if (is_win) {
1011 libs += [ "vulkan-1.lib" ]
1012 } else {
1013 libs += [ "vulkan" ]
1014 }
mtkleind68f9b02016-09-23 13:18:41 -07001015 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001016 if (skia_use_metal) {
1017 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1018 }
mtkleina627b5c2016-09-20 13:36:47 -07001019 }
mtklein25c81d42016-07-27 13:55:26 -07001020 }
mtklein25c81d42016-07-27 13:55:26 -07001021
mtkleinc095df52016-08-24 12:23:52 -07001022 test_lib("flags") {
1023 public_include_dirs = [ "tools/flags" ]
1024 sources = [
1025 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001026 ]
1027 }
1028 test_lib("common_flags") {
1029 public_include_dirs = [ "tools/flags" ]
1030 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001031 "tools/flags/SkCommonFlags.cpp",
1032 "tools/flags/SkCommonFlagsConfig.cpp",
1033 ]
1034 deps = [
mtklein046cb562016-09-16 10:23:12 -07001035 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001036 ":gpu_tool_utils",
1037 ]
1038 }
mtklein25c81d42016-07-27 13:55:26 -07001039
mtkleinc095df52016-08-24 12:23:52 -07001040 test_lib("tool_utils") {
1041 public_include_dirs = [
1042 "tools",
1043 "tools/debugger",
1044 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001045 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001046 ]
1047 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001048 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001049 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001050 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001051 "tools/ProcStats.cpp",
1052 "tools/Resources.cpp",
1053 "tools/ThermalManager.cpp",
1054 "tools/UrlDataManager.cpp",
1055 "tools/debugger/SkDebugCanvas.cpp",
1056 "tools/debugger/SkDrawCommand.cpp",
1057 "tools/debugger/SkJsonWriteBuffer.cpp",
1058 "tools/debugger/SkObjectParser.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001059 "tools/picture_utils.cpp",
1060 "tools/random_parse_path.cpp",
1061 "tools/sk_tool_utils.cpp",
1062 "tools/sk_tool_utils_font.cpp",
1063 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001064 "tools/trace/SkChromeTracingTracer.cpp",
1065 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001066 "tools/trace/SkDebugfTracer.cpp",
1067 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001068 "tools/trace/SkEventTracingPriv.cpp",
1069 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001070 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001071 libs = []
1072 if (is_ios) {
1073 sources += [ "tools/ios_utils.m" ]
1074 libs += [ "Foundation.framework" ]
1075 }
mtkleinc095df52016-08-24 12:23:52 -07001076 deps = [
mtklein046cb562016-09-16 10:23:12 -07001077 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001078 ":flags",
1079 "//third_party/libpng",
1080 ]
1081 public_deps = [
1082 "//third_party/jsoncpp",
1083 ]
1084 }
mtklein25c81d42016-07-27 13:55:26 -07001085
Mike Klein6e744122016-10-27 12:21:40 -04001086 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001087 test_lib("gm") {
1088 public_include_dirs = [ "gm" ]
1089 sources = gm_sources
1090 deps = [
scroggo19b91532016-10-24 09:03:26 -07001091 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001092 ":gpu_tool_utils",
1093 ":skia",
1094 ":tool_utils",
1095 ]
1096 }
mtklein25c81d42016-07-27 13:55:26 -07001097
Mike Klein6e744122016-10-27 12:21:40 -04001098 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001099 test_lib("tests") {
1100 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001101 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001102 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001103 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001104 }
mtkleinc095df52016-08-24 12:23:52 -07001105 deps = [
fmalita6cf896d2016-08-25 08:44:35 -07001106 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001107 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001108 ":skia",
1109 ":tool_utils",
1110 "//third_party/libpng",
1111 "//third_party/zlib",
1112 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001113 public_deps = [
1114 ":gpu_tool_utils", # Test.h #includes headers from this target.
1115 ]
mtkleinc095df52016-08-24 12:23:52 -07001116 }
mtklein2f3416d2016-08-02 16:02:05 -07001117
Mike Klein6e744122016-10-27 12:21:40 -04001118 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001119 test_lib("bench") {
1120 public_include_dirs = [ "bench" ]
1121 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001122 deps = [
1123 ":flags",
1124 ":gm",
1125 ":gpu_tool_utils",
1126 ":skia",
1127 ":tool_utils",
1128 ]
1129 }
mtklein2b6870c2016-07-28 14:17:33 -07001130
mtkleinc095df52016-08-24 12:23:52 -07001131 test_lib("experimental_svg_model") {
1132 public_include_dirs = [ "experimental/svg/model" ]
1133 sources = [
1134 "experimental/svg/model/SkSVGAttribute.cpp",
1135 "experimental/svg/model/SkSVGAttributeParser.cpp",
1136 "experimental/svg/model/SkSVGCircle.cpp",
Florin Malitace8840e2016-12-08 09:26:47 -05001137 "experimental/svg/model/SkSVGClipPath.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001138 "experimental/svg/model/SkSVGContainer.cpp",
1139 "experimental/svg/model/SkSVGDOM.cpp",
1140 "experimental/svg/model/SkSVGEllipse.cpp",
1141 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001142 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001143 "experimental/svg/model/SkSVGNode.cpp",
1144 "experimental/svg/model/SkSVGPath.cpp",
1145 "experimental/svg/model/SkSVGPoly.cpp",
1146 "experimental/svg/model/SkSVGRect.cpp",
1147 "experimental/svg/model/SkSVGRenderContext.cpp",
1148 "experimental/svg/model/SkSVGSVG.cpp",
1149 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001150 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001151 "experimental/svg/model/SkSVGTransformableNode.cpp",
1152 "experimental/svg/model/SkSVGValue.cpp",
1153 ]
1154 deps = [
1155 ":skia",
1156 ]
1157 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001158
Brian Osman16adfa32016-10-18 14:42:44 -04001159 test_lib("views") {
1160 public_include_dirs = [ "include/views" ]
1161 sources = [
1162 "src/views/SkEvent.cpp",
1163 "src/views/SkEventSink.cpp",
1164 "src/views/SkOSMenu.cpp",
1165 "src/views/SkTagList.cpp",
1166 "src/views/SkTouchGesture.cpp",
1167 "src/views/SkView.cpp",
1168 "src/views/SkViewPriv.cpp",
1169 ]
1170 libs = []
Brian Osman34755e22016-12-05 09:46:02 -05001171 deps = []
Brian Osman16adfa32016-10-18 14:42:44 -04001172 if (!is_android) {
1173 sources += [ "src/views/SkWindow.cpp" ]
1174 }
Jim Van Verth4e56a912016-10-21 10:58:52 -04001175 if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001176 public_include_dirs += [ "src/views/unix" ]
1177 sources += [
1178 "src/views/unix/SkOSWindow_Unix.cpp",
1179 "src/views/unix/keysym2ucs.c",
1180 ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001181 libs += [
1182 "GL",
1183 "X11",
1184 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001185 } else if (is_mac) {
1186 sources += [
1187 "src/views/mac/SkEventNotifier.mm",
1188 "src/views/mac/SkNSView.mm",
1189 "src/views/mac/SkOSWindow_Mac.mm",
1190 "src/views/mac/SkTextFieldCell.m",
1191 ]
1192 libs += [
1193 "QuartzCore.framework",
1194 "Cocoa.framework",
1195 "Foundation.framework",
1196 ]
1197 } else if (is_win) {
1198 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001199 } else if (is_ios) {
1200 sources += [ "src/views/mac/SkEventNotifier.mm" ]
Brian Osman16adfa32016-10-18 14:42:44 -04001201 }
Brian Osman34755e22016-12-05 09:46:02 -05001202 if (skia_use_angle) {
1203 deps += [ "//third_party/angle2" ]
1204 }
Brian Osman16adfa32016-10-18 14:42:44 -04001205 }
1206
Mike Klein38af9432016-11-11 11:39:44 -05001207 if (skia_use_lua) {
1208 test_lib("lua") {
1209 public_include_dirs = []
1210 sources = [
1211 "src/utils/SkLua.cpp",
1212 "src/utils/SkLuaCanvas.cpp",
1213 ]
1214 deps = [
1215 "//third_party/lua",
1216 ]
1217 }
1218
Mike Kleine6682eb2017-01-05 10:54:57 -05001219 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001220 sources = [
1221 "tools/lua/lua_app.cpp",
1222 ]
1223 deps = [
1224 ":lua",
1225 ":skia",
1226 "//third_party/lua",
1227 ]
Mike Klein38af9432016-11-11 11:39:44 -05001228 }
1229
Mike Kleine6682eb2017-01-05 10:54:57 -05001230 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001231 sources = [
1232 "tools/lua/lua_pictures.cpp",
1233 ]
1234 deps = [
1235 ":flags",
1236 ":lua",
1237 ":skia",
1238 ":tool_utils",
1239 "//third_party/lua",
1240 ]
Mike Klein38af9432016-11-11 11:39:44 -05001241 }
1242 }
1243
Cary Clark8032b982017-07-28 11:04:54 -04001244 test_app("bookmaker") {
1245 sources = [
1246 "tools/bookmaker/bookmaker.cpp",
1247 "tools/bookmaker/fiddleParser.cpp",
1248 "tools/bookmaker/includeParser.cpp",
1249 "tools/bookmaker/includeWriter.cpp",
1250 "tools/bookmaker/mdOut.cpp",
1251 "tools/bookmaker/parserCommon.cpp",
1252 "tools/bookmaker/spellCheck.cpp",
1253 ]
1254 deps = [
1255 ":flags",
1256 ":skia",
1257 ":tool_utils",
1258 ]
1259 }
1260
Mike Klein6e744122016-10-27 12:21:40 -04001261 import("gn/samples.gni")
Brian Osman16adfa32016-10-18 14:42:44 -04001262 test_lib("samples") {
Brian Osman16adfa32016-10-18 14:42:44 -04001263 public_include_dirs = [ "samplecode" ]
Mike Klein6e744122016-10-27 12:21:40 -04001264 include_dirs = [ "experimental" ]
1265 sources = samples_sources + [
Mike Klein6e744122016-10-27 12:21:40 -04001266 "experimental/SkSetPoly3To3.cpp",
1267 "experimental/SkSetPoly3To3_A.cpp",
1268 "experimental/SkSetPoly3To3_D.cpp",
Brian Osmancff94e42017-06-26 13:12:37 -04001269
1270 # Relocating these files here, so that clients don't try to build them while they're
1271 # still in active development. Clang's thread safety analysis gets tripped up by
1272 # conditional locks.
1273 "src/core/SkThreadedBMPDevice.cpp",
1274 "src/core/SkThreadedBMPDevice.h",
Mike Klein6e744122016-10-27 12:21:40 -04001275 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001276 deps = [
1277 ":experimental_svg_model",
csmartdalton8c679092017-03-27 12:32:29 -06001278 ":flags",
Mike Klein6e744122016-10-27 12:21:40 -04001279 ":gm",
Brian Osman16adfa32016-10-18 14:42:44 -04001280 ":tool_utils",
1281 ":views",
1282 ":xml",
1283 ]
Mike Klein38af9432016-11-11 11:39:44 -05001284
1285 if (skia_use_lua) {
1286 sources += [ "samplecode/SampleLua.cpp" ]
1287 deps += [
1288 ":lua",
1289 "//third_party/lua",
1290 ]
1291 }
Brian Osman16adfa32016-10-18 14:42:44 -04001292 }
1293
Mike Kleine6682eb2017-01-05 10:54:57 -05001294 test_app("dm") {
mtklein2b6870c2016-07-28 14:17:33 -07001295 sources = [
1296 "dm/DM.cpp",
1297 "dm/DMJsonWriter.cpp",
1298 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -07001299 ]
1300 include_dirs = [ "tests" ]
1301 deps = [
mtklein046cb562016-09-16 10:23:12 -07001302 ":common_flags",
fmalitaa2b9fdf2016-08-03 19:53:36 -07001303 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001304 ":flags",
1305 ":gm",
1306 ":gpu_tool_utils",
1307 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -07001308 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -07001309 ":tool_utils",
1310 "//third_party/jsoncpp",
1311 "//third_party/libpng",
1312 ]
mtklein2b6870c2016-07-28 14:17:33 -07001313 }
1314
Mike Klein06432b22017-03-21 13:14:33 -04001315 test_app("ok") {
1316 sources = [
1317 "tools/ok.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001318 "tools/ok_dsts.cpp",
Mike Klein154e6da2017-07-26 15:13:47 -04001319 "tools/ok_engines.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001320 "tools/ok_srcs.cpp",
Mike Kleind63442d2017-03-27 14:16:04 -04001321 "tools/ok_test.cpp",
Mike Kleinf5d1a552017-03-25 12:32:22 -04001322 "tools/ok_vias.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001323 ]
1324 deps = [
Mike Klein4f6e2712017-08-11 10:37:35 -04001325 ":bench",
Mike Klein06432b22017-03-21 13:14:33 -04001326 ":gm",
1327 ":skia",
Mike Kleind63442d2017-03-27 14:16:04 -04001328 ":tests",
Mike Klein62669ad2017-05-09 16:03:07 -04001329 ":tool_utils",
Mike Klein06432b22017-03-21 13:14:33 -04001330 ]
1331 }
1332
Mike Kleine6682eb2017-01-05 10:54:57 -05001333 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001334 sources = [
1335 "bench/nanobench.cpp",
1336 ]
1337 deps = [
1338 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001339 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001340 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001341 ":flags",
1342 ":gm",
1343 ":gpu_tool_utils",
1344 ":skia",
1345 ":tool_utils",
1346 "//third_party/jsoncpp",
1347 ]
mtklein2b6870c2016-07-28 14:17:33 -07001348 }
halcanary19a97202016-08-03 15:08:04 -07001349
Ravi Mistry10d36c52017-01-31 09:49:18 -05001350 test_app("skpinfo") {
1351 sources = [
1352 "tools/skpinfo.cpp",
1353 ]
1354 deps = [
1355 ":flags",
1356 ":skia",
1357 ]
1358 }
1359
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001360 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001361 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001362 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001363 "samplecode/SampleApp.cpp",
1364 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001365 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001366 if (is_mac) {
1367 sources += [ "src/views/mac/skia_mac.mm" ]
1368 } else if (is_win) {
1369 sources += [ "src/views/win/skia_win.cpp" ]
1370 } else if (is_linux) {
1371 sources += [ "src/views/unix/skia_unix.cpp" ]
1372 }
mtklein38925aa2016-09-21 10:11:25 -07001373 deps = [
1374 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001375 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001376 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001377 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001378 ":skia",
1379 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001380 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001381 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001382 if (skia_use_angle) {
1383 deps += [ "//third_party/angle2" ]
1384 }
mtklein38925aa2016-09-21 10:11:25 -07001385 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001386 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001387
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001388 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001389 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001390 sources = [
1391 "tools/skpbench/skpbench.cpp",
1392 ]
1393 deps = [
1394 ":flags",
1395 ":gpu_tool_utils",
1396 ":skia",
1397 ":tool_utils",
1398 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001399 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001400 }
1401
Mike Klein7d302882016-11-03 14:06:31 -04001402 # We can't yet build ICU on iOS or Windows.
1403 if (!is_ios && !is_win) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001404 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001405 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001406 "tools/shape/SkShaper_harfbuzz.cpp",
1407 "tools/shape/using_skia_and_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001408 ]
1409 deps = [
1410 ":skia",
1411 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001412 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001413 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001414 }
halcanary19a97202016-08-03 15:08:04 -07001415 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001416 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001417 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001418 "tools/shape/SkShaper_primitive.cpp",
1419 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001420 ]
1421 deps = [
1422 ":skia",
1423 ]
halcanary3eee9d92016-09-10 07:01:53 -07001424 }
mtklein046cb562016-09-16 10:23:12 -07001425
Matt Sarett9f1c4032017-05-17 10:06:32 -04001426 test_app("create_flutter_test_images") {
1427 sources = [
1428 "tools/create_flutter_test_images.cpp",
1429 ]
1430 deps = [
1431 ":skia",
1432 ":tool_utils",
1433 ]
1434 }
1435
Ben Wagner219f3622017-07-17 15:32:25 -04001436 test_app("create_test_font") {
1437 sources = [
1438 "tools/create_test_font.cpp",
1439 ]
1440 deps = [
1441 ":skia",
1442 ]
1443 assert_no_deps = [
1444 # tool_utils requires the output of this app.
1445 ":tool_utils",
1446 ]
1447 }
1448
Mike Kleine6682eb2017-01-05 10:54:57 -05001449 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001450 sources = [
1451 "tools/get_images_from_skps.cpp",
1452 ]
1453 deps = [
1454 ":flags",
1455 ":skia",
1456 "//third_party/jsoncpp",
1457 ]
mtklein046cb562016-09-16 10:23:12 -07001458 }
mtkleinecbc5262016-09-22 11:51:24 -07001459
Mike Kleine6682eb2017-01-05 10:54:57 -05001460 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001461 sources = [
1462 "tools/colorspaceinfo.cpp",
1463 ]
1464 deps = [
1465 ":flags",
1466 ":skia",
1467 ":tool_utils",
1468 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001469 }
1470
Mike Klein7d302882016-11-03 14:06:31 -04001471 if (!is_ios) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001472 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001473 sources = [
1474 "tools/skiaserve/Request.cpp",
1475 "tools/skiaserve/Response.cpp",
1476 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001477 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1478 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1479 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1480 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1481 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1482 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1483 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1484 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1485 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001486 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1487 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001488 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1489 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1490 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1491 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1492 ]
1493 deps = [
1494 ":flags",
1495 ":gpu_tool_utils",
1496 ":skia",
1497 ":tool_utils",
1498 "//third_party/jsoncpp",
1499 "//third_party/libmicrohttpd",
1500 "//third_party/libpng",
1501 ]
Mike Klein7d302882016-11-03 14:06:31 -04001502 }
mtkleinecbc5262016-09-22 11:51:24 -07001503 }
kjlubick14f984b2016-10-03 11:49:45 -07001504
Mike Kleine6682eb2017-01-05 10:54:57 -05001505 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001506 sources = [
1507 "fuzz/FilterFuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001508 "fuzz/FuzzCanvas.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001509 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001510 "fuzz/FuzzGradients.cpp",
1511 "fuzz/FuzzParsePath.cpp",
1512 "fuzz/FuzzPathop.cpp",
1513 "fuzz/FuzzScaleToSides.cpp",
1514 "fuzz/fuzz.cpp",
1515 ]
1516 deps = [
1517 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001518 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001519 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001520 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001521 ]
kjlubick14f984b2016-10-03 11:49:45 -07001522 }
Mike Klein38312422016-10-05 15:41:01 -04001523
Mike Kleine6682eb2017-01-05 10:54:57 -05001524 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001525 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001526 rebase_path("tests/skia_test.cpp"),
1527 rebase_path("tests/Test.cpp"),
1528 ]
caryclark9feb6322016-10-25 08:58:26 -07001529 deps = [
1530 ":flags",
1531 ":gpu_tool_utils",
1532 ":skia",
1533 ":tool_utils",
1534 ]
caryclark9feb6322016-10-25 08:58:26 -07001535 }
1536
Mike Kleine6682eb2017-01-05 10:54:57 -05001537 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001538 sources = [
1539 "tools/DumpRecord.cpp",
1540 "tools/dump_record.cpp",
1541 ]
1542 deps = [
1543 ":flags",
1544 ":skia",
1545 ]
Mike Klein38312422016-10-05 15:41:01 -04001546 }
bungemanfe917272016-10-13 17:36:40 -04001547
Mike Kleine6682eb2017-01-05 10:54:57 -05001548 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001549 sources = [
1550 "tools/skdiff/skdiff.cpp",
1551 "tools/skdiff/skdiff_html.cpp",
1552 "tools/skdiff/skdiff_main.cpp",
1553 "tools/skdiff/skdiff_utils.cpp",
1554 ]
1555 deps = [
1556 ":skia",
1557 ":tool_utils",
1558 ]
bungemanfe917272016-10-13 17:36:40 -04001559 }
halcanarya73d76a2016-10-17 13:19:02 -07001560
Mike Kleine6682eb2017-01-05 10:54:57 -05001561 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001562 sources = [
1563 "tools/skp_parser.cpp",
1564 ]
1565 deps = [
1566 ":skia",
1567 ":tool_utils",
1568 "//third_party/jsoncpp",
1569 ]
halcanarya73d76a2016-10-17 13:19:02 -07001570 }
Brian Osman16adfa32016-10-18 14:42:44 -04001571
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001572 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001573 test_app("viewer") {
1574 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001575 sources = [
1576 "tools/viewer/GMSlide.cpp",
1577 "tools/viewer/ImageSlide.cpp",
1578 "tools/viewer/SKPSlide.cpp",
1579 "tools/viewer/SampleSlide.cpp",
1580 "tools/viewer/Viewer.cpp",
1581 "tools/viewer/sk_app/CommandSet.cpp",
1582 "tools/viewer/sk_app/GLWindowContext.cpp",
1583 "tools/viewer/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001584 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001585 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001586
Jim Van Verth4e56a912016-10-21 10:58:52 -04001587 if (is_android) {
1588 sources += [
1589 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1590 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1591 "tools/viewer/sk_app/android/Window_android.cpp",
1592 "tools/viewer/sk_app/android/main_android.cpp",
1593 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1594 ]
Brian Osman462334e2017-02-09 11:22:57 -05001595 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001596 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001597 sources += [
1598 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1599 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1600 "tools/viewer/sk_app/unix/Window_unix.cpp",
1601 "tools/viewer/sk_app/unix/main_unix.cpp",
1602 ]
1603 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001604 sources += [
1605 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1606 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1607 "tools/viewer/sk_app/win/Window_win.cpp",
1608 "tools/viewer/sk_app/win/main_win.cpp",
1609 ]
Brian Salomon194db172017-08-17 14:37:06 -04001610 if (skia_use_angle) {
1611 sources += [ "tools/viewer/sk_app/win/ANGLEWindowContext_win.cpp" ]
1612 }
Mike Klein43c25262016-10-20 10:17:47 -04001613 } else if (is_mac) {
1614 sources += [
1615 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1616 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1617 "tools/viewer/sk_app/mac/Window_mac.cpp",
1618 "tools/viewer/sk_app/mac/main_mac.cpp",
1619 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001620 } else if (is_ios) {
1621 sources += [
1622 "tools/viewer/sk_app/ios/GLWindowContext_ios.cpp",
1623 "tools/viewer/sk_app/ios/RasterWindowContext_ios.cpp",
1624 "tools/viewer/sk_app/ios/Window_ios.cpp",
1625 "tools/viewer/sk_app/ios/main_ios.cpp",
1626 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001627 }
1628
1629 if (skia_use_vulkan) {
1630 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001631 if (is_android) {
1632 sources +=
1633 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001634 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001635 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1636 libs += [ "X11-xcb" ]
1637 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001638 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1639 }
1640 }
1641
1642 include_dirs = []
1643 deps = [
1644 ":flags",
1645 ":gm",
1646 ":gpu_tool_utils",
1647 ":samples",
1648 ":skia",
1649 ":tool_utils",
1650 ":views",
Brian Osman79086b92017-02-10 13:36:16 -05001651 "//third_party/imgui",
Brian Osman16adfa32016-10-18 14:42:44 -04001652 "//third_party/jsoncpp",
1653 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001654 if (is_android) {
1655 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001656 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04001657 deps += [ "//third_party/libsdl" ]
1658 }
Brian Salomon194db172017-08-17 14:37:06 -04001659 if (skia_use_angle) {
1660 deps += [ "//third_party/angle2" ]
1661 }
Mike Kleina92c3832016-12-08 09:49:39 -05001662 }
Brian Osman16adfa32016-10-18 14:42:44 -04001663 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001664
Jim Van Verthecfed2b2017-08-30 14:02:50 -04001665 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04001666 test_app("SkiaSDLExample") {
1667 sources = [
1668 "example/SkiaSDLExample.cpp",
1669 ]
1670 libs = []
1671 include_dirs = []
1672 deps = [
1673 ":gpu_tool_utils",
1674 ":skia",
1675 "//third_party/libsdl",
1676 ]
1677 }
1678 }
1679
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001680 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
1681 action_foreach("generate_mocs") {
1682 script = "gn/call.py"
1683 sources = [
1684 "tools/mdbviz/MainWindow.h",
1685 ]
1686 outputs = [
1687 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
1688 ]
1689 args = [
1690 "$skia_qt_path" + "/bin/moc",
1691 "{{source}}",
1692 "-o",
1693 "gen/mdbviz/{{source_name_part}}_moc.cpp",
1694 ]
1695 }
1696 action_foreach("generate_resources") {
1697 script = "gn/call.py"
1698 sources = [
1699 "tools/mdbviz/resources.qrc",
1700 ]
1701 outputs = [
1702 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
1703 ]
1704 args = [
1705 "$skia_qt_path" + "/bin/rcc",
1706 "{{source}}",
1707 "-o",
1708 "gen/mdbviz/{{source_name_part}}_res.cpp",
1709 ]
1710 }
1711 test_app("mdbviz") {
1712 if (is_win) {
1713 # on Windows we need to disable some exception handling warnings due to the Qt headers
1714 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
1715 }
1716 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001717 "tools/UrlDataManager.cpp",
1718 "tools/debugger/SkDebugCanvas.cpp",
1719 "tools/debugger/SkDrawCommand.cpp",
1720 "tools/debugger/SkJsonWriteBuffer.cpp",
1721 "tools/debugger/SkObjectParser.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001722 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04001723 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001724 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001725 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001726
1727 # generated files
1728 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
1729 "$target_gen_dir/mdbviz/resources_res.cpp",
1730 ]
1731 lib_dirs = [ "$skia_qt_path/lib" ]
1732 libs = [
1733 "Qt5Core.lib",
1734 "Qt5Gui.lib",
1735 "Qt5Widgets.lib",
1736 ]
1737 include_dirs = [
1738 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04001739 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001740 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001741 "tools",
1742 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001743 ]
1744 deps = [
1745 ":generate_mocs",
1746 ":generate_resources",
1747 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001748 "//third_party/jsoncpp",
1749 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001750 ]
1751 }
1752 }
1753
Mike Kleine459afd2017-03-03 09:21:30 -05001754 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05001755 copy("gdbserver") {
1756 sources = [
1757 "$ndk/$ndk_gdbserver",
1758 ]
1759 outputs = [
1760 "$root_out_dir/gdbserver",
1761 ]
1762 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05001763 }
mtklein25c81d42016-07-27 13:55:26 -07001764}
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001765
1766if (skia_jumper_clang != "") {
1767 action("regen_jumper") {
1768 script = "src/jumper/build_stages.py"
1769
1770 inputs = [
1771 "src/jumper/SkJumper_stages.cpp",
Mike Klein255607f2017-08-02 14:25:55 -04001772 "src/jumper/SkJumper_stages_8bit.cpp",
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001773 ]
1774
1775 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it.
1776 outputs = [
1777 "$target_out_dir/" +
1778 rebase_path("src/jumper/SkJumper_generated.S", target_out_dir),
1779 "$target_out_dir/" +
1780 rebase_path("src/jumper/SkJumper_generated_win.S", target_out_dir),
1781 ]
1782
1783 args = [
1784 skia_jumper_clang,
1785 skia_jumper_objdump,
1786 skia_jumper_ccache,
1787 ] + rebase_path(inputs) + rebase_path(outputs)
1788 }
1789}