blob: 14ce04a2981f9ed5d71d6a3f023389e584cd92a2 [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
Adam Barth54ef74a2017-10-13 10:59:38 -070078if (defined(skia_settings)) {
79 import(skia_settings)
80}
81
mtklein38925aa2016-09-21 10:11:25 -070082# Our tools require static linking (they use non-exported symbols).
83skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070084
mtkleina45be612016-08-29 15:22:10 -070085fontmgr_android_enabled = skia_use_expat && skia_use_freetype
86
mtklein1211e0c2016-07-26 13:55:45 -070087skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070088 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070089 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070090 "include/codec",
91 "include/config",
92 "include/core",
93 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -040094 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -070095 "include/gpu",
96 "include/gpu/gl",
mtklein1211e0c2016-07-26 13:55:45 -070097 "include/pathops",
98 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070099 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -0700100 "include/utils",
101 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700102]
103
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000104if (skia_use_vulkan) {
105 skia_public_includes += [ "include/gpu/vk" ]
106}
Greg Daniele5ddff52017-07-05 16:49:36 -0400107if (skia_use_metal) {
108 skia_public_includes += [ "include/gpu/mtl" ]
109}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000110
mtkleinc04ff472016-06-23 10:29:30 -0700111# Skia public API, generally provided by :skia.
112config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700113 include_dirs = skia_public_includes
Greg Danielec6ae522017-04-25 13:38:26 -0400114 if (skia_vulkan_headers != "") {
115 include_dirs += [ skia_vulkan_headers ]
116 }
Mike Kleinae7e6712016-10-11 17:49:33 -0400117 defines = []
118 if (is_component_build) {
119 defines += [ "SKIA_DLL" ]
120 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400121 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700122 defines += [ "SK_SAMPLES_FOR_X" ]
123 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400124 if (skia_enable_flutter_defines) {
125 defines += flutter_defines
126 }
mtklein06c35c02016-09-20 12:28:12 -0700127 if (!skia_enable_gpu) {
128 defines += [ "SK_SUPPORT_GPU=0" ]
129 }
mtkleinc04ff472016-06-23 10:29:30 -0700130}
131
132# Skia internal APIs, used by Skia itself and a few test tools.
133config("skia_private") {
134 visibility = [ ":*" ]
135
136 include_dirs = [
137 "include/private",
138 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700139 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700140 "src/core",
141 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700142 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700143 "src/image",
144 "src/images",
145 "src/lazy",
146 "src/opts",
147 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700148 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700149 "src/ports",
150 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400151 "src/shaders",
152 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700153 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700154 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700155 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500156 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700157 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700158 ]
mtklein150d1132016-08-01 06:56:40 -0700159
Mike Reeda9e241d2017-05-03 10:52:00 -0400160 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700161 if (is_android) {
162 defines += [
163 "SK_GAMMA_EXPONENT=1.4",
164 "SK_GAMMA_CONTRAST=0.0",
165 ]
166 }
mtklein88a7ac02016-09-14 11:16:49 -0700167 if (is_official_build || is_android) {
168 # TODO(bsalomon): it'd be nice to make Android normal.
169 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
170 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400171 libs = []
172 lib_dirs = []
173 if (skia_use_vulkan) {
Michael Jurkada3e5962017-04-14 17:44:09 -0700174 if (skia_vulkan_sdk != "" && !is_android && !is_fuchsia) {
Mike Klein487bfc22016-10-14 14:04:56 -0400175 if (is_win) {
Brian Salomon3b5bf352017-03-20 15:54:41 -0400176 lib_dirs += [
177 "$skia_vulkan_sdk/Bin",
178 "$skia_vulkan_sdk/Lib",
179 ]
Mike Klein487bfc22016-10-14 14:04:56 -0400180 } else {
Greg Daniel686bb212016-10-27 10:48:48 -0400181 lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
Mike Klein487bfc22016-10-14 14:04:56 -0400182 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400183 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400184 }
Brian Salomon03e05842017-02-23 12:23:47 -0500185 if (skia_enable_gpu) {
186 include_dirs += [ "src/gpu" ]
187 }
Brian Osman34755e22016-12-05 09:46:02 -0500188 if (skia_use_angle) {
189 defines += [ "SK_ANGLE" ]
190 }
Brian Osman3f375d02016-12-28 11:19:22 -0500191 if (skia_enable_discrete_gpu) {
192 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
193 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400194 if (!is_official_build) {
195 defines += [ "GR_TEST_UTILS=1" ]
196 }
mtkleinc04ff472016-06-23 10:29:30 -0700197}
198
199# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
200config("skia_library") {
201 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700202 defines = [ "SKIA_IMPLEMENTATION=1" ]
203}
204
205skia_library_configs = [
206 ":skia_public",
207 ":skia_private",
208 ":skia_library",
209]
210
mtklein9b8583d2016-08-24 17:32:30 -0700211# Use for CPU-specific Skia code that needs particular compiler flags.
212template("opts") {
213 if (invoker.enabled) {
214 source_set(target_name) {
215 forward_variables_from(invoker, "*")
216 configs += skia_library_configs
217 }
218 } else {
219 # If not enabled, a phony empty target that swallows all otherwise unused variables.
220 source_set(target_name) {
221 forward_variables_from(invoker,
222 "*",
223 [
224 "sources",
225 "cflags",
226 ])
227 }
228 }
anmittala7eaf2e2016-08-17 13:57:26 -0700229}
230
mtklein422310d2016-08-16 18:28:43 -0700231is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700232
mtklein7d6fb2c2016-08-25 14:50:44 -0700233opts("none") {
234 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700235 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700236 cflags = []
237}
238
mtklein7d6fb2c2016-08-25 14:50:44 -0700239opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700240 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700241 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700242 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700243}
244
245opts("arm64") {
246 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700247 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700248 cflags = []
249}
250
251opts("crc32") {
252 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700253 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700254 cflags = [ "-march=armv8-a+crc" ]
255}
256
mtklein9b8583d2016-08-24 17:32:30 -0700257opts("sse2") {
258 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700259 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400260 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400261 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
262 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400263 cflags = [ "-msse2" ]
264 }
mtklein9b8583d2016-08-24 17:32:30 -0700265}
mtkleinc04ff472016-06-23 10:29:30 -0700266
mtklein9b8583d2016-08-24 17:32:30 -0700267opts("ssse3") {
268 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700269 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400270 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400271 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
272 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400273 cflags = [ "-mssse3" ]
274 }
mtklein9b8583d2016-08-24 17:32:30 -0700275}
mtkleinc04ff472016-06-23 10:29:30 -0700276
mtklein9b8583d2016-08-24 17:32:30 -0700277opts("sse41") {
278 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700279 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400280 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400281 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
282 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400283 cflags = [ "-msse4.1" ]
284 }
mtklein9b8583d2016-08-24 17:32:30 -0700285}
mtklein4e976072016-08-08 09:06:27 -0700286
mtklein9b8583d2016-08-24 17:32:30 -0700287opts("sse42") {
288 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700289 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400290 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400291 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
292 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400293 cflags = [ "-msse4.2" ]
294 }
mtklein9b8583d2016-08-24 17:32:30 -0700295}
296
297opts("avx") {
298 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700299 sources = skia_opts.avx_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400300 if (!is_clang && is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000301 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400302 } else {
303 cflags = [ "-mavx" ]
304 }
mtkleinc04ff472016-06-23 10:29:30 -0700305}
306
mtkleinc095df52016-08-24 12:23:52 -0700307# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700308template("optional") {
309 if (invoker.enabled) {
310 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700311 if (defined(invoker.public_defines)) {
312 defines = invoker.public_defines
313 }
mtklein457b42a2016-08-23 13:56:37 -0700314 }
315 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700316 forward_variables_from(invoker,
317 "*",
318 [
319 "public_defines",
320 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700321 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700322 ])
mtklein457b42a2016-08-23 13:56:37 -0700323 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700324 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700325 if (defined(invoker.configs_to_remove)) {
326 configs -= invoker.configs_to_remove
327 }
mtklein457b42a2016-08-23 13:56:37 -0700328 }
329 } else {
mtklein457b42a2016-08-23 13:56:37 -0700330 source_set(target_name) {
331 forward_variables_from(invoker,
332 "*",
333 [
334 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700335 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700336 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700337 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700338 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700339 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700340 ])
mtkleincd01b032016-08-31 04:58:19 -0700341 if (defined(invoker.sources_when_disabled)) {
342 sources = invoker.sources_when_disabled
343 }
344 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700345 }
mtkleineb3c4252016-08-23 07:38:09 -0700346 }
mtklein457b42a2016-08-23 13:56:37 -0700347}
mtklein457b42a2016-08-23 13:56:37 -0700348
Mike Kleina04bb452017-02-09 12:24:07 -0500349optional("effects") {
350 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400351 deps = [
352 ":compile_processors",
353 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500354 sources =
355 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
356 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
357}
358
mtkleina45be612016-08-29 15:22:10 -0700359optional("fontmgr_android") {
360 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700361
362 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500363 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700364 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700365 ]
366 sources = [
367 "src/ports/SkFontMgr_android.cpp",
368 "src/ports/SkFontMgr_android_factory.cpp",
369 "src/ports/SkFontMgr_android_parser.cpp",
370 ]
371}
372
mtkleind2e39db2016-09-07 07:52:55 -0700373optional("fontmgr_custom") {
374 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
375
376 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500377 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700378 ]
379 sources = [
380 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500381 "src/ports/SkFontMgr_custom.h",
382 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700383 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500384 "src/ports/SkFontMgr_custom_embedded.cpp",
385 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700386 ]
387}
388
mtklein3cc22182016-08-29 13:26:14 -0700389optional("fontmgr_fontconfig") {
390 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700391
392 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500393 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700394 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700395 ]
396 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700397 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700398 "src/ports/SkFontConfigInterface_direct.cpp",
399 "src/ports/SkFontConfigInterface_direct_factory.cpp",
400 "src/ports/SkFontMgr_FontConfigInterface.cpp",
401 "src/ports/SkFontMgr_fontconfig.cpp",
402 "src/ports/SkFontMgr_fontconfig_factory.cpp",
403 ]
404}
405
mtkleincdedd0e2016-09-12 15:15:44 -0700406optional("fontmgr_fuchsia") {
407 enabled = is_fuchsia && skia_use_freetype
408
409 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500410 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700411 ]
412 sources = [
413 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500414 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700415 "src/ports/SkFontMgr_custom_empty_factory.cpp",
416 ]
417}
418
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700419if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400420 executable("sksllex") {
421 sources = [
422 "src/sksl/lex/Main.cpp",
423 "src/sksl/lex/NFA.cpp",
424 "src/sksl/lex/RegexNode.cpp",
425 "src/sksl/lex/RegexParser.cpp",
426 ]
427 include_dirs = [ "src/sksl/lex" ]
428 }
429
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700430 action("run_sksllex") {
431 script = "gn/run_sksllex.py"
432 sources = [
433 "src/sksl/lex/layout.lex",
434 "src/sksl/lex/sksl.lex",
435 ]
436
437 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
438 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
439 outputs = [
440 "$target_out_dir/" +
441 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
442 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
443 # confused due to the same file being named by two different paths
444 ]
445 sksllex_path = "$root_out_dir/"
446 sksllex_path += "sksllex"
447 if (host_os == "win") {
448 sksllex_path += ".exe"
449 }
450 args = [
451 rebase_path(sksllex_path),
452 rebase_path("bin/clang-format"),
453 rebase_path("src"),
454 ]
455 }
456} else {
457 group("run_sksllex") {
458 }
459}
460
461if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400462 executable("skslc") {
463 defines = [ "SKSL_STANDALONE" ]
464 sources = [
465 "src/sksl/SkSLMain.cpp",
466 ]
467 sources += skia_sksl_sources
468 include_dirs = [
469 "src/gpu",
470 "src/sksl",
471 ]
472 deps = [
473 "//third_party/spirv-tools",
474 ]
475 }
476
477 skia_gpu_processor_outputs = []
478 foreach(src, skia_gpu_processor_sources) {
479 dir = get_path_info(src, "dir")
480 name = get_path_info(src, "name")
481
482 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
483 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
484 skia_gpu_processor_outputs += [
485 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
486 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
487 # confused due to the same file being named by two different paths
488 ]
489 }
490
491 action("compile_processors") {
492 script = "gn/compile_processors.py"
493 deps = [
494 ":skslc(//gn/toolchain:$host_toolchain)",
495 ]
496 sources = skia_gpu_processor_sources
497 outputs = skia_gpu_processor_outputs
498 skslc_path = "$root_out_dir/"
499 if (host_toolchain != default_toolchain_name) {
500 skslc_path += "$host_toolchain/"
501 }
502 skslc_path += "skslc"
503 if (host_os == "win") {
504 skslc_path += ".exe"
505 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400506 args = [
507 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400508 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400509 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400510 args += rebase_path(skia_gpu_processor_sources)
511 }
512} else {
513 skia_gpu_processor_outputs = []
514 group("compile_processors") {
515 }
516}
517
mtklein06c35c02016-09-20 12:28:12 -0700518optional("gpu") {
519 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400520 deps = [
521 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700522 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400523 ]
mtkleine9fb3d52016-09-20 15:11:46 -0700524 public_defines = []
525
Mike Klein29b3e582017-02-09 11:57:32 -0500526 sources = skia_gpu_sources + skia_sksl_sources +
Ethan Nicholas762466e2017-06-29 10:03:38 -0400527 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] +
528 skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700529
530 # These paths need to be absolute to match the ones produced by shared_sources.gni.
531 sources -= get_path_info([
532 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
533 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
534 ],
535 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400536 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700537 if (is_android) {
538 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400539
540 # this lib is required to link against AHardwareBuffer
541 if (defined(ndk_api) && ndk_api >= 26) {
542 libs += [ "android" ]
543 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400544 } else if (skia_use_egl) {
545 sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
546 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700547 } else if (is_linux) {
548 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500549 libs += [
550 "GL",
551 "GLU",
552 ]
mtklein06c35c02016-09-20 12:28:12 -0700553 } else if (is_mac) {
554 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800555 } else if (is_ios) {
556 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400557 } else if (is_win) {
558 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
559 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700560 } else {
561 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
562 }
mtkleine9fb3d52016-09-20 15:11:46 -0700563
564 if (skia_use_vulkan) {
565 public_defines += [ "SK_VULKAN" ]
566 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700567 if (skia_enable_vulkan_debug_layers) {
568 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
569 }
mtkleine9fb3d52016-09-20 15:11:46 -0700570 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400571 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400572 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400573 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
574 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400575
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400576 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400577 if (skia_use_metal) {
578 public_defines += [ "SK_METAL" ]
579 sources += skia_metal_sources
580 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400581 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400582 }
mtklein06c35c02016-09-20 12:28:12 -0700583}
584
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400585optional("heif") {
586 enabled = skia_use_libheif
587 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
588
589 deps = []
590
591 sources = [
592 "src/codec/SkHeifCodec.cpp",
593 ]
594}
595
mtklein63213812016-08-24 09:55:56 -0700596optional("jpeg") {
597 enabled = skia_use_libjpeg_turbo
598 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
599
mtklein63213812016-08-24 09:55:56 -0700600 deps = [
601 "//third_party/libjpeg-turbo:libjpeg",
602 ]
603 sources = [
604 "src/codec/SkJpegCodec.cpp",
605 "src/codec/SkJpegDecoderMgr.cpp",
606 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700607 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400608 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700609 ]
610}
611
612optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500613 enabled = skia_use_zlib && skia_enable_pdf
614 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700615
mtklein63213812016-08-24 09:55:56 -0700616 deps = [
617 "//third_party/zlib",
618 ]
brettwb9447282016-09-01 14:24:39 -0700619 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700620 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700621
622 if (skia_use_sfntly) {
623 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500624 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700625 }
626}
627
628optional("png") {
629 enabled = skia_use_libpng
630 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
631
mtklein63213812016-08-24 09:55:56 -0700632 deps = [
633 "//third_party/libpng",
634 ]
635 sources = [
636 "src/codec/SkIcoCodec.cpp",
637 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400638 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700639 ]
640}
641
scroggof84ad642016-10-31 09:02:57 -0700642optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400643 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700644 public_defines = [ "SK_CODEC_DECODES_RAW" ]
645
646 deps = [
647 "//third_party/dng_sdk",
648 "//third_party/libjpeg-turbo:libjpeg",
649 "//third_party/piex",
650 ]
651
652 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
653 # Skia.
654 configs_to_remove = [ "//gn:no_exceptions" ]
655
656 sources = [
657 "src/codec/SkRawAdapterCodec.cpp",
658 "src/codec/SkRawCodec.cpp",
659 ]
660}
661
mtklein3cc22182016-08-29 13:26:14 -0700662optional("typeface_freetype") {
663 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700664
665 deps = [
666 "//third_party/freetype2",
667 ]
668 sources = [
669 "src/ports/SkFontHost_FreeType.cpp",
670 "src/ports/SkFontHost_FreeType_common.cpp",
671 ]
672}
673
mtklein457b42a2016-08-23 13:56:37 -0700674optional("webp") {
675 enabled = skia_use_libwebp
676 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
677
mtklein457b42a2016-08-23 13:56:37 -0700678 deps = [
679 "//third_party/libwebp",
680 ]
681 sources = [
682 "src/codec/SkWebpAdapterCodec.cpp",
683 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400684 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700685 ]
mtkleineb3c4252016-08-23 07:38:09 -0700686}
687
mtklein63213812016-08-24 09:55:56 -0700688optional("xml") {
689 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000690 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700691
mtklein63213812016-08-24 09:55:56 -0700692 deps = [
693 "//third_party/expat",
694 ]
695 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500696 "src/svg/SkSVGCanvas.cpp",
697 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700698 "src/xml/SkDOM.cpp",
699 "src/xml/SkXMLParser.cpp",
700 "src/xml/SkXMLWriter.cpp",
701 ]
702}
703
mtkleinc04ff472016-06-23 10:29:30 -0700704component("skia") {
705 public_configs = [ ":skia_public" ]
706 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700707
708 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700709 ":arm64",
710 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700711 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700712 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500713 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700714 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700715 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700716 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700717 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700718 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400719 ":heif",
mtklein63213812016-08-24 09:55:56 -0700720 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700721 ":none",
mtklein63213812016-08-24 09:55:56 -0700722 ":pdf",
723 ":png",
scroggof84ad642016-10-31 09:02:57 -0700724 ":raw",
mtklein9b8583d2016-08-24 17:32:30 -0700725 ":sse2",
726 ":sse41",
727 ":sse42",
728 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700729 ":webp",
mtklein63213812016-08-24 09:55:56 -0700730 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700731 ]
732
Chinmay Garde43f115c2016-11-16 15:04:12 -0800733 # This file (and all GN files in Skia) are designed to work with an
734 # empty sources assignment filter; we handle all that explicitly.
735 # We clear the filter here for clients who may have set up a global filter.
736 set_sources_assignment_filter([])
737
mtkleinc04ff472016-06-23 10:29:30 -0700738 sources = []
brettwb9447282016-09-01 14:24:39 -0700739 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700740 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500741 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700742 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400743 "src/android/SkAndroidFrameworkUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700744 "src/android/SkBitmapRegionCodec.cpp",
745 "src/android/SkBitmapRegionDecoder.cpp",
746 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400747 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700748 "src/codec/SkBmpCodec.cpp",
749 "src/codec/SkBmpMaskCodec.cpp",
750 "src/codec/SkBmpRLECodec.cpp",
751 "src/codec/SkBmpStandardCodec.cpp",
752 "src/codec/SkCodec.cpp",
753 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700754 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700755 "src/codec/SkMaskSwizzler.cpp",
756 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700757 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700758 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700759 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700760 "src/codec/SkSwizzler.cpp",
761 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700762 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700763 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700764 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700765 "src/ports/SkMemory_malloc.cpp",
766 "src/ports/SkOSFile_stdio.cpp",
767 "src/sfnt/SkOTTable_name.cpp",
768 "src/sfnt/SkOTUtils.cpp",
769 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700770 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700771 ]
brettwb9447282016-09-01 14:24:39 -0700772
mtklein7d6fb2c2016-08-25 14:50:44 -0700773 libs = []
774
mtkleinc04ff472016-06-23 10:29:30 -0700775 if (is_win) {
776 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400777 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700778 "src/ports/SkDebug_win.cpp",
779 "src/ports/SkFontHost_win.cpp",
780 "src/ports/SkFontMgr_win_dw.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700781 "src/ports/SkImageEncoder_WIC.cpp",
782 "src/ports/SkImageGeneratorWIC.cpp",
783 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700784 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700785 "src/ports/SkScalerContext_win_dw.cpp",
786 "src/ports/SkTLS_win.cpp",
787 "src/ports/SkTypeface_win_dw.cpp",
788 ]
Mike Klein69f6ed42016-10-13 15:45:07 -0400789 if (skia_use_gdi) {
790 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
791 libs += [
792 "Gdi32.lib",
793 "Usp10.lib",
794 ]
795 } else {
796 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
797 }
mtkleinb9be9792016-09-16 14:44:18 -0700798 sources -=
799 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400800 libs += [
801 "FontSub.lib",
802 "Ole32.lib",
803 "OleAut32.lib",
804 "User32.lib",
805 ]
mtkleinc04ff472016-06-23 10:29:30 -0700806 } else {
807 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700808 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700809 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700810 "src/ports/SkTLS_pthread.cpp",
811 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400812 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700813 }
814
mtklein7d6fb2c2016-08-25 14:50:44 -0700815 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500816 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500817 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500818 deps += [ "//third_party/cpu-features" ]
819 }
mtklein06c35c02016-09-20 12:28:12 -0700820 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700821 libs += [
822 "EGL",
823 "GLESv2",
824 "log",
825 ]
826 }
827
mtkleinc04ff472016-06-23 10:29:30 -0700828 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700829 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700830 }
831
832 if (is_mac) {
833 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700834 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700835 "src/ports/SkFontHost_mac.cpp",
836 "src/ports/SkImageEncoder_CG.cpp",
837 "src/ports/SkImageGeneratorCG.cpp",
838 ]
mtklein09e61f72016-08-23 13:35:28 -0700839 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400840 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
841 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700842 "ApplicationServices.framework",
843 "OpenGL.framework",
844 ]
mtkleinc04ff472016-06-23 10:29:30 -0700845 }
abarth6fc8ff02016-07-15 15:15:15 -0700846
Mike Klein7d302882016-11-03 14:06:31 -0400847 if (is_ios) {
848 sources += [
849 "src/ports/SkDebug_stdio.cpp",
850 "src/ports/SkFontHost_mac.cpp",
851 "src/ports/SkImageEncoder_CG.cpp",
852 "src/ports/SkImageGeneratorCG.cpp",
853 ]
854 libs += [
855 "CoreFoundation.framework",
856 "CoreGraphics.framework",
857 "CoreText.framework",
858 "ImageIO.framework",
859 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400860
861 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
862 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400863 ]
864 }
865
abarth6fc8ff02016-07-15 15:15:15 -0700866 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700867 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700868 }
mtkleinc04ff472016-06-23 10:29:30 -0700869}
870
mtkleinc095df52016-08-24 12:23:52 -0700871# Targets guarded by skia_enable_tools may use //third_party freely.
872if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -0500873 # Used by gn_to_bp.py to list our public include dirs.
874 source_set("public") {
875 configs += [ ":skia_public" ]
876 }
877
Mike Kleinc36dedf2016-11-18 09:35:28 -0500878 config("skia.h_config") {
879 include_dirs = [ "$target_gen_dir" ]
880 }
881 action("skia.h") {
882 public_configs = [ ":skia.h_config" ]
883 skia_h = "$target_gen_dir/skia.h"
884 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -0400885 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000886 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -0500887 depfile = "$skia_h.deps"
888 outputs = [
889 skia_h,
890 ]
891 }
892
893 if (skia_enable_gpu && target_cpu == "x64") {
894 # Our bots only have 64-bit libOSMesa installed.
895 # TODO: worth fixing?
896 executable("fiddle") {
897 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -0500898 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -0500899 "tools/fiddle/draw.cpp",
900 "tools/fiddle/fiddle_main.cpp",
901 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -0400902
903 if (skia_use_egl) {
904 sources += [ "tools/fiddle/egl_context.cpp" ]
905 } else if (skia_use_mesa) {
906 sources += [ "tools/fiddle/mesa_context.cpp" ]
907 if (is_linux) {
908 libs += [ "OSMesa" ]
909 }
910 } else {
911 sources += [ "tools/fiddle/null_context.cpp" ]
912 }
Joe Gregorio1e735c02017-04-19 14:05:14 -0400913 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -0500914 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -0400915 ":flags",
Mike Kleinc36dedf2016-11-18 09:35:28 -0500916 ":skia",
917 ":skia.h",
918 ]
919 }
920 }
921
922 if (skia_enable_gpu) {
923 source_set("public_headers_warnings_check") {
924 sources = [
925 "tools/public_headers_warnings_check.cpp",
926 ]
927 configs -= [ "//gn:warnings_except_public_headers" ]
928 deps = [
929 ":skia",
930 ":skia.h",
931 ]
932 }
933 }
934
mtkleinc095df52016-08-24 12:23:52 -0700935 template("test_lib") {
936 config(target_name + "_config") {
937 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700938 if (defined(invoker.public_defines)) {
939 defines = invoker.public_defines
940 }
mtklein25c81d42016-07-27 13:55:26 -0700941 }
mtkleinc095df52016-08-24 12:23:52 -0700942 source_set(target_name) {
943 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
944 public_configs = [
945 ":" + target_name + "_config",
946 ":skia_private",
947 ]
948
949 if (!defined(deps)) {
950 deps = []
951 }
952 deps += [ ":skia" ]
953 testonly = true
954 }
mtklein25c81d42016-07-27 13:55:26 -0700955 }
mtklein25c81d42016-07-27 13:55:26 -0700956
Mike Kleine6682eb2017-01-05 10:54:57 -0500957 template("test_app") {
958 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
959 shared_library("lib" + target_name) {
960 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400961 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500962 testonly = true
963 }
964 } else {
Mike Klein7d921032017-01-05 12:20:41 -0500965 _executable = target_name
966 executable(_executable) {
Mike Kleine6682eb2017-01-05 10:54:57 -0500967 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400968 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500969 testonly = true
970 }
971 }
Mike Klein7d921032017-01-05 12:20:41 -0500972 if (is_android && skia_android_serial != "" && defined(_executable)) {
973 action("push_" + target_name) {
974 script = "gn/push_to_android.py"
975 deps = [
976 ":" + _executable,
977 ]
978 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
979 outputs = [
980 _stamp,
981 ]
982 args = [
983 rebase_path("$root_build_dir/$_executable"),
984 skia_android_serial,
985 rebase_path(_stamp),
986 ]
987 testonly = true
988 }
989 }
Mike Kleine6682eb2017-01-05 10:54:57 -0500990 }
991
mtkleinc095df52016-08-24 12:23:52 -0700992 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700993 public_include_dirs = []
994 if (skia_enable_gpu) {
995 public_defines = []
996 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700997
998 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700999 sources = [
1000 "tools/gpu/GrContextFactory.cpp",
1001 "tools/gpu/GrTest.cpp",
1002 "tools/gpu/TestContext.cpp",
1003 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001004 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001005 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1006 "tools/gpu/gl/debug/GrBufferObj.cpp",
1007 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1008 "tools/gpu/gl/debug/GrProgramObj.cpp",
1009 "tools/gpu/gl/debug/GrShaderObj.cpp",
1010 "tools/gpu/gl/debug/GrTextureObj.cpp",
1011 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1012 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001013 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001014 ]
1015 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001016
Kevin Lubick4a24e102017-03-29 11:19:01 -04001017 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001018 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001019 } else if (is_ios) {
1020 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1021 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001022 } else if (is_linux) {
1023 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001024 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001025 } else if (is_mac) {
1026 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001027 } else if (is_win) {
1028 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1029 libs += [
1030 "Gdi32.lib",
1031 "OpenGL32.lib",
1032 ]
mtklein38925aa2016-09-21 10:11:25 -07001033 }
mtklein6ef69992016-09-14 06:12:09 -07001034
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001035 cflags_objcc = [ "-fobjc-arc" ]
1036
Mike Kleinc168a3a2016-11-14 14:53:13 +00001037 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001038 deps += [ "//third_party/angle2" ]
1039 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1040 }
mtklein38925aa2016-09-21 10:11:25 -07001041 if (skia_use_mesa) {
1042 public_defines += [ "SK_MESA" ]
1043 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
1044 libs += [ "OSMesa" ]
1045 }
mtkleind68f9b02016-09-23 13:18:41 -07001046 if (skia_use_vulkan) {
1047 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Brian Salomon5db010b2017-04-25 16:05:29 -04001048 if (is_win) {
1049 libs += [ "vulkan-1.lib" ]
1050 } else {
1051 libs += [ "vulkan" ]
1052 }
mtkleind68f9b02016-09-23 13:18:41 -07001053 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001054 if (skia_use_metal) {
1055 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1056 }
mtkleina627b5c2016-09-20 13:36:47 -07001057 }
mtklein25c81d42016-07-27 13:55:26 -07001058 }
mtklein25c81d42016-07-27 13:55:26 -07001059
mtkleinc095df52016-08-24 12:23:52 -07001060 test_lib("flags") {
1061 public_include_dirs = [ "tools/flags" ]
1062 sources = [
1063 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001064 ]
1065 }
1066 test_lib("common_flags") {
1067 public_include_dirs = [ "tools/flags" ]
1068 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001069 "tools/flags/SkCommonFlags.cpp",
1070 "tools/flags/SkCommonFlagsConfig.cpp",
1071 ]
1072 deps = [
mtklein046cb562016-09-16 10:23:12 -07001073 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001074 ":gpu_tool_utils",
1075 ]
1076 }
mtklein25c81d42016-07-27 13:55:26 -07001077
mtkleinc095df52016-08-24 12:23:52 -07001078 test_lib("tool_utils") {
1079 public_include_dirs = [
1080 "tools",
1081 "tools/debugger",
1082 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001083 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001084 ]
1085 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001086 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001087 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001088 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001089 "tools/ProcStats.cpp",
1090 "tools/Resources.cpp",
1091 "tools/ThermalManager.cpp",
1092 "tools/UrlDataManager.cpp",
1093 "tools/debugger/SkDebugCanvas.cpp",
1094 "tools/debugger/SkDrawCommand.cpp",
1095 "tools/debugger/SkJsonWriteBuffer.cpp",
1096 "tools/debugger/SkObjectParser.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001097 "tools/picture_utils.cpp",
1098 "tools/random_parse_path.cpp",
1099 "tools/sk_tool_utils.cpp",
1100 "tools/sk_tool_utils_font.cpp",
1101 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001102 "tools/trace/SkChromeTracingTracer.cpp",
1103 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001104 "tools/trace/SkDebugfTracer.cpp",
1105 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001106 "tools/trace/SkEventTracingPriv.cpp",
1107 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001108 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001109 libs = []
1110 if (is_ios) {
1111 sources += [ "tools/ios_utils.m" ]
1112 libs += [ "Foundation.framework" ]
1113 }
mtkleinc095df52016-08-24 12:23:52 -07001114 deps = [
mtklein046cb562016-09-16 10:23:12 -07001115 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001116 ":flags",
1117 "//third_party/libpng",
1118 ]
1119 public_deps = [
1120 "//third_party/jsoncpp",
1121 ]
1122 }
mtklein25c81d42016-07-27 13:55:26 -07001123
Mike Klein6e744122016-10-27 12:21:40 -04001124 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001125 test_lib("gm") {
1126 public_include_dirs = [ "gm" ]
1127 sources = gm_sources
1128 deps = [
scroggo19b91532016-10-24 09:03:26 -07001129 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001130 ":gpu_tool_utils",
1131 ":skia",
1132 ":tool_utils",
1133 ]
1134 }
mtklein25c81d42016-07-27 13:55:26 -07001135
Mike Klein6e744122016-10-27 12:21:40 -04001136 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001137 test_lib("tests") {
1138 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001139 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001140 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001141 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001142 }
mtkleinc095df52016-08-24 12:23:52 -07001143 deps = [
fmalita6cf896d2016-08-25 08:44:35 -07001144 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001145 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001146 ":skia",
1147 ":tool_utils",
1148 "//third_party/libpng",
1149 "//third_party/zlib",
1150 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001151 public_deps = [
1152 ":gpu_tool_utils", # Test.h #includes headers from this target.
1153 ]
mtkleinc095df52016-08-24 12:23:52 -07001154 }
mtklein2f3416d2016-08-02 16:02:05 -07001155
Mike Klein6e744122016-10-27 12:21:40 -04001156 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001157 test_lib("bench") {
1158 public_include_dirs = [ "bench" ]
1159 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001160 deps = [
1161 ":flags",
1162 ":gm",
1163 ":gpu_tool_utils",
1164 ":skia",
1165 ":tool_utils",
1166 ]
1167 }
mtklein2b6870c2016-07-28 14:17:33 -07001168
mtkleinc095df52016-08-24 12:23:52 -07001169 test_lib("experimental_svg_model") {
1170 public_include_dirs = [ "experimental/svg/model" ]
1171 sources = [
1172 "experimental/svg/model/SkSVGAttribute.cpp",
1173 "experimental/svg/model/SkSVGAttributeParser.cpp",
1174 "experimental/svg/model/SkSVGCircle.cpp",
Florin Malitace8840e2016-12-08 09:26:47 -05001175 "experimental/svg/model/SkSVGClipPath.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001176 "experimental/svg/model/SkSVGContainer.cpp",
1177 "experimental/svg/model/SkSVGDOM.cpp",
1178 "experimental/svg/model/SkSVGEllipse.cpp",
Florin Malitadf007e12017-10-09 15:14:13 -04001179 "experimental/svg/model/SkSVGGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001180 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001181 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001182 "experimental/svg/model/SkSVGNode.cpp",
1183 "experimental/svg/model/SkSVGPath.cpp",
Florin Malita1aa1bb62017-10-11 14:34:33 -04001184 "experimental/svg/model/SkSVGPattern.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001185 "experimental/svg/model/SkSVGPoly.cpp",
Florin Malitacc6cc292017-10-09 16:05:30 -04001186 "experimental/svg/model/SkSVGRadialGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001187 "experimental/svg/model/SkSVGRect.cpp",
1188 "experimental/svg/model/SkSVGRenderContext.cpp",
1189 "experimental/svg/model/SkSVGSVG.cpp",
1190 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001191 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001192 "experimental/svg/model/SkSVGTransformableNode.cpp",
Florin Malita6a69c052017-10-11 14:02:11 -04001193 "experimental/svg/model/SkSVGUse.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001194 "experimental/svg/model/SkSVGValue.cpp",
1195 ]
1196 deps = [
1197 ":skia",
1198 ]
1199 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001200
Kevin Lubickebf648e2017-09-21 13:45:16 -04001201 if (target_cpu != "wasm") {
1202 test_lib("views") {
1203 public_include_dirs = [ "include/views" ]
1204 sources = [
1205 "src/views/SkEvent.cpp",
1206 "src/views/SkEventSink.cpp",
1207 "src/views/SkOSMenu.cpp",
1208 "src/views/SkTagList.cpp",
1209 "src/views/SkTouchGesture.cpp",
1210 "src/views/SkView.cpp",
1211 "src/views/SkViewPriv.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001212 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001213 libs = []
1214 deps = []
1215 if (!is_android) {
1216 sources += [ "src/views/SkWindow.cpp" ]
1217 }
1218 if (is_linux) {
1219 public_include_dirs += [ "src/views/unix" ]
1220 sources += [
1221 "src/views/unix/SkOSWindow_Unix.cpp",
1222 "src/views/unix/keysym2ucs.c",
1223 ]
1224 libs += [
1225 "GL",
1226 "X11",
1227 ]
1228 } else if (is_mac) {
1229 sources += [
1230 "src/views/mac/SkEventNotifier.mm",
1231 "src/views/mac/SkNSView.mm",
1232 "src/views/mac/SkOSWindow_Mac.mm",
1233 "src/views/mac/SkTextFieldCell.m",
1234 ]
1235 libs += [
1236 "QuartzCore.framework",
1237 "Cocoa.framework",
1238 "Foundation.framework",
1239 ]
1240 } else if (is_win) {
1241 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1242 } else if (is_ios) {
1243 sources += [ "src/views/mac/SkEventNotifier.mm" ]
1244 }
1245 if (skia_use_angle) {
1246 deps += [ "//third_party/angle2" ]
1247 }
Brian Osman34755e22016-12-05 09:46:02 -05001248 }
Brian Osman16adfa32016-10-18 14:42:44 -04001249 }
1250
Mike Klein38af9432016-11-11 11:39:44 -05001251 if (skia_use_lua) {
1252 test_lib("lua") {
1253 public_include_dirs = []
1254 sources = [
1255 "src/utils/SkLua.cpp",
1256 "src/utils/SkLuaCanvas.cpp",
1257 ]
1258 deps = [
1259 "//third_party/lua",
1260 ]
1261 }
1262
Mike Kleine6682eb2017-01-05 10:54:57 -05001263 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001264 sources = [
1265 "tools/lua/lua_app.cpp",
1266 ]
1267 deps = [
1268 ":lua",
1269 ":skia",
1270 "//third_party/lua",
1271 ]
Mike Klein38af9432016-11-11 11:39:44 -05001272 }
1273
Mike Kleine6682eb2017-01-05 10:54:57 -05001274 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001275 sources = [
1276 "tools/lua/lua_pictures.cpp",
1277 ]
1278 deps = [
1279 ":flags",
1280 ":lua",
1281 ":skia",
1282 ":tool_utils",
1283 "//third_party/lua",
1284 ]
Mike Klein38af9432016-11-11 11:39:44 -05001285 }
1286 }
1287
Cary Clark8032b982017-07-28 11:04:54 -04001288 test_app("bookmaker") {
1289 sources = [
1290 "tools/bookmaker/bookmaker.cpp",
1291 "tools/bookmaker/fiddleParser.cpp",
1292 "tools/bookmaker/includeParser.cpp",
1293 "tools/bookmaker/includeWriter.cpp",
1294 "tools/bookmaker/mdOut.cpp",
1295 "tools/bookmaker/parserCommon.cpp",
1296 "tools/bookmaker/spellCheck.cpp",
1297 ]
1298 deps = [
1299 ":flags",
1300 ":skia",
1301 ":tool_utils",
1302 ]
1303 }
1304
Kevin Lubickebf648e2017-09-21 13:45:16 -04001305 if (target_cpu != "wasm") {
1306 import("gn/samples.gni")
1307 test_lib("samples") {
1308 public_include_dirs = [ "samplecode" ]
1309 include_dirs = [ "experimental" ]
1310 sources = samples_sources + [
1311 "experimental/SkSetPoly3To3.cpp",
1312 "experimental/SkSetPoly3To3_A.cpp",
1313 "experimental/SkSetPoly3To3_D.cpp",
Brian Osmancff94e42017-06-26 13:12:37 -04001314
Kevin Lubickebf648e2017-09-21 13:45:16 -04001315 # Relocating these files here, so that clients don't try to build them while they're
1316 # still in active development. Clang's thread safety analysis gets tripped up by
1317 # conditional locks.
1318 "src/core/SkThreadedBMPDevice.cpp",
1319 "src/core/SkThreadedBMPDevice.h",
1320 ]
1321 deps = [
1322 ":experimental_svg_model",
1323 ":flags",
1324 ":gm",
1325 ":tool_utils",
1326 ":views",
1327 ":xml",
1328 ]
Mike Klein38af9432016-11-11 11:39:44 -05001329
Kevin Lubickebf648e2017-09-21 13:45:16 -04001330 if (skia_use_lua) {
1331 sources += [ "samplecode/SampleLua.cpp" ]
1332 deps += [
1333 ":lua",
1334 "//third_party/lua",
1335 ]
1336 }
1337 }
1338 test_app("dm") {
1339 sources = [
1340 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001341 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001342 "dm/DMJsonWriter.cpp",
1343 "dm/DMSrcSink.cpp",
1344 ]
1345 include_dirs = [ "tests" ]
1346 deps = [
1347 ":common_flags",
1348 ":experimental_svg_model",
1349 ":flags",
1350 ":gm",
1351 ":gpu_tool_utils",
1352 ":skia",
1353 ":tests",
1354 ":tool_utils",
1355 "//third_party/jsoncpp",
1356 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001357 ]
1358 }
Brian Osman16adfa32016-10-18 14:42:44 -04001359 }
1360
Mike Klein06432b22017-03-21 13:14:33 -04001361 test_app("ok") {
1362 sources = [
1363 "tools/ok.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001364 "tools/ok_dsts.cpp",
Mike Klein154e6da2017-07-26 15:13:47 -04001365 "tools/ok_engines.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001366 "tools/ok_srcs.cpp",
Mike Kleind63442d2017-03-27 14:16:04 -04001367 "tools/ok_test.cpp",
Mike Kleinf5d1a552017-03-25 12:32:22 -04001368 "tools/ok_vias.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001369 ]
1370 deps = [
Mike Klein4f6e2712017-08-11 10:37:35 -04001371 ":bench",
Mike Klein06432b22017-03-21 13:14:33 -04001372 ":gm",
1373 ":skia",
Mike Kleind63442d2017-03-27 14:16:04 -04001374 ":tests",
Mike Klein62669ad2017-05-09 16:03:07 -04001375 ":tool_utils",
Mike Klein06432b22017-03-21 13:14:33 -04001376 ]
1377 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001378 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001379 sources = [
1380 "bench/nanobench.cpp",
1381 ]
1382 deps = [
1383 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001384 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001385 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001386 ":flags",
1387 ":gm",
1388 ":gpu_tool_utils",
1389 ":skia",
1390 ":tool_utils",
1391 "//third_party/jsoncpp",
1392 ]
mtklein2b6870c2016-07-28 14:17:33 -07001393 }
halcanary19a97202016-08-03 15:08:04 -07001394
Ravi Mistry10d36c52017-01-31 09:49:18 -05001395 test_app("skpinfo") {
1396 sources = [
1397 "tools/skpinfo.cpp",
1398 ]
1399 deps = [
1400 ":flags",
1401 ":skia",
1402 ]
1403 }
1404
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001405 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001406 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001407 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001408 "samplecode/SampleApp.cpp",
1409 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001410 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001411 if (is_mac) {
1412 sources += [ "src/views/mac/skia_mac.mm" ]
1413 } else if (is_win) {
1414 sources += [ "src/views/win/skia_win.cpp" ]
1415 } else if (is_linux) {
1416 sources += [ "src/views/unix/skia_unix.cpp" ]
1417 }
mtklein38925aa2016-09-21 10:11:25 -07001418 deps = [
1419 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001420 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001421 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001422 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001423 ":skia",
1424 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001425 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001426 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001427 if (skia_use_angle) {
1428 deps += [ "//third_party/angle2" ]
1429 }
mtklein38925aa2016-09-21 10:11:25 -07001430 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001431 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001432
Jim Van Verthc1720d42017-10-09 10:16:01 -04001433 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
1434 test_app("HelloWorld") {
1435 sources = [
1436 "example/HelloWorld.cpp",
1437 ]
1438 if (is_mac) {
1439 sources += [ "src/views/mac/skia_mac.mm" ]
1440 } else if (is_win) {
1441 sources += [ "src/views/win/skia_win.cpp" ]
1442 } else if (is_linux) {
1443 sources += [ "src/views/unix/skia_unix.cpp" ]
1444 }
1445 deps = [
1446 ":gpu_tool_utils",
1447 ":skia",
1448 ":views",
1449 ]
1450 }
1451 }
1452
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001453 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001454 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001455 sources = [
1456 "tools/skpbench/skpbench.cpp",
1457 ]
1458 deps = [
1459 ":flags",
1460 ":gpu_tool_utils",
1461 ":skia",
1462 ":tool_utils",
1463 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001464 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001465 }
1466
Mike Klein7d302882016-11-03 14:06:31 -04001467 # We can't yet build ICU on iOS or Windows.
Kevin Lubickebf648e2017-09-21 13:45:16 -04001468 if (!is_ios && !is_win && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001469 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001470 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001471 "tools/shape/SkShaper_harfbuzz.cpp",
1472 "tools/shape/using_skia_and_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001473 ]
1474 deps = [
1475 ":skia",
1476 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001477 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001478 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001479 }
halcanary19a97202016-08-03 15:08:04 -07001480 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001481 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001482 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001483 "tools/shape/SkShaper_primitive.cpp",
1484 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001485 ]
1486 deps = [
1487 ":skia",
1488 ]
halcanary3eee9d92016-09-10 07:01:53 -07001489 }
mtklein046cb562016-09-16 10:23:12 -07001490
Matt Sarett9f1c4032017-05-17 10:06:32 -04001491 test_app("create_flutter_test_images") {
1492 sources = [
1493 "tools/create_flutter_test_images.cpp",
1494 ]
1495 deps = [
1496 ":skia",
1497 ":tool_utils",
1498 ]
1499 }
1500
Ben Wagner219f3622017-07-17 15:32:25 -04001501 test_app("create_test_font") {
1502 sources = [
1503 "tools/create_test_font.cpp",
1504 ]
1505 deps = [
1506 ":skia",
1507 ]
1508 assert_no_deps = [
1509 # tool_utils requires the output of this app.
1510 ":tool_utils",
1511 ]
1512 }
1513
Mike Kleine6682eb2017-01-05 10:54:57 -05001514 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001515 sources = [
1516 "tools/get_images_from_skps.cpp",
1517 ]
1518 deps = [
1519 ":flags",
1520 ":skia",
1521 "//third_party/jsoncpp",
1522 ]
mtklein046cb562016-09-16 10:23:12 -07001523 }
mtkleinecbc5262016-09-22 11:51:24 -07001524
Mike Kleine6682eb2017-01-05 10:54:57 -05001525 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001526 sources = [
1527 "tools/colorspaceinfo.cpp",
1528 ]
1529 deps = [
1530 ":flags",
1531 ":skia",
1532 ":tool_utils",
1533 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001534 }
1535
Kevin Lubickebf648e2017-09-21 13:45:16 -04001536 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001537 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001538 sources = [
1539 "tools/skiaserve/Request.cpp",
1540 "tools/skiaserve/Response.cpp",
1541 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001542 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1543 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1544 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1545 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1546 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1547 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1548 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1549 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1550 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001551 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1552 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001553 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1554 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1555 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1556 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1557 ]
1558 deps = [
1559 ":flags",
1560 ":gpu_tool_utils",
1561 ":skia",
1562 ":tool_utils",
1563 "//third_party/jsoncpp",
1564 "//third_party/libmicrohttpd",
1565 "//third_party/libpng",
1566 ]
Mike Klein7d302882016-11-03 14:06:31 -04001567 }
mtkleinecbc5262016-09-22 11:51:24 -07001568 }
kjlubick14f984b2016-10-03 11:49:45 -07001569
Mike Kleine6682eb2017-01-05 10:54:57 -05001570 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001571 sources = [
1572 "fuzz/FilterFuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001573 "fuzz/FuzzCanvas.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001574 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001575 "fuzz/FuzzGradients.cpp",
1576 "fuzz/FuzzParsePath.cpp",
1577 "fuzz/FuzzPathop.cpp",
1578 "fuzz/FuzzScaleToSides.cpp",
1579 "fuzz/fuzz.cpp",
1580 ]
1581 deps = [
1582 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001583 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001584 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001585 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001586 ]
kjlubick14f984b2016-10-03 11:49:45 -07001587 }
Mike Klein38312422016-10-05 15:41:01 -04001588
Mike Kleine6682eb2017-01-05 10:54:57 -05001589 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001590 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001591 rebase_path("tests/skia_test.cpp"),
1592 rebase_path("tests/Test.cpp"),
1593 ]
caryclark9feb6322016-10-25 08:58:26 -07001594 deps = [
1595 ":flags",
1596 ":gpu_tool_utils",
1597 ":skia",
1598 ":tool_utils",
1599 ]
caryclark9feb6322016-10-25 08:58:26 -07001600 }
1601
Mike Kleine6682eb2017-01-05 10:54:57 -05001602 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001603 sources = [
1604 "tools/DumpRecord.cpp",
1605 "tools/dump_record.cpp",
1606 ]
1607 deps = [
1608 ":flags",
1609 ":skia",
1610 ]
Mike Klein38312422016-10-05 15:41:01 -04001611 }
bungemanfe917272016-10-13 17:36:40 -04001612
Mike Kleine6682eb2017-01-05 10:54:57 -05001613 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001614 sources = [
1615 "tools/skdiff/skdiff.cpp",
1616 "tools/skdiff/skdiff_html.cpp",
1617 "tools/skdiff/skdiff_main.cpp",
1618 "tools/skdiff/skdiff_utils.cpp",
1619 ]
1620 deps = [
1621 ":skia",
1622 ":tool_utils",
1623 ]
bungemanfe917272016-10-13 17:36:40 -04001624 }
halcanarya73d76a2016-10-17 13:19:02 -07001625
Mike Kleine6682eb2017-01-05 10:54:57 -05001626 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001627 sources = [
1628 "tools/skp_parser.cpp",
1629 ]
1630 deps = [
1631 ":skia",
1632 ":tool_utils",
1633 "//third_party/jsoncpp",
1634 ]
halcanarya73d76a2016-10-17 13:19:02 -07001635 }
Brian Osman16adfa32016-10-18 14:42:44 -04001636
Hal Canary75427132017-10-11 16:00:31 -04001637 if (!is_win) {
1638 test_app("gpucts") {
1639 sources = [
1640 "dm/DMGpuTestProcs.cpp",
1641 "tools/gpucts/gm_knowledge.c",
1642 "tools/gpucts/gm_runner.cpp",
1643 "tools/gpucts/gpucts.cpp",
1644 ]
1645 deps = [
1646 ":gm",
1647 ":gpu_tool_utils",
1648 ":skia",
1649 ":tests",
1650 "//third_party/googletest",
1651 ]
1652 }
1653 }
1654
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001655 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001656 test_app("viewer") {
1657 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001658 sources = [
1659 "tools/viewer/GMSlide.cpp",
1660 "tools/viewer/ImageSlide.cpp",
1661 "tools/viewer/SKPSlide.cpp",
1662 "tools/viewer/SampleSlide.cpp",
1663 "tools/viewer/Viewer.cpp",
1664 "tools/viewer/sk_app/CommandSet.cpp",
1665 "tools/viewer/sk_app/GLWindowContext.cpp",
1666 "tools/viewer/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001667 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001668 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001669
Jim Van Verth4e56a912016-10-21 10:58:52 -04001670 if (is_android) {
1671 sources += [
1672 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1673 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1674 "tools/viewer/sk_app/android/Window_android.cpp",
1675 "tools/viewer/sk_app/android/main_android.cpp",
1676 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1677 ]
Brian Osman462334e2017-02-09 11:22:57 -05001678 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001679 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001680 sources += [
1681 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1682 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1683 "tools/viewer/sk_app/unix/Window_unix.cpp",
1684 "tools/viewer/sk_app/unix/main_unix.cpp",
1685 ]
1686 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001687 sources += [
1688 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1689 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1690 "tools/viewer/sk_app/win/Window_win.cpp",
1691 "tools/viewer/sk_app/win/main_win.cpp",
1692 ]
Brian Salomon194db172017-08-17 14:37:06 -04001693 if (skia_use_angle) {
1694 sources += [ "tools/viewer/sk_app/win/ANGLEWindowContext_win.cpp" ]
1695 }
Mike Klein43c25262016-10-20 10:17:47 -04001696 } else if (is_mac) {
1697 sources += [
1698 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1699 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1700 "tools/viewer/sk_app/mac/Window_mac.cpp",
1701 "tools/viewer/sk_app/mac/main_mac.cpp",
1702 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001703 } else if (is_ios) {
1704 sources += [
1705 "tools/viewer/sk_app/ios/GLWindowContext_ios.cpp",
1706 "tools/viewer/sk_app/ios/RasterWindowContext_ios.cpp",
1707 "tools/viewer/sk_app/ios/Window_ios.cpp",
1708 "tools/viewer/sk_app/ios/main_ios.cpp",
1709 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001710 }
1711
1712 if (skia_use_vulkan) {
1713 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001714 if (is_android) {
1715 sources +=
1716 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001717 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001718 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1719 libs += [ "X11-xcb" ]
1720 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001721 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1722 }
1723 }
1724
1725 include_dirs = []
1726 deps = [
1727 ":flags",
1728 ":gm",
1729 ":gpu_tool_utils",
1730 ":samples",
1731 ":skia",
1732 ":tool_utils",
1733 ":views",
Brian Osman79086b92017-02-10 13:36:16 -05001734 "//third_party/imgui",
Brian Osman16adfa32016-10-18 14:42:44 -04001735 "//third_party/jsoncpp",
1736 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001737 if (is_android) {
1738 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001739 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04001740 deps += [ "//third_party/libsdl" ]
1741 }
Brian Salomon194db172017-08-17 14:37:06 -04001742 if (skia_use_angle) {
1743 deps += [ "//third_party/angle2" ]
1744 }
Mike Kleina92c3832016-12-08 09:49:39 -05001745 }
Brian Osman16adfa32016-10-18 14:42:44 -04001746 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001747
Jim Van Verthecfed2b2017-08-30 14:02:50 -04001748 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04001749 test_app("SkiaSDLExample") {
1750 sources = [
1751 "example/SkiaSDLExample.cpp",
1752 ]
1753 libs = []
1754 include_dirs = []
1755 deps = [
1756 ":gpu_tool_utils",
1757 ":skia",
1758 "//third_party/libsdl",
1759 ]
1760 }
1761 }
1762
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001763 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
1764 action_foreach("generate_mocs") {
1765 script = "gn/call.py"
1766 sources = [
1767 "tools/mdbviz/MainWindow.h",
1768 ]
1769 outputs = [
1770 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
1771 ]
1772 args = [
1773 "$skia_qt_path" + "/bin/moc",
1774 "{{source}}",
1775 "-o",
1776 "gen/mdbviz/{{source_name_part}}_moc.cpp",
1777 ]
1778 }
1779 action_foreach("generate_resources") {
1780 script = "gn/call.py"
1781 sources = [
1782 "tools/mdbviz/resources.qrc",
1783 ]
1784 outputs = [
1785 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
1786 ]
1787 args = [
1788 "$skia_qt_path" + "/bin/rcc",
1789 "{{source}}",
1790 "-o",
1791 "gen/mdbviz/{{source_name_part}}_res.cpp",
1792 ]
1793 }
1794 test_app("mdbviz") {
1795 if (is_win) {
1796 # on Windows we need to disable some exception handling warnings due to the Qt headers
1797 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
1798 }
1799 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001800 "tools/UrlDataManager.cpp",
1801 "tools/debugger/SkDebugCanvas.cpp",
1802 "tools/debugger/SkDrawCommand.cpp",
1803 "tools/debugger/SkJsonWriteBuffer.cpp",
1804 "tools/debugger/SkObjectParser.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001805 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04001806 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001807 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001808 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001809
1810 # generated files
1811 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
1812 "$target_gen_dir/mdbviz/resources_res.cpp",
1813 ]
1814 lib_dirs = [ "$skia_qt_path/lib" ]
1815 libs = [
1816 "Qt5Core.lib",
1817 "Qt5Gui.lib",
1818 "Qt5Widgets.lib",
1819 ]
1820 include_dirs = [
1821 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04001822 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001823 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001824 "tools",
1825 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001826 ]
1827 deps = [
1828 ":generate_mocs",
1829 ":generate_resources",
1830 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001831 "//third_party/jsoncpp",
1832 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001833 ]
1834 }
1835 }
1836
Mike Kleine459afd2017-03-03 09:21:30 -05001837 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05001838 copy("gdbserver") {
1839 sources = [
1840 "$ndk/$ndk_gdbserver",
1841 ]
1842 outputs = [
1843 "$root_out_dir/gdbserver",
1844 ]
1845 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05001846 }
mtklein25c81d42016-07-27 13:55:26 -07001847}
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001848
1849if (skia_jumper_clang != "") {
1850 action("regen_jumper") {
1851 script = "src/jumper/build_stages.py"
1852
1853 inputs = [
1854 "src/jumper/SkJumper_stages.cpp",
Mike Klein9b2f69b2017-09-12 16:40:53 -04001855 "src/jumper/SkJumper_stages_lowp.cpp",
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001856 ]
1857
1858 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it.
1859 outputs = [
1860 "$target_out_dir/" +
1861 rebase_path("src/jumper/SkJumper_generated.S", target_out_dir),
1862 "$target_out_dir/" +
1863 rebase_path("src/jumper/SkJumper_generated_win.S", target_out_dir),
1864 ]
1865
1866 args = [
1867 skia_jumper_clang,
1868 skia_jumper_objdump,
1869 skia_jumper_ccache,
1870 ] + rebase_path(inputs) + rebase_path(outputs)
1871 }
1872}