blob: f629c678347ae0afb46193b8978acc9e84a18f9c [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
Mike Klein10d665d2016-11-01 11:46:10 -040030 skia_use_piex = !is_win
mtklein63213812016-08-24 09:55:56 -070031 skia_use_zlib = true
Greg Daniele5ddff52017-07-05 16:49:36 -040032 skia_use_metal = false
Mike Klein36f182f2017-10-20 12:33:53 -040033 skia_use_libheif = is_skia_dev_build
mtklein1bd72ba2016-09-16 07:45:52 -070034
Mike Klein7d921032017-01-05 12:20:41 -050035 skia_android_serial = ""
Brian Osman3f375d02016-12-28 11:19:22 -050036 skia_enable_discrete_gpu = true
Mike Kleina04bb452017-02-09 12:24:07 -050037 skia_enable_effects = true
Brian Osmanf2c90142017-07-13 15:50:03 -040038 skia_enable_flutter_defines = false
mtklein06c35c02016-09-20 12:28:12 -070039 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050040 skia_enable_pdf = true
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -040041 skia_enable_spirv_validation = is_skia_dev_build && is_debug
Mike Klein3669a822017-03-03 10:55:02 -050042 skia_enable_tools = is_skia_dev_build
43 skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
Greg Daniel686bb212016-10-27 10:48:48 -040044 skia_vulkan_sdk = getenv("VULKAN_SDK")
Robert Phillipsa6d2d702017-09-01 12:17:03 -040045 skia_qt_path = getenv("QT_PATH")
Ethan Nicholas762466e2017-06-29 10:03:38 -040046 skia_compile_processors = false
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070047 skia_lex = 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
Adam Barth54ef74a2017-10-13 10:59:38 -070077if (defined(skia_settings)) {
78 import(skia_settings)
79}
80
mtklein38925aa2016-09-21 10:11:25 -070081# Our tools require static linking (they use non-exported symbols).
82skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070083
mtkleina45be612016-08-29 15:22:10 -070084fontmgr_android_enabled = skia_use_expat && skia_use_freetype
85
mtklein1211e0c2016-07-26 13:55:45 -070086skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070087 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070088 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070089 "include/codec",
90 "include/config",
91 "include/core",
92 "include/effects",
Matt Sarett94fd06f2017-05-08 17:31:00 -040093 "include/encode",
mtklein1211e0c2016-07-26 13:55:45 -070094 "include/gpu",
95 "include/gpu/gl",
mtklein1211e0c2016-07-26 13:55:45 -070096 "include/pathops",
97 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070098 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070099 "include/utils",
100 "include/utils/mac",
mtklein1211e0c2016-07-26 13:55:45 -0700101]
102
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000103if (skia_use_vulkan) {
104 skia_public_includes += [ "include/gpu/vk" ]
105}
Greg Daniele5ddff52017-07-05 16:49:36 -0400106if (skia_use_metal) {
107 skia_public_includes += [ "include/gpu/mtl" ]
108}
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000109
mtkleinc04ff472016-06-23 10:29:30 -0700110# Skia public API, generally provided by :skia.
111config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -0700112 include_dirs = skia_public_includes
Greg Danielec6ae522017-04-25 13:38:26 -0400113 if (skia_vulkan_headers != "") {
114 include_dirs += [ skia_vulkan_headers ]
115 }
Mike Kleinae7e6712016-10-11 17:49:33 -0400116 defines = []
117 if (is_component_build) {
118 defines += [ "SKIA_DLL" ]
119 }
Mike Kleinc4cbd742016-09-26 21:37:09 -0400120 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -0700121 defines += [ "SK_SAMPLES_FOR_X" ]
122 }
Brian Osmanf2c90142017-07-13 15:50:03 -0400123 if (skia_enable_flutter_defines) {
124 defines += flutter_defines
125 }
mtklein06c35c02016-09-20 12:28:12 -0700126 if (!skia_enable_gpu) {
127 defines += [ "SK_SUPPORT_GPU=0" ]
128 }
mtkleinc04ff472016-06-23 10:29:30 -0700129}
130
131# Skia internal APIs, used by Skia itself and a few test tools.
132config("skia_private") {
133 visibility = [ ":*" ]
134
135 include_dirs = [
136 "include/private",
137 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -0700138 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700139 "src/core",
140 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700141 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700142 "src/image",
143 "src/images",
144 "src/lazy",
145 "src/opts",
146 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700147 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700148 "src/ports",
149 "src/sfnt",
Florin Malita5edba452017-05-30 16:39:47 -0400150 "src/shaders",
151 "src/shaders/gradients",
mtklein9e0d9dd2016-08-30 10:37:19 -0700152 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700153 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700154 "src/utils/win",
Herb Derby5a8fe972017-02-14 14:42:30 -0500155 "src/xml",
scroggo19b91532016-10-24 09:03:26 -0700156 "third_party/gif",
mtkleinc04ff472016-06-23 10:29:30 -0700157 ]
mtklein150d1132016-08-01 06:56:40 -0700158
Mike Reeda9e241d2017-05-03 10:52:00 -0400159 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700160 if (is_android) {
161 defines += [
162 "SK_GAMMA_EXPONENT=1.4",
163 "SK_GAMMA_CONTRAST=0.0",
164 ]
165 }
mtklein88a7ac02016-09-14 11:16:49 -0700166 if (is_official_build || is_android) {
167 # TODO(bsalomon): it'd be nice to make Android normal.
168 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
169 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400170 libs = []
171 lib_dirs = []
Brian Salomon03e05842017-02-23 12:23:47 -0500172 if (skia_enable_gpu) {
173 include_dirs += [ "src/gpu" ]
174 }
Brian Osman34755e22016-12-05 09:46:02 -0500175 if (skia_use_angle) {
176 defines += [ "SK_ANGLE" ]
177 }
Brian Osman3f375d02016-12-28 11:19:22 -0500178 if (skia_enable_discrete_gpu) {
179 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
180 }
Brian Salomon0c26a9d2017-07-06 10:09:38 -0400181 if (!is_official_build) {
182 defines += [ "GR_TEST_UTILS=1" ]
183 }
mtkleinc04ff472016-06-23 10:29:30 -0700184}
185
186# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
187config("skia_library") {
188 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700189 defines = [ "SKIA_IMPLEMENTATION=1" ]
190}
191
192skia_library_configs = [
193 ":skia_public",
194 ":skia_private",
195 ":skia_library",
196]
197
mtklein9b8583d2016-08-24 17:32:30 -0700198# Use for CPU-specific Skia code that needs particular compiler flags.
199template("opts") {
200 if (invoker.enabled) {
201 source_set(target_name) {
202 forward_variables_from(invoker, "*")
203 configs += skia_library_configs
204 }
205 } else {
206 # If not enabled, a phony empty target that swallows all otherwise unused variables.
207 source_set(target_name) {
208 forward_variables_from(invoker,
209 "*",
210 [
211 "sources",
212 "cflags",
213 ])
214 }
215 }
anmittala7eaf2e2016-08-17 13:57:26 -0700216}
217
mtklein422310d2016-08-16 18:28:43 -0700218is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700219
mtklein7d6fb2c2016-08-25 14:50:44 -0700220opts("none") {
221 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700222 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700223 cflags = []
224}
225
mtklein7d6fb2c2016-08-25 14:50:44 -0700226opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700227 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700228 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700229 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700230}
231
232opts("arm64") {
233 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700234 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700235 cflags = []
236}
237
238opts("crc32") {
239 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700240 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700241 cflags = [ "-march=armv8-a+crc" ]
242}
243
mtklein9b8583d2016-08-24 17:32:30 -0700244opts("sse2") {
245 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700246 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400247 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400248 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
249 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400250 cflags = [ "-msse2" ]
251 }
mtklein9b8583d2016-08-24 17:32:30 -0700252}
mtkleinc04ff472016-06-23 10:29:30 -0700253
mtklein9b8583d2016-08-24 17:32:30 -0700254opts("ssse3") {
255 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700256 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400257 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400258 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
259 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400260 cflags = [ "-mssse3" ]
261 }
mtklein9b8583d2016-08-24 17:32:30 -0700262}
mtkleinc04ff472016-06-23 10:29:30 -0700263
mtklein9b8583d2016-08-24 17:32:30 -0700264opts("sse41") {
265 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700266 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400267 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400268 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
269 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400270 cflags = [ "-msse4.1" ]
271 }
mtklein9b8583d2016-08-24 17:32:30 -0700272}
mtklein4e976072016-08-08 09:06:27 -0700273
mtklein9b8583d2016-08-24 17:32:30 -0700274opts("sse42") {
275 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700276 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400277 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400278 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
279 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400280 cflags = [ "-msse4.2" ]
281 }
mtklein9b8583d2016-08-24 17:32:30 -0700282}
283
284opts("avx") {
285 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700286 sources = skia_opts.avx_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400287 if (!is_clang && is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000288 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400289 } else {
290 cflags = [ "-mavx" ]
291 }
mtkleinc04ff472016-06-23 10:29:30 -0700292}
293
mtkleinc095df52016-08-24 12:23:52 -0700294# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700295template("optional") {
296 if (invoker.enabled) {
297 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700298 if (defined(invoker.public_defines)) {
299 defines = invoker.public_defines
300 }
mtklein457b42a2016-08-23 13:56:37 -0700301 }
302 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700303 forward_variables_from(invoker,
304 "*",
305 [
306 "public_defines",
307 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700308 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700309 ])
mtklein457b42a2016-08-23 13:56:37 -0700310 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700311 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700312 if (defined(invoker.configs_to_remove)) {
313 configs -= invoker.configs_to_remove
314 }
mtklein457b42a2016-08-23 13:56:37 -0700315 }
316 } else {
mtklein457b42a2016-08-23 13:56:37 -0700317 source_set(target_name) {
318 forward_variables_from(invoker,
319 "*",
320 [
321 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700322 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700323 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700324 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700325 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700326 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700327 ])
mtkleincd01b032016-08-31 04:58:19 -0700328 if (defined(invoker.sources_when_disabled)) {
329 sources = invoker.sources_when_disabled
330 }
331 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700332 }
mtkleineb3c4252016-08-23 07:38:09 -0700333 }
mtklein457b42a2016-08-23 13:56:37 -0700334}
mtklein457b42a2016-08-23 13:56:37 -0700335
Mike Kleina04bb452017-02-09 12:24:07 -0500336optional("effects") {
337 enabled = skia_enable_effects
Ethan Nicholas762466e2017-06-29 10:03:38 -0400338 deps = [
339 ":compile_processors",
340 ]
Mike Kleina04bb452017-02-09 12:24:07 -0500341 sources =
342 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
343 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
344}
345
mtkleina45be612016-08-29 15:22:10 -0700346optional("fontmgr_android") {
347 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700348
349 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500350 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700351 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700352 ]
353 sources = [
354 "src/ports/SkFontMgr_android.cpp",
355 "src/ports/SkFontMgr_android_factory.cpp",
356 "src/ports/SkFontMgr_android_parser.cpp",
357 ]
358}
359
mtkleind2e39db2016-09-07 07:52:55 -0700360optional("fontmgr_custom") {
361 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
362
363 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500364 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700365 ]
366 sources = [
367 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500368 "src/ports/SkFontMgr_custom.h",
369 "src/ports/SkFontMgr_custom_directory.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700370 "src/ports/SkFontMgr_custom_directory_factory.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500371 "src/ports/SkFontMgr_custom_embedded.cpp",
372 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleind2e39db2016-09-07 07:52:55 -0700373 ]
374}
375
mtklein3cc22182016-08-29 13:26:14 -0700376optional("fontmgr_fontconfig") {
377 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700378
379 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500380 ":typeface_freetype",
mtklein3cc22182016-08-29 13:26:14 -0700381 "//third_party:fontconfig",
mtklein3cc22182016-08-29 13:26:14 -0700382 ]
383 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700384 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700385 "src/ports/SkFontConfigInterface_direct.cpp",
386 "src/ports/SkFontConfigInterface_direct_factory.cpp",
387 "src/ports/SkFontMgr_FontConfigInterface.cpp",
388 "src/ports/SkFontMgr_fontconfig.cpp",
389 "src/ports/SkFontMgr_fontconfig_factory.cpp",
390 ]
391}
392
mtkleincdedd0e2016-09-12 15:15:44 -0700393optional("fontmgr_fuchsia") {
394 enabled = is_fuchsia && skia_use_freetype
395
396 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500397 ":typeface_freetype",
mtkleincdedd0e2016-09-12 15:15:44 -0700398 ]
399 sources = [
400 "src/ports/SkFontMgr_custom.cpp",
Ben Wagner8ab590f2017-02-08 17:29:33 -0500401 "src/ports/SkFontMgr_custom_empty.cpp",
mtkleincdedd0e2016-09-12 15:15:44 -0700402 "src/ports/SkFontMgr_custom_empty_factory.cpp",
403 ]
404}
405
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700406if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400407 executable("sksllex") {
408 sources = [
409 "src/sksl/lex/Main.cpp",
410 "src/sksl/lex/NFA.cpp",
411 "src/sksl/lex/RegexNode.cpp",
412 "src/sksl/lex/RegexParser.cpp",
413 ]
414 include_dirs = [ "src/sksl/lex" ]
415 }
416
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700417 action("run_sksllex") {
418 script = "gn/run_sksllex.py"
Ethan Nicholase148bf72017-10-06 14:22:22 -0400419 deps = [
420 ":sksllex(//gn/toolchain:$host_toolchain)",
421 ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700422 sources = [
423 "src/sksl/lex/layout.lex",
424 "src/sksl/lex/sksl.lex",
425 ]
426
427 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
428 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
429 outputs = [
430 "$target_out_dir/" +
431 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
432 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
433 # confused due to the same file being named by two different paths
434 ]
435 sksllex_path = "$root_out_dir/"
436 sksllex_path += "sksllex"
437 if (host_os == "win") {
438 sksllex_path += ".exe"
439 }
440 args = [
441 rebase_path(sksllex_path),
442 rebase_path("bin/clang-format"),
443 rebase_path("src"),
444 ]
445 }
446} else {
447 group("run_sksllex") {
448 }
449}
450
451if (skia_compile_processors) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400452 executable("skslc") {
453 defines = [ "SKSL_STANDALONE" ]
454 sources = [
455 "src/sksl/SkSLMain.cpp",
456 ]
457 sources += skia_sksl_sources
458 include_dirs = [
459 "src/gpu",
460 "src/sksl",
461 ]
462 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500463 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400464 "//third_party/spirv-tools",
465 ]
466 }
467
468 skia_gpu_processor_outputs = []
469 foreach(src, skia_gpu_processor_sources) {
470 dir = get_path_info(src, "dir")
471 name = get_path_info(src, "name")
472
473 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
474 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
475 skia_gpu_processor_outputs += [
476 "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir),
477 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
478 # confused due to the same file being named by two different paths
479 ]
480 }
481
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500482 action("create_sksl_enums") {
483 script = "gn/create_sksl_enums.py"
484 sources = [
485 "include/private/GrSharedEnums.h",
486 ]
487 outputs = [
488 "$target_out_dir/" +
489 rebase_path("src/sksl/sksl_enums.include", target_out_dir),
490 ]
491 args = [
492 rebase_path(sources[0]),
493 rebase_path(outputs[0]),
494 ]
495 }
496
Ethan Nicholas762466e2017-06-29 10:03:38 -0400497 action("compile_processors") {
498 script = "gn/compile_processors.py"
499 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500500 ":create_sksl_enums",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400501 ":skslc(//gn/toolchain:$host_toolchain)",
502 ]
503 sources = skia_gpu_processor_sources
504 outputs = skia_gpu_processor_outputs
505 skslc_path = "$root_out_dir/"
506 if (host_toolchain != default_toolchain_name) {
507 skslc_path += "$host_toolchain/"
508 }
509 skslc_path += "skslc"
510 if (host_os == "win") {
511 skslc_path += ".exe"
512 }
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400513 args = [
514 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400515 rebase_path("bin/clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400516 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400517 args += rebase_path(skia_gpu_processor_sources)
518 }
519} else {
520 skia_gpu_processor_outputs = []
521 group("compile_processors") {
522 }
523}
524
mtklein06c35c02016-09-20 12:28:12 -0700525optional("gpu") {
526 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400527 deps = [
528 ":compile_processors",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700529 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400530 ]
mtkleine9fb3d52016-09-20 15:11:46 -0700531 public_defines = []
532
Mike Klein29b3e582017-02-09 11:57:32 -0500533 sources = skia_gpu_sources + skia_sksl_sources +
Ethan Nicholas762466e2017-06-29 10:03:38 -0400534 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] +
535 skia_gpu_processor_outputs
mtklein06c35c02016-09-20 12:28:12 -0700536
537 # These paths need to be absolute to match the ones produced by shared_sources.gni.
538 sources -= get_path_info([
539 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
540 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
541 ],
542 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400543 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700544 if (is_android) {
545 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
Derek Sollenberger7a869872017-06-27 15:37:25 -0400546
547 # this lib is required to link against AHardwareBuffer
548 if (defined(ndk_api) && ndk_api >= 26) {
549 libs += [ "android" ]
550 }
Kevin Lubick4a24e102017-03-29 11:19:01 -0400551 } else if (skia_use_egl) {
552 sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
553 libs += [ "EGL" ]
mtklein06c35c02016-09-20 12:28:12 -0700554 } else if (is_linux) {
555 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -0500556 libs += [
557 "GL",
558 "GLU",
559 ]
mtklein06c35c02016-09-20 12:28:12 -0700560 } else if (is_mac) {
561 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800562 } else if (is_ios) {
563 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400564 } else if (is_win) {
565 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
566 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700567 } else {
568 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
569 }
mtkleine9fb3d52016-09-20 15:11:46 -0700570
571 if (skia_use_vulkan) {
572 public_defines += [ "SK_VULKAN" ]
573 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700574 if (skia_enable_vulkan_debug_layers) {
575 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
576 }
mtkleine9fb3d52016-09-20 15:11:46 -0700577 }
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400578 if (skia_enable_spirv_validation) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400579 deps += [ "//third_party/spirv-tools" ]
Ethan Nicholasa6ae1f72017-03-16 09:56:54 -0400580 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
581 }
Greg Daniele5ddff52017-07-05 16:49:36 -0400582
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400583 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400584 if (skia_use_metal) {
585 public_defines += [ "SK_METAL" ]
586 sources += skia_metal_sources
587 libs += [ "Metal.framework" ]
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400588 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400589 }
mtklein06c35c02016-09-20 12:28:12 -0700590}
591
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400592optional("heif") {
593 enabled = skia_use_libheif
594 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
595
596 deps = []
597
598 sources = [
599 "src/codec/SkHeifCodec.cpp",
600 ]
601}
602
mtklein63213812016-08-24 09:55:56 -0700603optional("jpeg") {
604 enabled = skia_use_libjpeg_turbo
605 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
606
mtklein63213812016-08-24 09:55:56 -0700607 deps = [
608 "//third_party/libjpeg-turbo:libjpeg",
609 ]
610 sources = [
611 "src/codec/SkJpegCodec.cpp",
612 "src/codec/SkJpegDecoderMgr.cpp",
613 "src/codec/SkJpegUtility.cpp",
mtklein63213812016-08-24 09:55:56 -0700614 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400615 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700616 ]
617}
618
619optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500620 enabled = skia_use_zlib && skia_enable_pdf
621 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700622
mtklein63213812016-08-24 09:55:56 -0700623 deps = [
624 "//third_party/zlib",
625 ]
brettwb9447282016-09-01 14:24:39 -0700626 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700627 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700628
629 if (skia_use_sfntly) {
630 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500631 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700632 }
633}
634
635optional("png") {
636 enabled = skia_use_libpng
637 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
638
mtklein63213812016-08-24 09:55:56 -0700639 deps = [
640 "//third_party/libpng",
641 ]
642 sources = [
643 "src/codec/SkIcoCodec.cpp",
644 "src/codec/SkPngCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400645 "src/images/SkPngEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700646 ]
647}
648
scroggof84ad642016-10-31 09:02:57 -0700649optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400650 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700651 public_defines = [ "SK_CODEC_DECODES_RAW" ]
652
653 deps = [
654 "//third_party/dng_sdk",
655 "//third_party/libjpeg-turbo:libjpeg",
656 "//third_party/piex",
657 ]
658
659 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
660 # Skia.
661 configs_to_remove = [ "//gn:no_exceptions" ]
662
663 sources = [
664 "src/codec/SkRawAdapterCodec.cpp",
665 "src/codec/SkRawCodec.cpp",
666 ]
667}
668
mtklein3cc22182016-08-29 13:26:14 -0700669optional("typeface_freetype") {
670 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700671
672 deps = [
673 "//third_party/freetype2",
674 ]
675 sources = [
676 "src/ports/SkFontHost_FreeType.cpp",
677 "src/ports/SkFontHost_FreeType_common.cpp",
678 ]
679}
680
mtklein457b42a2016-08-23 13:56:37 -0700681optional("webp") {
682 enabled = skia_use_libwebp
683 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
684
mtklein457b42a2016-08-23 13:56:37 -0700685 deps = [
686 "//third_party/libwebp",
687 ]
688 sources = [
689 "src/codec/SkWebpAdapterCodec.cpp",
690 "src/codec/SkWebpCodec.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400691 "src/images/SkWebpEncoder.cpp",
mtklein457b42a2016-08-23 13:56:37 -0700692 ]
mtkleineb3c4252016-08-23 07:38:09 -0700693}
694
mtklein63213812016-08-24 09:55:56 -0700695optional("xml") {
696 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000697 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700698
mtklein63213812016-08-24 09:55:56 -0700699 deps = [
700 "//third_party/expat",
701 ]
702 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -0500703 "src/svg/SkSVGCanvas.cpp",
704 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -0700705 "src/xml/SkDOM.cpp",
706 "src/xml/SkXMLParser.cpp",
707 "src/xml/SkXMLWriter.cpp",
708 ]
709}
710
mtkleinc04ff472016-06-23 10:29:30 -0700711component("skia") {
712 public_configs = [ ":skia_public" ]
713 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700714
715 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700716 ":arm64",
717 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700718 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700719 ":crc32",
Mike Kleina04bb452017-02-09 12:24:07 -0500720 ":effects",
mtkleina45be612016-08-29 15:22:10 -0700721 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700722 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700723 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700724 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700725 ":gpu",
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400726 ":heif",
mtklein63213812016-08-24 09:55:56 -0700727 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700728 ":none",
mtklein63213812016-08-24 09:55:56 -0700729 ":pdf",
730 ":png",
scroggof84ad642016-10-31 09:02:57 -0700731 ":raw",
mtklein9b8583d2016-08-24 17:32:30 -0700732 ":sse2",
733 ":sse41",
734 ":sse42",
735 ":ssse3",
mtkleineb3c4252016-08-23 07:38:09 -0700736 ":webp",
mtklein63213812016-08-24 09:55:56 -0700737 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700738 ]
739
Chinmay Garde43f115c2016-11-16 15:04:12 -0800740 # This file (and all GN files in Skia) are designed to work with an
741 # empty sources assignment filter; we handle all that explicitly.
742 # We clear the filter here for clients who may have set up a global filter.
743 set_sources_assignment_filter([])
744
mtkleinc04ff472016-06-23 10:29:30 -0700745 sources = []
brettwb9447282016-09-01 14:24:39 -0700746 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -0700747 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500748 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700749 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -0400750 "src/android/SkAndroidFrameworkUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700751 "src/android/SkBitmapRegionCodec.cpp",
752 "src/android/SkBitmapRegionDecoder.cpp",
753 "src/codec/SkAndroidCodec.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -0400754 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700755 "src/codec/SkBmpCodec.cpp",
756 "src/codec/SkBmpMaskCodec.cpp",
757 "src/codec/SkBmpRLECodec.cpp",
758 "src/codec/SkBmpStandardCodec.cpp",
759 "src/codec/SkCodec.cpp",
760 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700761 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700762 "src/codec/SkMaskSwizzler.cpp",
763 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700764 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700765 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700766 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700767 "src/codec/SkSwizzler.cpp",
768 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700769 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700770 "src/ports/SkDiscardableMemory_none.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700771 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700772 "src/ports/SkMemory_malloc.cpp",
773 "src/ports/SkOSFile_stdio.cpp",
774 "src/sfnt/SkOTTable_name.cpp",
775 "src/sfnt/SkOTUtils.cpp",
776 "src/utils/mac/SkStream_mac.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700777 "third_party/gif/SkGifImageReader.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700778 ]
brettwb9447282016-09-01 14:24:39 -0700779
mtklein7d6fb2c2016-08-25 14:50:44 -0700780 libs = []
781
mtkleinc04ff472016-06-23 10:29:30 -0700782 if (is_win) {
783 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400784 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700785 "src/ports/SkDebug_win.cpp",
786 "src/ports/SkFontHost_win.cpp",
787 "src/ports/SkFontMgr_win_dw.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700788 "src/ports/SkImageEncoder_WIC.cpp",
789 "src/ports/SkImageGeneratorWIC.cpp",
790 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700791 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700792 "src/ports/SkScalerContext_win_dw.cpp",
793 "src/ports/SkTLS_win.cpp",
794 "src/ports/SkTypeface_win_dw.cpp",
795 ]
Mike Klein69f6ed42016-10-13 15:45:07 -0400796 if (skia_use_gdi) {
797 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
798 libs += [
799 "Gdi32.lib",
800 "Usp10.lib",
801 ]
802 } else {
803 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
804 }
Mike Klein4b167fc2016-10-11 18:13:53 -0400805 libs += [
806 "FontSub.lib",
807 "Ole32.lib",
808 "OleAut32.lib",
809 "User32.lib",
810 ]
mtkleinc04ff472016-06-23 10:29:30 -0700811 } else {
812 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700813 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700814 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700815 "src/ports/SkTLS_pthread.cpp",
816 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -0400817 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -0700818 }
819
mtklein7d6fb2c2016-08-25 14:50:44 -0700820 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -0500821 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -0500822 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -0500823 deps += [ "//third_party/cpu-features" ]
824 }
mtklein06c35c02016-09-20 12:28:12 -0700825 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700826 libs += [
827 "EGL",
828 "GLESv2",
829 "log",
830 ]
831 }
832
mtkleinc04ff472016-06-23 10:29:30 -0700833 if (is_linux) {
mtklein06c35c02016-09-20 12:28:12 -0700834 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700835 }
836
837 if (is_mac) {
838 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700839 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700840 "src/ports/SkFontHost_mac.cpp",
841 "src/ports/SkImageEncoder_CG.cpp",
842 "src/ports/SkImageGeneratorCG.cpp",
843 ]
mtklein09e61f72016-08-23 13:35:28 -0700844 libs += [
bungeman3e306f62017-03-29 11:32:02 -0400845 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
846 "AppKit.framework",
mtklein09e61f72016-08-23 13:35:28 -0700847 "ApplicationServices.framework",
848 "OpenGL.framework",
849 ]
mtkleinc04ff472016-06-23 10:29:30 -0700850 }
abarth6fc8ff02016-07-15 15:15:15 -0700851
Mike Klein7d302882016-11-03 14:06:31 -0400852 if (is_ios) {
853 sources += [
854 "src/ports/SkDebug_stdio.cpp",
855 "src/ports/SkFontHost_mac.cpp",
856 "src/ports/SkImageEncoder_CG.cpp",
857 "src/ports/SkImageGeneratorCG.cpp",
858 ]
859 libs += [
860 "CoreFoundation.framework",
861 "CoreGraphics.framework",
862 "CoreText.framework",
863 "ImageIO.framework",
864 "MobileCoreServices.framework",
bungeman3e306f62017-03-29 11:32:02 -0400865
866 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
867 "UIKit.framework",
Mike Klein7d302882016-11-03 14:06:31 -0400868 ]
869 }
870
abarth6fc8ff02016-07-15 15:15:15 -0700871 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700872 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700873 }
mtkleinc04ff472016-06-23 10:29:30 -0700874}
875
mtkleinc095df52016-08-24 12:23:52 -0700876# Targets guarded by skia_enable_tools may use //third_party freely.
877if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -0500878 # Used by gn_to_bp.py to list our public include dirs.
879 source_set("public") {
880 configs += [ ":skia_public" ]
881 }
882
Mike Kleinc36dedf2016-11-18 09:35:28 -0500883 config("skia.h_config") {
884 include_dirs = [ "$target_gen_dir" ]
885 }
886 action("skia.h") {
887 public_configs = [ ":skia.h_config" ]
888 skia_h = "$target_gen_dir/skia.h"
889 script = "gn/find_headers.py"
Greg Danielc819e662017-04-19 16:39:45 -0400890 args = [ rebase_path(skia_h, root_build_dir) ] +
Robert Phillipsfcd5fdd2017-06-14 01:43:29 +0000891 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -0500892 depfile = "$skia_h.deps"
893 outputs = [
894 skia_h,
895 ]
896 }
897
898 if (skia_enable_gpu && target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -0500899 executable("fiddle") {
900 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -0500901 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -0500902 "tools/fiddle/draw.cpp",
903 "tools/fiddle/fiddle_main.cpp",
904 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -0400905
906 if (skia_use_egl) {
907 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -0400908 } else {
909 sources += [ "tools/fiddle/null_context.cpp" ]
910 }
Joe Gregorio1e735c02017-04-19 14:05:14 -0400911 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -0500912 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -0400913 ":flags",
Mike Kleinc36dedf2016-11-18 09:35:28 -0500914 ":skia",
915 ":skia.h",
916 ]
917 }
918 }
919
920 if (skia_enable_gpu) {
921 source_set("public_headers_warnings_check") {
922 sources = [
923 "tools/public_headers_warnings_check.cpp",
924 ]
925 configs -= [ "//gn:warnings_except_public_headers" ]
926 deps = [
927 ":skia",
928 ":skia.h",
929 ]
930 }
931 }
932
mtkleinc095df52016-08-24 12:23:52 -0700933 template("test_lib") {
934 config(target_name + "_config") {
935 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700936 if (defined(invoker.public_defines)) {
937 defines = invoker.public_defines
938 }
mtklein25c81d42016-07-27 13:55:26 -0700939 }
mtkleinc095df52016-08-24 12:23:52 -0700940 source_set(target_name) {
941 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
942 public_configs = [
943 ":" + target_name + "_config",
944 ":skia_private",
945 ]
946
947 if (!defined(deps)) {
948 deps = []
949 }
950 deps += [ ":skia" ]
951 testonly = true
952 }
mtklein25c81d42016-07-27 13:55:26 -0700953 }
mtklein25c81d42016-07-27 13:55:26 -0700954
Mike Kleine6682eb2017-01-05 10:54:57 -0500955 template("test_app") {
956 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
957 shared_library("lib" + target_name) {
958 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400959 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500960 testonly = true
961 }
962 } else {
Mike Klein7d921032017-01-05 12:20:41 -0500963 _executable = target_name
964 executable(_executable) {
Mike Kleine6682eb2017-01-05 10:54:57 -0500965 forward_variables_from(invoker, "*", [ "is_shared_library" ])
Mike Klein154e6da2017-07-26 15:13:47 -0400966 configs += [ ":skia_private" ]
Mike Kleine6682eb2017-01-05 10:54:57 -0500967 testonly = true
968 }
969 }
Mike Klein7d921032017-01-05 12:20:41 -0500970 if (is_android && skia_android_serial != "" && defined(_executable)) {
971 action("push_" + target_name) {
972 script = "gn/push_to_android.py"
973 deps = [
974 ":" + _executable,
975 ]
976 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
977 outputs = [
978 _stamp,
979 ]
980 args = [
981 rebase_path("$root_build_dir/$_executable"),
982 skia_android_serial,
983 rebase_path(_stamp),
984 ]
985 testonly = true
986 }
987 }
Mike Kleine6682eb2017-01-05 10:54:57 -0500988 }
989
mtkleinc095df52016-08-24 12:23:52 -0700990 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700991 public_include_dirs = []
992 if (skia_enable_gpu) {
993 public_defines = []
994 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700995
996 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700997 sources = [
998 "tools/gpu/GrContextFactory.cpp",
999 "tools/gpu/GrTest.cpp",
1000 "tools/gpu/TestContext.cpp",
1001 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -07001002 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001003 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
1004 "tools/gpu/gl/debug/GrBufferObj.cpp",
1005 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
1006 "tools/gpu/gl/debug/GrProgramObj.cpp",
1007 "tools/gpu/gl/debug/GrShaderObj.cpp",
1008 "tools/gpu/gl/debug/GrTextureObj.cpp",
1009 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
1010 "tools/gpu/gl/null/NullGLTestContext.cpp",
Brian Salomoncfe910d2017-07-06 16:40:18 -04001011 "tools/gpu/mock/MockTestContext.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001012 ]
1013 libs = []
mtklein25c81d42016-07-27 13:55:26 -07001014
Kevin Lubick4a24e102017-03-29 11:19:01 -04001015 if (is_android || skia_use_egl) {
mtklein38925aa2016-09-21 10:11:25 -07001016 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -04001017 } else if (is_ios) {
1018 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
1019 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -07001020 } else if (is_linux) {
1021 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
Mike Kleina979a1d2017-02-23 10:31:13 -05001022 libs += [ "X11" ]
mtklein38925aa2016-09-21 10:11:25 -07001023 } else if (is_mac) {
1024 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001025 } else if (is_win) {
1026 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1027 libs += [
1028 "Gdi32.lib",
1029 "OpenGL32.lib",
1030 ]
mtklein38925aa2016-09-21 10:11:25 -07001031 }
mtklein6ef69992016-09-14 06:12:09 -07001032
Greg Daniel6b7e0e22017-07-12 16:21:09 -04001033 cflags_objcc = [ "-fobjc-arc" ]
1034
Mike Kleinc168a3a2016-11-14 14:53:13 +00001035 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +00001036 deps += [ "//third_party/angle2" ]
1037 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1038 }
mtkleind68f9b02016-09-23 13:18:41 -07001039 if (skia_use_vulkan) {
1040 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Greg Daniel35970ec2017-11-10 10:03:05 -05001041 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
mtkleind68f9b02016-09-23 13:18:41 -07001042 }
Greg Danielb76a72a2017-07-13 15:07:54 -04001043 if (skia_use_metal) {
1044 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
1045 }
mtkleina627b5c2016-09-20 13:36:47 -07001046 }
mtklein25c81d42016-07-27 13:55:26 -07001047 }
mtklein25c81d42016-07-27 13:55:26 -07001048
mtkleinc095df52016-08-24 12:23:52 -07001049 test_lib("flags") {
1050 public_include_dirs = [ "tools/flags" ]
1051 sources = [
1052 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -07001053 ]
1054 }
1055 test_lib("common_flags") {
1056 public_include_dirs = [ "tools/flags" ]
1057 sources = [
mtkleinc095df52016-08-24 12:23:52 -07001058 "tools/flags/SkCommonFlags.cpp",
1059 "tools/flags/SkCommonFlagsConfig.cpp",
1060 ]
1061 deps = [
mtklein046cb562016-09-16 10:23:12 -07001062 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001063 ":gpu_tool_utils",
1064 ]
1065 }
mtklein25c81d42016-07-27 13:55:26 -07001066
mtkleinc095df52016-08-24 12:23:52 -07001067 test_lib("tool_utils") {
1068 public_include_dirs = [
1069 "tools",
1070 "tools/debugger",
1071 "tools/timer",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001072 "tools/trace",
mtkleinc095df52016-08-24 12:23:52 -07001073 ]
1074 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001075 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001076 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -07001077 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001078 "tools/ProcStats.cpp",
1079 "tools/Resources.cpp",
Mike Klein10d66cc2017-11-10 11:33:43 -05001080 "tools/SkRandomScalerContext.cpp",
1081 "tools/SkTestScalerContext.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001082 "tools/ThermalManager.cpp",
1083 "tools/UrlDataManager.cpp",
1084 "tools/debugger/SkDebugCanvas.cpp",
1085 "tools/debugger/SkDrawCommand.cpp",
1086 "tools/debugger/SkJsonWriteBuffer.cpp",
1087 "tools/debugger/SkObjectParser.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001088 "tools/picture_utils.cpp",
1089 "tools/random_parse_path.cpp",
1090 "tools/sk_tool_utils.cpp",
1091 "tools/sk_tool_utils_font.cpp",
1092 "tools/timer/Timer.cpp",
Brian Osman53136aa2017-07-20 15:43:35 -04001093 "tools/trace/SkChromeTracingTracer.cpp",
1094 "tools/trace/SkChromeTracingTracer.h",
Brian Salomondcbb9d92017-07-19 10:53:20 -04001095 "tools/trace/SkDebugfTracer.cpp",
1096 "tools/trace/SkDebugfTracer.h",
Brian Osman53136aa2017-07-20 15:43:35 -04001097 "tools/trace/SkEventTracingPriv.cpp",
1098 "tools/trace/SkEventTracingPriv.h",
mtkleinc095df52016-08-24 12:23:52 -07001099 ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001100 libs = []
1101 if (is_ios) {
1102 sources += [ "tools/ios_utils.m" ]
1103 libs += [ "Foundation.framework" ]
1104 }
mtkleinc095df52016-08-24 12:23:52 -07001105 deps = [
mtklein046cb562016-09-16 10:23:12 -07001106 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -07001107 ":flags",
1108 "//third_party/libpng",
1109 ]
1110 public_deps = [
1111 "//third_party/jsoncpp",
1112 ]
1113 }
mtklein25c81d42016-07-27 13:55:26 -07001114
Mike Klein6e744122016-10-27 12:21:40 -04001115 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001116 test_lib("gm") {
1117 public_include_dirs = [ "gm" ]
1118 sources = gm_sources
1119 deps = [
scroggo19b91532016-10-24 09:03:26 -07001120 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001121 ":gpu_tool_utils",
1122 ":skia",
1123 ":tool_utils",
1124 ]
1125 }
mtklein25c81d42016-07-27 13:55:26 -07001126
Mike Klein6e744122016-10-27 12:21:40 -04001127 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001128 test_lib("tests") {
1129 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -04001130 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -07001131 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -04001132 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001133 }
mtkleinc095df52016-08-24 12:23:52 -07001134 deps = [
fmalita6cf896d2016-08-25 08:44:35 -07001135 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001136 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001137 ":skia",
1138 ":tool_utils",
1139 "//third_party/libpng",
1140 "//third_party/zlib",
1141 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001142 public_deps = [
1143 ":gpu_tool_utils", # Test.h #includes headers from this target.
1144 ]
mtkleinc095df52016-08-24 12:23:52 -07001145 }
mtklein2f3416d2016-08-02 16:02:05 -07001146
Mike Klein6e744122016-10-27 12:21:40 -04001147 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001148 test_lib("bench") {
1149 public_include_dirs = [ "bench" ]
1150 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001151 deps = [
1152 ":flags",
1153 ":gm",
1154 ":gpu_tool_utils",
1155 ":skia",
1156 ":tool_utils",
1157 ]
1158 }
mtklein2b6870c2016-07-28 14:17:33 -07001159
mtkleinc095df52016-08-24 12:23:52 -07001160 test_lib("experimental_svg_model") {
1161 public_include_dirs = [ "experimental/svg/model" ]
1162 sources = [
1163 "experimental/svg/model/SkSVGAttribute.cpp",
1164 "experimental/svg/model/SkSVGAttributeParser.cpp",
1165 "experimental/svg/model/SkSVGCircle.cpp",
Florin Malitace8840e2016-12-08 09:26:47 -05001166 "experimental/svg/model/SkSVGClipPath.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001167 "experimental/svg/model/SkSVGContainer.cpp",
1168 "experimental/svg/model/SkSVGDOM.cpp",
1169 "experimental/svg/model/SkSVGEllipse.cpp",
Florin Malitadf007e12017-10-09 15:14:13 -04001170 "experimental/svg/model/SkSVGGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001171 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001172 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001173 "experimental/svg/model/SkSVGNode.cpp",
1174 "experimental/svg/model/SkSVGPath.cpp",
Florin Malita1aa1bb62017-10-11 14:34:33 -04001175 "experimental/svg/model/SkSVGPattern.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001176 "experimental/svg/model/SkSVGPoly.cpp",
Florin Malitacc6cc292017-10-09 16:05:30 -04001177 "experimental/svg/model/SkSVGRadialGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001178 "experimental/svg/model/SkSVGRect.cpp",
1179 "experimental/svg/model/SkSVGRenderContext.cpp",
1180 "experimental/svg/model/SkSVGSVG.cpp",
1181 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001182 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001183 "experimental/svg/model/SkSVGTransformableNode.cpp",
Florin Malita6a69c052017-10-11 14:02:11 -04001184 "experimental/svg/model/SkSVGUse.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001185 "experimental/svg/model/SkSVGValue.cpp",
1186 ]
1187 deps = [
1188 ":skia",
1189 ]
1190 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001191
Kevin Lubickebf648e2017-09-21 13:45:16 -04001192 if (target_cpu != "wasm") {
1193 test_lib("views") {
1194 public_include_dirs = [ "include/views" ]
1195 sources = [
1196 "src/views/SkEvent.cpp",
1197 "src/views/SkEventSink.cpp",
1198 "src/views/SkOSMenu.cpp",
1199 "src/views/SkTagList.cpp",
1200 "src/views/SkTouchGesture.cpp",
1201 "src/views/SkView.cpp",
1202 "src/views/SkViewPriv.cpp",
Brian Osman2dd96932016-10-18 15:33:53 -04001203 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001204 libs = []
1205 deps = []
1206 if (!is_android) {
1207 sources += [ "src/views/SkWindow.cpp" ]
1208 }
1209 if (is_linux) {
1210 public_include_dirs += [ "src/views/unix" ]
1211 sources += [
1212 "src/views/unix/SkOSWindow_Unix.cpp",
1213 "src/views/unix/keysym2ucs.c",
1214 ]
1215 libs += [
1216 "GL",
1217 "X11",
1218 ]
1219 } else if (is_mac) {
1220 sources += [
1221 "src/views/mac/SkEventNotifier.mm",
1222 "src/views/mac/SkNSView.mm",
1223 "src/views/mac/SkOSWindow_Mac.mm",
1224 "src/views/mac/SkTextFieldCell.m",
1225 ]
1226 libs += [
1227 "QuartzCore.framework",
1228 "Cocoa.framework",
1229 "Foundation.framework",
1230 ]
1231 } else if (is_win) {
1232 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1233 } else if (is_ios) {
1234 sources += [ "src/views/mac/SkEventNotifier.mm" ]
1235 }
1236 if (skia_use_angle) {
1237 deps += [ "//third_party/angle2" ]
1238 }
Brian Osman34755e22016-12-05 09:46:02 -05001239 }
Brian Osman16adfa32016-10-18 14:42:44 -04001240 }
1241
Mike Klein38af9432016-11-11 11:39:44 -05001242 if (skia_use_lua) {
1243 test_lib("lua") {
1244 public_include_dirs = []
1245 sources = [
1246 "src/utils/SkLua.cpp",
1247 "src/utils/SkLuaCanvas.cpp",
1248 ]
1249 deps = [
1250 "//third_party/lua",
1251 ]
1252 }
1253
Mike Kleine6682eb2017-01-05 10:54:57 -05001254 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001255 sources = [
1256 "tools/lua/lua_app.cpp",
1257 ]
1258 deps = [
1259 ":lua",
1260 ":skia",
1261 "//third_party/lua",
1262 ]
Mike Klein38af9432016-11-11 11:39:44 -05001263 }
1264
Mike Kleine6682eb2017-01-05 10:54:57 -05001265 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001266 sources = [
1267 "tools/lua/lua_pictures.cpp",
1268 ]
1269 deps = [
1270 ":flags",
1271 ":lua",
1272 ":skia",
1273 ":tool_utils",
1274 "//third_party/lua",
1275 ]
Mike Klein38af9432016-11-11 11:39:44 -05001276 }
1277 }
1278
Cary Clark8032b982017-07-28 11:04:54 -04001279 test_app("bookmaker") {
1280 sources = [
1281 "tools/bookmaker/bookmaker.cpp",
Cary Clarkbef063a2017-10-31 15:44:45 -04001282 "tools/bookmaker/cataloger.cpp",
Cary Clark8032b982017-07-28 11:04:54 -04001283 "tools/bookmaker/fiddleParser.cpp",
1284 "tools/bookmaker/includeParser.cpp",
1285 "tools/bookmaker/includeWriter.cpp",
1286 "tools/bookmaker/mdOut.cpp",
1287 "tools/bookmaker/parserCommon.cpp",
1288 "tools/bookmaker/spellCheck.cpp",
1289 ]
1290 deps = [
1291 ":flags",
1292 ":skia",
1293 ":tool_utils",
1294 ]
1295 }
1296
Kevin Lubickebf648e2017-09-21 13:45:16 -04001297 if (target_cpu != "wasm") {
1298 import("gn/samples.gni")
1299 test_lib("samples") {
1300 public_include_dirs = [ "samplecode" ]
1301 include_dirs = [ "experimental" ]
1302 sources = samples_sources + [
1303 "experimental/SkSetPoly3To3.cpp",
1304 "experimental/SkSetPoly3To3_A.cpp",
1305 "experimental/SkSetPoly3To3_D.cpp",
Brian Osmancff94e42017-06-26 13:12:37 -04001306
Kevin Lubickebf648e2017-09-21 13:45:16 -04001307 # Relocating these files here, so that clients don't try to build them while they're
1308 # still in active development. Clang's thread safety analysis gets tripped up by
1309 # conditional locks.
1310 "src/core/SkThreadedBMPDevice.cpp",
1311 "src/core/SkThreadedBMPDevice.h",
1312 ]
1313 deps = [
1314 ":experimental_svg_model",
1315 ":flags",
1316 ":gm",
1317 ":tool_utils",
1318 ":views",
1319 ":xml",
1320 ]
Mike Klein38af9432016-11-11 11:39:44 -05001321
Kevin Lubickebf648e2017-09-21 13:45:16 -04001322 if (skia_use_lua) {
1323 sources += [ "samplecode/SampleLua.cpp" ]
1324 deps += [
1325 ":lua",
1326 "//third_party/lua",
1327 ]
1328 }
1329 }
1330 test_app("dm") {
1331 sources = [
1332 "dm/DM.cpp",
Mike Klein31868212017-11-06 12:02:47 -05001333 "dm/DMFontMgr.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001334 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001335 "dm/DMJsonWriter.cpp",
1336 "dm/DMSrcSink.cpp",
1337 ]
1338 include_dirs = [ "tests" ]
1339 deps = [
1340 ":common_flags",
1341 ":experimental_svg_model",
1342 ":flags",
1343 ":gm",
1344 ":gpu_tool_utils",
1345 ":skia",
1346 ":tests",
1347 ":tool_utils",
1348 "//third_party/jsoncpp",
1349 "//third_party/libpng",
Mike Klein38af9432016-11-11 11:39:44 -05001350 ]
1351 }
Brian Osman16adfa32016-10-18 14:42:44 -04001352 }
1353
Mike Klein06432b22017-03-21 13:14:33 -04001354 test_app("ok") {
1355 sources = [
Mike Klein361dde02017-11-07 08:14:52 -05001356 "dm/DMFontMgr.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001357 "tools/ok.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001358 "tools/ok_dsts.cpp",
Mike Klein154e6da2017-07-26 15:13:47 -04001359 "tools/ok_engines.cpp",
Mike Klein7ac04832017-03-25 11:29:41 -04001360 "tools/ok_srcs.cpp",
Mike Kleind63442d2017-03-27 14:16:04 -04001361 "tools/ok_test.cpp",
Mike Kleinf5d1a552017-03-25 12:32:22 -04001362 "tools/ok_vias.cpp",
Mike Klein06432b22017-03-21 13:14:33 -04001363 ]
1364 deps = [
Mike Klein4f6e2712017-08-11 10:37:35 -04001365 ":bench",
Mike Klein06432b22017-03-21 13:14:33 -04001366 ":gm",
1367 ":skia",
Mike Kleind63442d2017-03-27 14:16:04 -04001368 ":tests",
Mike Klein62669ad2017-05-09 16:03:07 -04001369 ":tool_utils",
Mike Klein06432b22017-03-21 13:14:33 -04001370 ]
1371 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001372 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001373 sources = [
1374 "bench/nanobench.cpp",
1375 ]
1376 deps = [
1377 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001378 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001379 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001380 ":flags",
1381 ":gm",
1382 ":gpu_tool_utils",
1383 ":skia",
1384 ":tool_utils",
1385 "//third_party/jsoncpp",
1386 ]
mtklein2b6870c2016-07-28 14:17:33 -07001387 }
halcanary19a97202016-08-03 15:08:04 -07001388
Ravi Mistry10d36c52017-01-31 09:49:18 -05001389 test_app("skpinfo") {
1390 sources = [
1391 "tools/skpinfo.cpp",
1392 ]
1393 deps = [
1394 ":flags",
1395 ":skia",
1396 ]
1397 }
1398
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001399 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001400 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001401 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001402 "samplecode/SampleApp.cpp",
1403 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001404 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001405 if (is_mac) {
1406 sources += [ "src/views/mac/skia_mac.mm" ]
1407 } else if (is_win) {
1408 sources += [ "src/views/win/skia_win.cpp" ]
1409 } else if (is_linux) {
1410 sources += [ "src/views/unix/skia_unix.cpp" ]
1411 }
mtklein38925aa2016-09-21 10:11:25 -07001412 deps = [
1413 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001414 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001415 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001416 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001417 ":skia",
1418 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001419 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001420 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001421 if (skia_use_angle) {
1422 deps += [ "//third_party/angle2" ]
1423 }
mtklein38925aa2016-09-21 10:11:25 -07001424 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001425 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001426
Jim Van Verthc1720d42017-10-09 10:16:01 -04001427 if (skia_enable_gpu && !skia_use_angle && (is_linux || is_win || is_mac)) {
1428 test_app("HelloWorld") {
1429 sources = [
1430 "example/HelloWorld.cpp",
1431 ]
1432 if (is_mac) {
1433 sources += [ "src/views/mac/skia_mac.mm" ]
1434 } else if (is_win) {
1435 sources += [ "src/views/win/skia_win.cpp" ]
1436 } else if (is_linux) {
1437 sources += [ "src/views/unix/skia_unix.cpp" ]
1438 }
1439 deps = [
1440 ":gpu_tool_utils",
1441 ":skia",
1442 ":views",
1443 ]
1444 }
1445 }
1446
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001447 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001448 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001449 sources = [
1450 "tools/skpbench/skpbench.cpp",
1451 ]
1452 deps = [
1453 ":flags",
1454 ":gpu_tool_utils",
1455 ":skia",
1456 ":tool_utils",
1457 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001458 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001459 }
1460
Mike Klein7d302882016-11-03 14:06:31 -04001461 # We can't yet build ICU on iOS or Windows.
Kevin Lubickebf648e2017-09-21 13:45:16 -04001462 if (!is_ios && !is_win && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001463 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001464 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001465 "tools/shape/SkShaper_harfbuzz.cpp",
1466 "tools/shape/using_skia_and_harfbuzz.cpp",
mtklein6f5df6a2016-08-29 16:01:10 -07001467 ]
1468 deps = [
1469 ":skia",
1470 "//third_party/harfbuzz",
Ben Wagnera25fbef2017-08-30 13:56:19 -04001471 "//third_party/icu",
mtklein6f5df6a2016-08-29 16:01:10 -07001472 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001473 }
halcanary19a97202016-08-03 15:08:04 -07001474 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001475 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001476 sources = [
Ben Wagnera25fbef2017-08-30 13:56:19 -04001477 "tools/shape/SkShaper_primitive.cpp",
1478 "tools/shape/using_skia_and_harfbuzz.cpp",
halcanary3eee9d92016-09-10 07:01:53 -07001479 ]
1480 deps = [
1481 ":skia",
1482 ]
halcanary3eee9d92016-09-10 07:01:53 -07001483 }
mtklein046cb562016-09-16 10:23:12 -07001484
Matt Sarett9f1c4032017-05-17 10:06:32 -04001485 test_app("create_flutter_test_images") {
1486 sources = [
1487 "tools/create_flutter_test_images.cpp",
1488 ]
1489 deps = [
1490 ":skia",
1491 ":tool_utils",
1492 ]
1493 }
1494
Ben Wagner219f3622017-07-17 15:32:25 -04001495 test_app("create_test_font") {
1496 sources = [
1497 "tools/create_test_font.cpp",
1498 ]
1499 deps = [
1500 ":skia",
1501 ]
1502 assert_no_deps = [
1503 # tool_utils requires the output of this app.
1504 ":tool_utils",
1505 ]
1506 }
1507
Mike Kleine6682eb2017-01-05 10:54:57 -05001508 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001509 sources = [
1510 "tools/get_images_from_skps.cpp",
1511 ]
1512 deps = [
1513 ":flags",
1514 ":skia",
1515 "//third_party/jsoncpp",
1516 ]
mtklein046cb562016-09-16 10:23:12 -07001517 }
mtkleinecbc5262016-09-22 11:51:24 -07001518
Mike Kleine6682eb2017-01-05 10:54:57 -05001519 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001520 sources = [
1521 "tools/colorspaceinfo.cpp",
1522 ]
1523 deps = [
1524 ":flags",
1525 ":skia",
1526 ":tool_utils",
1527 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001528 }
1529
Kevin Lubickebf648e2017-09-21 13:45:16 -04001530 if (!is_ios && target_cpu != "wasm") {
Mike Kleine6682eb2017-01-05 10:54:57 -05001531 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001532 sources = [
1533 "tools/skiaserve/Request.cpp",
1534 "tools/skiaserve/Response.cpp",
1535 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001536 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1537 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1538 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1539 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1540 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1541 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1542 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1543 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1544 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001545 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1546 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001547 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1548 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1549 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1550 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1551 ]
1552 deps = [
1553 ":flags",
1554 ":gpu_tool_utils",
1555 ":skia",
1556 ":tool_utils",
1557 "//third_party/jsoncpp",
1558 "//third_party/libmicrohttpd",
1559 "//third_party/libpng",
1560 ]
Mike Klein7d302882016-11-03 14:06:31 -04001561 }
mtkleinecbc5262016-09-22 11:51:24 -07001562 }
kjlubick14f984b2016-10-03 11:49:45 -07001563
Mike Kleine6682eb2017-01-05 10:54:57 -05001564 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001565 sources = [
1566 "fuzz/FilterFuzz.cpp",
Hal Canary24ac42b2017-02-14 13:35:14 -05001567 "fuzz/FuzzCanvas.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001568 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001569 "fuzz/FuzzGradients.cpp",
1570 "fuzz/FuzzParsePath.cpp",
1571 "fuzz/FuzzPathop.cpp",
1572 "fuzz/FuzzScaleToSides.cpp",
1573 "fuzz/fuzz.cpp",
1574 ]
1575 deps = [
1576 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04001577 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001578 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001579 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001580 ]
kjlubick14f984b2016-10-03 11:49:45 -07001581 }
Mike Klein38312422016-10-05 15:41:01 -04001582
Mike Kleine6682eb2017-01-05 10:54:57 -05001583 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001584 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001585 rebase_path("tests/skia_test.cpp"),
1586 rebase_path("tests/Test.cpp"),
1587 ]
caryclark9feb6322016-10-25 08:58:26 -07001588 deps = [
1589 ":flags",
1590 ":gpu_tool_utils",
1591 ":skia",
1592 ":tool_utils",
1593 ]
caryclark9feb6322016-10-25 08:58:26 -07001594 }
1595
Mike Kleine6682eb2017-01-05 10:54:57 -05001596 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001597 sources = [
1598 "tools/DumpRecord.cpp",
1599 "tools/dump_record.cpp",
1600 ]
1601 deps = [
1602 ":flags",
1603 ":skia",
1604 ]
Mike Klein38312422016-10-05 15:41:01 -04001605 }
bungemanfe917272016-10-13 17:36:40 -04001606
Mike Kleine6682eb2017-01-05 10:54:57 -05001607 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001608 sources = [
1609 "tools/skdiff/skdiff.cpp",
1610 "tools/skdiff/skdiff_html.cpp",
1611 "tools/skdiff/skdiff_main.cpp",
1612 "tools/skdiff/skdiff_utils.cpp",
1613 ]
1614 deps = [
1615 ":skia",
1616 ":tool_utils",
1617 ]
bungemanfe917272016-10-13 17:36:40 -04001618 }
halcanarya73d76a2016-10-17 13:19:02 -07001619
Mike Kleine6682eb2017-01-05 10:54:57 -05001620 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001621 sources = [
1622 "tools/skp_parser.cpp",
1623 ]
1624 deps = [
1625 ":skia",
1626 ":tool_utils",
1627 "//third_party/jsoncpp",
1628 ]
halcanarya73d76a2016-10-17 13:19:02 -07001629 }
Brian Osman16adfa32016-10-18 14:42:44 -04001630
Hal Canary75427132017-10-11 16:00:31 -04001631 if (!is_win) {
1632 test_app("gpucts") {
1633 sources = [
1634 "dm/DMGpuTestProcs.cpp",
1635 "tools/gpucts/gm_knowledge.c",
1636 "tools/gpucts/gm_runner.cpp",
1637 "tools/gpucts/gpucts.cpp",
1638 ]
1639 deps = [
1640 ":gm",
1641 ":gpu_tool_utils",
1642 ":skia",
1643 ":tests",
1644 "//third_party/googletest",
1645 ]
1646 }
1647 }
1648
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001649 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001650 test_app("viewer") {
1651 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001652 sources = [
1653 "tools/viewer/GMSlide.cpp",
1654 "tools/viewer/ImageSlide.cpp",
1655 "tools/viewer/SKPSlide.cpp",
1656 "tools/viewer/SampleSlide.cpp",
1657 "tools/viewer/Viewer.cpp",
1658 "tools/viewer/sk_app/CommandSet.cpp",
1659 "tools/viewer/sk_app/GLWindowContext.cpp",
1660 "tools/viewer/sk_app/Window.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04001661 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001662 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001663
Jim Van Verth4e56a912016-10-21 10:58:52 -04001664 if (is_android) {
1665 sources += [
1666 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1667 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1668 "tools/viewer/sk_app/android/Window_android.cpp",
1669 "tools/viewer/sk_app/android/main_android.cpp",
1670 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1671 ]
Brian Osman462334e2017-02-09 11:22:57 -05001672 libs += [ "android" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001673 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001674 sources += [
1675 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1676 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1677 "tools/viewer/sk_app/unix/Window_unix.cpp",
1678 "tools/viewer/sk_app/unix/main_unix.cpp",
1679 ]
1680 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001681 sources += [
1682 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1683 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1684 "tools/viewer/sk_app/win/Window_win.cpp",
1685 "tools/viewer/sk_app/win/main_win.cpp",
1686 ]
Brian Salomon194db172017-08-17 14:37:06 -04001687 if (skia_use_angle) {
1688 sources += [ "tools/viewer/sk_app/win/ANGLEWindowContext_win.cpp" ]
1689 }
Mike Klein43c25262016-10-20 10:17:47 -04001690 } else if (is_mac) {
1691 sources += [
1692 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1693 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1694 "tools/viewer/sk_app/mac/Window_mac.cpp",
1695 "tools/viewer/sk_app/mac/main_mac.cpp",
1696 ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001697 } else if (is_ios) {
1698 sources += [
1699 "tools/viewer/sk_app/ios/GLWindowContext_ios.cpp",
1700 "tools/viewer/sk_app/ios/RasterWindowContext_ios.cpp",
1701 "tools/viewer/sk_app/ios/Window_ios.cpp",
1702 "tools/viewer/sk_app/ios/main_ios.cpp",
1703 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001704 }
1705
1706 if (skia_use_vulkan) {
1707 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001708 if (is_android) {
1709 sources +=
1710 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001711 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001712 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1713 libs += [ "X11-xcb" ]
1714 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001715 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1716 }
1717 }
1718
1719 include_dirs = []
1720 deps = [
1721 ":flags",
1722 ":gm",
1723 ":gpu_tool_utils",
1724 ":samples",
1725 ":skia",
1726 ":tool_utils",
1727 ":views",
Brian Osman79086b92017-02-10 13:36:16 -05001728 "//third_party/imgui",
Brian Osman16adfa32016-10-18 14:42:44 -04001729 "//third_party/jsoncpp",
1730 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001731 if (is_android) {
1732 deps += [ "//third_party/native_app_glue" ]
Jim Van Verthdbb24ef2017-09-01 11:01:51 -04001733 } else if (is_mac || is_ios) {
Mike Klein43c25262016-10-20 10:17:47 -04001734 deps += [ "//third_party/libsdl" ]
1735 }
Brian Salomon194db172017-08-17 14:37:06 -04001736 if (skia_use_angle) {
1737 deps += [ "//third_party/angle2" ]
1738 }
Mike Kleina92c3832016-12-08 09:49:39 -05001739 }
Brian Osman16adfa32016-10-18 14:42:44 -04001740 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001741
Jim Van Verthecfed2b2017-08-30 14:02:50 -04001742 if (skia_enable_gpu && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04001743 test_app("SkiaSDLExample") {
1744 sources = [
1745 "example/SkiaSDLExample.cpp",
1746 ]
1747 libs = []
1748 include_dirs = []
1749 deps = [
1750 ":gpu_tool_utils",
1751 ":skia",
1752 "//third_party/libsdl",
1753 ]
1754 }
1755 }
1756
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001757 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
1758 action_foreach("generate_mocs") {
1759 script = "gn/call.py"
1760 sources = [
1761 "tools/mdbviz/MainWindow.h",
1762 ]
1763 outputs = [
1764 "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp",
1765 ]
1766 args = [
1767 "$skia_qt_path" + "/bin/moc",
1768 "{{source}}",
1769 "-o",
1770 "gen/mdbviz/{{source_name_part}}_moc.cpp",
1771 ]
1772 }
1773 action_foreach("generate_resources") {
1774 script = "gn/call.py"
1775 sources = [
1776 "tools/mdbviz/resources.qrc",
1777 ]
1778 outputs = [
1779 "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp",
1780 ]
1781 args = [
1782 "$skia_qt_path" + "/bin/rcc",
1783 "{{source}}",
1784 "-o",
1785 "gen/mdbviz/{{source_name_part}}_res.cpp",
1786 ]
1787 }
1788 test_app("mdbviz") {
1789 if (is_win) {
1790 # on Windows we need to disable some exception handling warnings due to the Qt headers
1791 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
1792 }
1793 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001794 "tools/UrlDataManager.cpp",
1795 "tools/debugger/SkDebugCanvas.cpp",
1796 "tools/debugger/SkDrawCommand.cpp",
1797 "tools/debugger/SkJsonWriteBuffer.cpp",
1798 "tools/debugger/SkObjectParser.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001799 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04001800 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001801 "tools/mdbviz/main.cpp",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001802 "tools/picture_utils.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001803
1804 # generated files
1805 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
1806 "$target_gen_dir/mdbviz/resources_res.cpp",
1807 ]
1808 lib_dirs = [ "$skia_qt_path/lib" ]
1809 libs = [
1810 "Qt5Core.lib",
1811 "Qt5Gui.lib",
1812 "Qt5Widgets.lib",
1813 ]
1814 include_dirs = [
1815 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04001816 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001817 "$skia_qt_path/include/QtWidgets",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001818 "tools",
1819 "tools/debugger",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001820 ]
1821 deps = [
1822 ":generate_mocs",
1823 ":generate_resources",
1824 ":skia",
Robert Phillips5fccf9d2017-09-05 15:10:12 -04001825 "//third_party/jsoncpp",
1826 "//third_party/libpng",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04001827 ]
1828 }
1829 }
1830
Mike Kleine459afd2017-03-03 09:21:30 -05001831 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05001832 copy("gdbserver") {
1833 sources = [
1834 "$ndk/$ndk_gdbserver",
1835 ]
1836 outputs = [
1837 "$root_out_dir/gdbserver",
1838 ]
1839 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05001840 }
mtklein25c81d42016-07-27 13:55:26 -07001841}
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001842
1843if (skia_jumper_clang != "") {
1844 action("regen_jumper") {
1845 script = "src/jumper/build_stages.py"
1846
1847 inputs = [
1848 "src/jumper/SkJumper_stages.cpp",
Mike Klein9b2f69b2017-09-12 16:40:53 -04001849 "src/jumper/SkJumper_stages_lowp.cpp",
Mike Kleinc55a6cb2017-06-28 13:21:47 -04001850 ]
1851
1852 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it.
1853 outputs = [
1854 "$target_out_dir/" +
1855 rebase_path("src/jumper/SkJumper_generated.S", target_out_dir),
1856 "$target_out_dir/" +
1857 rebase_path("src/jumper/SkJumper_generated_win.S", target_out_dir),
1858 ]
1859
1860 args = [
1861 skia_jumper_clang,
1862 skia_jumper_objdump,
1863 skia_jumper_ccache,
1864 ] + rebase_path(inputs) + rebase_path(outputs)
1865 }
1866}