blob: 3ed9ab24253b7c4f643a34608b7b35d8a1542010 [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
Mike Kleincfc4f442016-10-26 17:19:03 -04006import("gn/android_framework_defines.gni")
mikejurka8c24f4f2016-09-12 16:51:58 -07007import("gn/shared_sources.gni")
brettwb9447282016-09-01 14:24:39 -07008
mtklein3e8012e2016-09-21 09:14:19 -07009if (!defined(is_skia_standalone)) {
10 is_skia_standalone = false
11}
12
mtkleinc04ff472016-06-23 10:29:30 -070013declare_args() {
Mike Kleinc168a3a2016-11-14 14:53:13 +000014 skia_use_angle = false
mtklein63213812016-08-24 09:55:56 -070015 skia_use_expat = true
mtklein3cc22182016-08-29 13:26:14 -070016 skia_use_fontconfig = is_linux
mtkleincdedd0e2016-09-12 15:15:44 -070017 skia_use_freetype = is_android || is_fuchsia || is_linux
Mike Klein69f6ed42016-10-13 15:45:07 -040018 skia_use_gdi = false
Mike Klein7d302882016-11-03 14:06:31 -040019 skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows
mtklein63213812016-08-24 09:55:56 -070020 skia_use_libjpeg_turbo = true
21 skia_use_libpng = true
mtkleineb3c4252016-08-23 07:38:09 -070022 skia_use_libwebp = !is_fuchsia
Mike Klein38af9432016-11-11 11:39:44 -050023 skia_use_lua = false
mtkleina627b5c2016-09-20 13:36:47 -070024 skia_use_mesa = false
Mike Klein10d665d2016-11-01 11:46:10 -040025 skia_use_piex = !is_win
Mike Klein7f71d882017-01-06 12:00:31 -050026 skia_use_xbyak = false
mtklein63213812016-08-24 09:55:56 -070027 skia_use_zlib = true
mtklein1bd72ba2016-09-16 07:45:52 -070028
Mike Klein7d921032017-01-05 12:20:41 -050029 skia_android_serial = ""
mtklein1bd72ba2016-09-16 07:45:52 -070030 skia_enable_android_framework_defines = false
Brian Osman3f375d02016-12-28 11:19:22 -050031 skia_enable_discrete_gpu = true
mtklein06c35c02016-09-20 12:28:12 -070032 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050033 skia_enable_pdf = true
Mike Kleina7080262017-01-09 10:20:13 -050034 skia_enable_splicer = false
mtklein3e8012e2016-09-21 09:14:19 -070035 skia_enable_tools = is_skia_standalone
36 skia_enable_vulkan_debug_layers = is_skia_standalone && is_debug
Greg Daniel686bb212016-10-27 10:48:48 -040037 skia_vulkan_sdk = getenv("VULKAN_SDK")
mtkleinc04ff472016-06-23 10:29:30 -070038}
Brian Salomon23d73ea2016-10-27 13:31:37 -040039declare_args() {
James Robinson14b748d2016-11-12 18:29:39 -080040 skia_use_dng_sdk =
41 !is_fuchsia && !is_win && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040042 skia_use_sfntly = skia_use_icu
43
Mike Klein4d598a32016-10-31 13:44:49 -040044 if (is_android) {
45 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
46 } else {
47 skia_use_vulkan = skia_vulkan_sdk != ""
48 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040049}
Brian Salomon789e25e2016-09-30 13:41:03 -040050
mtklein38925aa2016-09-21 10:11:25 -070051# Our tools require static linking (they use non-exported symbols).
52skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070053
mtkleina45be612016-08-29 15:22:10 -070054fontmgr_android_enabled = skia_use_expat && skia_use_freetype
55
mtklein1211e0c2016-07-26 13:55:45 -070056skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070057 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070058 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070059 "include/codec",
60 "include/config",
61 "include/core",
62 "include/effects",
63 "include/gpu",
64 "include/gpu/gl",
65 "include/images",
66 "include/pathops",
67 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070068 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070069 "include/utils",
70 "include/utils/mac",
mtklein25c81d42016-07-27 13:55:26 -070071 "include/xml",
mtklein1211e0c2016-07-26 13:55:45 -070072]
73
mtkleinc04ff472016-06-23 10:29:30 -070074# Skia public API, generally provided by :skia.
75config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -070076 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -040077 defines = []
78 if (is_component_build) {
79 defines += [ "SKIA_DLL" ]
80 }
Mike Kleinc4cbd742016-09-26 21:37:09 -040081 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -070082 defines += [ "SK_SAMPLES_FOR_X" ]
83 }
mtkleincae1be52016-09-20 08:24:34 -070084 if (skia_enable_android_framework_defines) {
Mike Kleincfc4f442016-10-26 17:19:03 -040085 defines += android_framework_defines
mtkleincae1be52016-09-20 08:24:34 -070086 }
mtklein06c35c02016-09-20 12:28:12 -070087 if (!skia_enable_gpu) {
88 defines += [ "SK_SUPPORT_GPU=0" ]
89 }
mtkleinc04ff472016-06-23 10:29:30 -070090}
91
92# Skia internal APIs, used by Skia itself and a few test tools.
93config("skia_private") {
94 visibility = [ ":*" ]
95
96 include_dirs = [
97 "include/private",
98 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -070099 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -0700100 "src/core",
101 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -0700102 "src/effects/gradients",
103 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700104 "src/gpu",
105 "src/image",
106 "src/images",
107 "src/lazy",
108 "src/opts",
109 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700110 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700111 "src/ports",
112 "src/sfnt",
mtklein9e0d9dd2016-08-30 10:37:19 -0700113 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700114 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700115 "src/utils/win",
mtkleinc04ff472016-06-23 10:29:30 -0700116 "third_party/etc1",
scroggo19b91532016-10-24 09:03:26 -0700117 "third_party/gif",
Leon Scroggins427da6f2016-12-16 13:51:59 +0000118 "third_party/ktx",
mtkleinc04ff472016-06-23 10:29:30 -0700119 ]
mtklein150d1132016-08-01 06:56:40 -0700120
Jim Van Verthb6c5e532016-10-28 10:38:08 -0400121 defines = [
122 "SK_GAMMA_APPLY_TO_A8",
123 "SK_INTERNAL",
124 ]
mtkleinb37c0342016-09-09 11:07:45 -0700125 if (is_android) {
126 defines += [
127 "SK_GAMMA_EXPONENT=1.4",
128 "SK_GAMMA_CONTRAST=0.0",
129 ]
130 }
mtklein88a7ac02016-09-14 11:16:49 -0700131 if (is_official_build || is_android) {
132 # TODO(bsalomon): it'd be nice to make Android normal.
133 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
134 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400135 libs = []
136 lib_dirs = []
137 if (skia_use_vulkan) {
Greg Danielab563d42016-10-31 11:19:59 -0400138 if (skia_vulkan_sdk != "" && !is_android) {
Mike Klein487bfc22016-10-14 14:04:56 -0400139 if (is_win) {
140 include_dirs += [ "$skia_vulkan_sdk/Include/" ]
141 lib_dirs += [ "$skia_vulkan_sdk/Bin" ]
142 } else {
Greg Daniel686bb212016-10-27 10:48:48 -0400143 include_dirs += [ "$skia_vulkan_sdk/include/" ]
144 lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
Mike Klein487bfc22016-10-14 14:04:56 -0400145 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400146 }
Mike Klein487bfc22016-10-14 14:04:56 -0400147 if (is_win) {
148 libs += [ "vulkan-1.lib" ]
149 } else {
150 libs += [ "vulkan" ]
151 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400152 }
Brian Osman34755e22016-12-05 09:46:02 -0500153 if (skia_use_angle) {
154 defines += [ "SK_ANGLE" ]
155 }
Brian Osman3f375d02016-12-28 11:19:22 -0500156 if (skia_enable_discrete_gpu) {
157 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
158 }
mtkleinc04ff472016-06-23 10:29:30 -0700159}
160
161# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
162config("skia_library") {
163 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700164 defines = [ "SKIA_IMPLEMENTATION=1" ]
165}
166
167skia_library_configs = [
168 ":skia_public",
169 ":skia_private",
170 ":skia_library",
171]
172
mtklein9b8583d2016-08-24 17:32:30 -0700173# Use for CPU-specific Skia code that needs particular compiler flags.
174template("opts") {
175 if (invoker.enabled) {
176 source_set(target_name) {
177 forward_variables_from(invoker, "*")
178 configs += skia_library_configs
179 }
180 } else {
181 # If not enabled, a phony empty target that swallows all otherwise unused variables.
182 source_set(target_name) {
183 forward_variables_from(invoker,
184 "*",
185 [
186 "sources",
187 "cflags",
188 ])
189 }
190 }
anmittala7eaf2e2016-08-17 13:57:26 -0700191}
192
mtklein422310d2016-08-16 18:28:43 -0700193is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700194
mtklein7d6fb2c2016-08-25 14:50:44 -0700195opts("none") {
196 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700197 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700198 cflags = []
199}
200
mtklein7d6fb2c2016-08-25 14:50:44 -0700201opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700202 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700203 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700204 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700205}
206
207opts("arm64") {
208 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700209 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700210 cflags = []
211}
212
213opts("crc32") {
214 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700215 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700216 cflags = [ "-march=armv8-a+crc" ]
217}
218
mtklein9b8583d2016-08-24 17:32:30 -0700219opts("sse2") {
220 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700221 sources = skia_opts.sse2_sources
Mike Kleind8765e32016-10-19 13:39:13 -0400222 if (is_win) {
223 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
224 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400225 cflags = [ "-msse2" ]
226 }
mtklein9b8583d2016-08-24 17:32:30 -0700227}
mtkleinc04ff472016-06-23 10:29:30 -0700228
mtklein9b8583d2016-08-24 17:32:30 -0700229opts("ssse3") {
230 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700231 sources = skia_opts.ssse3_sources
Mike Kleind8765e32016-10-19 13:39:13 -0400232 if (is_win) {
233 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
234 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400235 cflags = [ "-mssse3" ]
236 }
mtklein9b8583d2016-08-24 17:32:30 -0700237}
mtkleinc04ff472016-06-23 10:29:30 -0700238
mtklein9b8583d2016-08-24 17:32:30 -0700239opts("sse41") {
240 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700241 sources = skia_opts.sse41_sources
Mike Kleind8765e32016-10-19 13:39:13 -0400242 if (is_win) {
243 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
244 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400245 cflags = [ "-msse4.1" ]
246 }
mtklein9b8583d2016-08-24 17:32:30 -0700247}
mtklein4e976072016-08-08 09:06:27 -0700248
mtklein9b8583d2016-08-24 17:32:30 -0700249opts("sse42") {
250 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700251 sources = skia_opts.sse42_sources
Mike Kleind8765e32016-10-19 13:39:13 -0400252 if (is_win) {
253 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
254 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400255 cflags = [ "-msse4.2" ]
256 }
mtklein9b8583d2016-08-24 17:32:30 -0700257}
258
259opts("avx") {
260 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700261 sources = skia_opts.avx_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400262 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000263 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400264 } else {
265 cflags = [ "-mavx" ]
266 }
mtkleinc04ff472016-06-23 10:29:30 -0700267}
268
Mike Klein78d5a3b2016-09-30 10:48:01 -0400269opts("hsw") {
270 enabled = is_x86
271 sources = skia_opts.hsw_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400272 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000273 cflags = [ "/arch:AVX2" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400274 } else {
275 cflags = [
276 "-mavx2",
277 "-mbmi",
278 "-mbmi2",
279 "-mf16c",
280 "-mfma",
281 ]
282 }
Mike Klein78d5a3b2016-09-30 10:48:01 -0400283}
284
mtkleinc095df52016-08-24 12:23:52 -0700285# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700286template("optional") {
287 if (invoker.enabled) {
288 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700289 if (defined(invoker.public_defines)) {
290 defines = invoker.public_defines
291 }
mtklein457b42a2016-08-23 13:56:37 -0700292 }
293 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700294 forward_variables_from(invoker,
295 "*",
296 [
297 "public_defines",
298 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700299 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700300 ])
mtklein457b42a2016-08-23 13:56:37 -0700301 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700302 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700303 if (defined(invoker.configs_to_remove)) {
304 configs -= invoker.configs_to_remove
305 }
mtklein457b42a2016-08-23 13:56:37 -0700306 }
307 } else {
mtklein457b42a2016-08-23 13:56:37 -0700308 source_set(target_name) {
309 forward_variables_from(invoker,
310 "*",
311 [
312 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700313 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700314 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700315 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700316 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700317 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700318 ])
mtkleincd01b032016-08-31 04:58:19 -0700319 if (defined(invoker.sources_when_disabled)) {
320 sources = invoker.sources_when_disabled
321 }
322 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700323 }
mtkleineb3c4252016-08-23 07:38:09 -0700324 }
mtklein457b42a2016-08-23 13:56:37 -0700325}
mtklein457b42a2016-08-23 13:56:37 -0700326
mtkleina45be612016-08-29 15:22:10 -0700327optional("fontmgr_android") {
328 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700329
330 deps = [
331 "//third_party/expat",
332 "//third_party/freetype2",
333 ]
334 sources = [
335 "src/ports/SkFontMgr_android.cpp",
336 "src/ports/SkFontMgr_android_factory.cpp",
337 "src/ports/SkFontMgr_android_parser.cpp",
338 ]
339}
340
mtkleind2e39db2016-09-07 07:52:55 -0700341optional("fontmgr_custom") {
342 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
343
344 deps = [
345 "//third_party/freetype2",
346 ]
347 sources = [
348 "src/ports/SkFontMgr_custom.cpp",
349 "src/ports/SkFontMgr_custom_directory_factory.cpp",
350 ]
351}
352
mtklein3cc22182016-08-29 13:26:14 -0700353optional("fontmgr_fontconfig") {
354 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700355
356 deps = [
357 "//third_party:fontconfig",
358 "//third_party/freetype2",
359 ]
360 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700361 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700362 "src/ports/SkFontConfigInterface_direct.cpp",
363 "src/ports/SkFontConfigInterface_direct_factory.cpp",
364 "src/ports/SkFontMgr_FontConfigInterface.cpp",
365 "src/ports/SkFontMgr_fontconfig.cpp",
366 "src/ports/SkFontMgr_fontconfig_factory.cpp",
367 ]
368}
369
mtkleincdedd0e2016-09-12 15:15:44 -0700370optional("fontmgr_fuchsia") {
371 enabled = is_fuchsia && skia_use_freetype
372
373 deps = [
374 "//third_party/freetype2",
375 ]
376 sources = [
377 "src/ports/SkFontMgr_custom.cpp",
378 "src/ports/SkFontMgr_custom_empty_factory.cpp",
379 ]
380}
381
mtklein06c35c02016-09-20 12:28:12 -0700382optional("gpu") {
383 enabled = skia_enable_gpu
mtkleine9fb3d52016-09-20 15:11:46 -0700384 public_defines = []
385
mtklein06c35c02016-09-20 12:28:12 -0700386 sources = skia_gpu_sources + [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]
387
388 # These paths need to be absolute to match the ones produced by shared_sources.gni.
389 sources -= get_path_info([
390 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
391 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
392 ],
393 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400394 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700395 if (is_android) {
396 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
397 } else if (is_linux) {
398 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
399 } else if (is_mac) {
400 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800401 } else if (is_ios) {
402 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400403 } else if (is_win) {
404 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
405 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700406 } else {
407 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
408 }
mtkleine9fb3d52016-09-20 15:11:46 -0700409
410 if (skia_use_vulkan) {
411 public_defines += [ "SK_VULKAN" ]
412 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700413 if (skia_enable_vulkan_debug_layers) {
414 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
415 }
mtkleine9fb3d52016-09-20 15:11:46 -0700416 }
mtklein06c35c02016-09-20 12:28:12 -0700417}
418
mtklein63213812016-08-24 09:55:56 -0700419optional("jpeg") {
420 enabled = skia_use_libjpeg_turbo
421 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
422
mtklein63213812016-08-24 09:55:56 -0700423 deps = [
424 "//third_party/libjpeg-turbo:libjpeg",
425 ]
426 sources = [
427 "src/codec/SkJpegCodec.cpp",
428 "src/codec/SkJpegDecoderMgr.cpp",
429 "src/codec/SkJpegUtility.cpp",
430 "src/images/SkJPEGImageEncoder.cpp",
431 "src/images/SkJPEGWriteUtility.cpp",
432 ]
433}
434
435optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500436 enabled = skia_use_zlib && skia_enable_pdf
437 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700438
mtklein63213812016-08-24 09:55:56 -0700439 deps = [
440 "//third_party/zlib",
441 ]
brettwb9447282016-09-01 14:24:39 -0700442 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700443 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700444
445 if (skia_use_sfntly) {
446 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500447 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700448 }
449}
450
451optional("png") {
452 enabled = skia_use_libpng
453 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
454
mtklein63213812016-08-24 09:55:56 -0700455 deps = [
456 "//third_party/libpng",
457 ]
458 sources = [
459 "src/codec/SkIcoCodec.cpp",
460 "src/codec/SkPngCodec.cpp",
461 "src/images/SkPNGImageEncoder.cpp",
462 ]
463}
464
scroggof84ad642016-10-31 09:02:57 -0700465optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400466 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700467 public_defines = [ "SK_CODEC_DECODES_RAW" ]
468
469 deps = [
470 "//third_party/dng_sdk",
471 "//third_party/libjpeg-turbo:libjpeg",
472 "//third_party/piex",
473 ]
474
475 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
476 # Skia.
477 configs_to_remove = [ "//gn:no_exceptions" ]
478
479 sources = [
480 "src/codec/SkRawAdapterCodec.cpp",
481 "src/codec/SkRawCodec.cpp",
482 ]
483}
484
Mike Kleina7080262017-01-09 10:20:13 -0500485optional("splicer") {
486 enabled = skia_enable_splicer
487 public_defines = [ "SK_RASTER_PIPELINE_HAS_JIT" ]
488
489 sources = [
490 "src/splicer/SkSplicer.cpp",
491 ]
492}
493
mtklein3cc22182016-08-29 13:26:14 -0700494optional("typeface_freetype") {
495 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700496
497 deps = [
498 "//third_party/freetype2",
499 ]
500 sources = [
501 "src/ports/SkFontHost_FreeType.cpp",
502 "src/ports/SkFontHost_FreeType_common.cpp",
503 ]
504}
505
mtklein457b42a2016-08-23 13:56:37 -0700506optional("webp") {
507 enabled = skia_use_libwebp
508 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
509
mtklein457b42a2016-08-23 13:56:37 -0700510 deps = [
511 "//third_party/libwebp",
512 ]
513 sources = [
514 "src/codec/SkWebpAdapterCodec.cpp",
515 "src/codec/SkWebpCodec.cpp",
516 "src/images/SkWEBPImageEncoder.cpp",
517 ]
mtkleineb3c4252016-08-23 07:38:09 -0700518}
519
Mike Klein7f71d882017-01-06 12:00:31 -0500520optional("xbyak") {
521 enabled = skia_use_xbyak
Mike Kleina7080262017-01-09 10:20:13 -0500522 public_defines = [ "SK_RASTER_PIPELINE_HAS_JIT" ]
Mike Klein7f71d882017-01-06 12:00:31 -0500523
524 deps = [
525 "//third_party/xbyak",
526 ]
527
528 # xbyak uses exceptions, but SkXbyak catches them all.
529 configs_to_remove = [ "//gn:no_exceptions" ]
530
531 sources = [
532 "src/opts/SkXbyak.cpp",
533 ]
534}
535
mtklein63213812016-08-24 09:55:56 -0700536optional("xml") {
537 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000538 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700539
mtklein63213812016-08-24 09:55:56 -0700540 deps = [
541 "//third_party/expat",
542 ]
543 sources = [
544 "src/xml/SkDOM.cpp",
545 "src/xml/SkXMLParser.cpp",
546 "src/xml/SkXMLWriter.cpp",
547 ]
548}
549
mtkleinc04ff472016-06-23 10:29:30 -0700550component("skia") {
551 public_configs = [ ":skia_public" ]
552 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700553
554 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700555 ":arm64",
556 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700557 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700558 ":crc32",
mtkleina45be612016-08-29 15:22:10 -0700559 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700560 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700561 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700562 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700563 ":gpu",
Mike Klein78d5a3b2016-09-30 10:48:01 -0400564 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700565 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700566 ":none",
mtklein63213812016-08-24 09:55:56 -0700567 ":pdf",
568 ":png",
scroggof84ad642016-10-31 09:02:57 -0700569 ":raw",
Mike Kleina7080262017-01-09 10:20:13 -0500570 ":splicer",
mtklein9b8583d2016-08-24 17:32:30 -0700571 ":sse2",
572 ":sse41",
573 ":sse42",
574 ":ssse3",
mtklein3cc22182016-08-29 13:26:14 -0700575 ":typeface_freetype",
mtkleineb3c4252016-08-23 07:38:09 -0700576 ":webp",
Mike Klein7f71d882017-01-06 12:00:31 -0500577 ":xbyak",
mtklein63213812016-08-24 09:55:56 -0700578 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700579 ]
580
Chinmay Garde43f115c2016-11-16 15:04:12 -0800581 # This file (and all GN files in Skia) are designed to work with an
582 # empty sources assignment filter; we handle all that explicitly.
583 # We clear the filter here for clients who may have set up a global filter.
584 set_sources_assignment_filter([])
585
mtkleinc04ff472016-06-23 10:29:30 -0700586 sources = []
brettwb9447282016-09-01 14:24:39 -0700587 sources += skia_core_sources
588 sources += skia_effects_sources
brettwb9447282016-09-01 14:24:39 -0700589 sources += skia_sksl_sources
590 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500591 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700592 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700593 "src/android/SkBitmapRegionCodec.cpp",
594 "src/android/SkBitmapRegionDecoder.cpp",
595 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700596 "src/codec/SkBmpCodec.cpp",
597 "src/codec/SkBmpMaskCodec.cpp",
598 "src/codec/SkBmpRLECodec.cpp",
599 "src/codec/SkBmpStandardCodec.cpp",
600 "src/codec/SkCodec.cpp",
601 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700602 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700603 "src/codec/SkMaskSwizzler.cpp",
604 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700605 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700606 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700607 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700608 "src/codec/SkSwizzler.cpp",
609 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700610 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700611 "src/ports/SkDiscardableMemory_none.cpp",
612 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700613 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700614 "src/ports/SkMemory_malloc.cpp",
615 "src/ports/SkOSFile_stdio.cpp",
616 "src/sfnt/SkOTTable_name.cpp",
617 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700618 "src/svg/SkSVGCanvas.cpp",
619 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700620 "src/utils/mac/SkStream_mac.cpp",
621 "third_party/etc1/etc1.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700622 "third_party/gif/SkGifImageReader.cpp",
Leon Scroggins427da6f2016-12-16 13:51:59 +0000623 "third_party/ktx/ktx.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700624 ]
brettwb9447282016-09-01 14:24:39 -0700625
mtklein7d6fb2c2016-08-25 14:50:44 -0700626 libs = []
627
mtkleinc04ff472016-06-23 10:29:30 -0700628 if (is_win) {
629 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400630 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700631 "src/ports/SkDebug_win.cpp",
632 "src/ports/SkFontHost_win.cpp",
633 "src/ports/SkFontMgr_win_dw.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700634 "src/ports/SkImageEncoder_WIC.cpp",
635 "src/ports/SkImageGeneratorWIC.cpp",
636 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700637 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700638 "src/ports/SkScalerContext_win_dw.cpp",
639 "src/ports/SkTLS_win.cpp",
640 "src/ports/SkTypeface_win_dw.cpp",
641 ]
Mike Klein69f6ed42016-10-13 15:45:07 -0400642 if (skia_use_gdi) {
643 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
644 libs += [
645 "Gdi32.lib",
646 "Usp10.lib",
647 ]
648 } else {
649 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
650 }
mtkleinb9be9792016-09-16 14:44:18 -0700651 sources -=
652 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400653 libs += [
654 "FontSub.lib",
655 "Ole32.lib",
656 "OleAut32.lib",
657 "User32.lib",
658 ]
mtkleinc04ff472016-06-23 10:29:30 -0700659 } else {
660 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700661 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700662 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700663 "src/ports/SkTLS_pthread.cpp",
664 ]
665 }
666
mtklein7d6fb2c2016-08-25 14:50:44 -0700667 if (is_android) {
Mike Kleinc3083332016-12-12 09:03:56 -0500668 deps += [ "//third_party/expat" ]
mtklein06c35c02016-09-20 12:28:12 -0700669 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700670 libs += [
671 "EGL",
672 "GLESv2",
673 "log",
674 ]
675 }
676
mtkleinc04ff472016-06-23 10:29:30 -0700677 if (is_linux) {
mtklein09e61f72016-08-23 13:35:28 -0700678 libs += [
679 "GL",
680 "GLU",
681 "X11",
682 ]
mtklein06c35c02016-09-20 12:28:12 -0700683 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700684 }
685
686 if (is_mac) {
687 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700688 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700689 "src/ports/SkFontHost_mac.cpp",
690 "src/ports/SkImageEncoder_CG.cpp",
691 "src/ports/SkImageGeneratorCG.cpp",
692 ]
mtklein09e61f72016-08-23 13:35:28 -0700693 libs += [
694 "ApplicationServices.framework",
695 "OpenGL.framework",
696 ]
mtkleinc04ff472016-06-23 10:29:30 -0700697 }
abarth6fc8ff02016-07-15 15:15:15 -0700698
Mike Klein7d302882016-11-03 14:06:31 -0400699 if (is_ios) {
700 sources += [
701 "src/ports/SkDebug_stdio.cpp",
702 "src/ports/SkFontHost_mac.cpp",
703 "src/ports/SkImageEncoder_CG.cpp",
704 "src/ports/SkImageGeneratorCG.cpp",
705 ]
706 libs += [
707 "CoreFoundation.framework",
708 "CoreGraphics.framework",
709 "CoreText.framework",
710 "ImageIO.framework",
711 "MobileCoreServices.framework",
712 ]
713 }
714
abarth6fc8ff02016-07-15 15:15:15 -0700715 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700716 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700717 }
mtkleinc04ff472016-06-23 10:29:30 -0700718}
719
mtkleinc095df52016-08-24 12:23:52 -0700720# Targets guarded by skia_enable_tools may use //third_party freely.
721if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -0500722 # Used by gn_to_bp.py to list our public include dirs.
723 source_set("public") {
724 configs += [ ":skia_public" ]
725 }
726
Mike Kleinc36dedf2016-11-18 09:35:28 -0500727 config("skia.h_config") {
728 include_dirs = [ "$target_gen_dir" ]
729 }
730 action("skia.h") {
731 public_configs = [ ":skia.h_config" ]
732 skia_h = "$target_gen_dir/skia.h"
733 script = "gn/find_headers.py"
734 args = [ rebase_path(skia_h, root_build_dir) ] +
735 rebase_path(skia_public_includes)
736 depfile = "$skia_h.deps"
737 outputs = [
738 skia_h,
739 ]
740 }
741
742 if (skia_enable_gpu && target_cpu == "x64") {
743 # Our bots only have 64-bit libOSMesa installed.
744 # TODO: worth fixing?
745 executable("fiddle") {
746 libs = []
747 if (is_linux) {
748 libs += [ "OSMesa" ]
749 }
750
751 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -0500752 "tools/fiddle/draw.cpp",
753 "tools/fiddle/fiddle_main.cpp",
754 ]
755 deps = [
756 ":skia",
757 ":skia.h",
758 ]
759 }
760 }
761
762 if (skia_enable_gpu) {
763 source_set("public_headers_warnings_check") {
764 sources = [
765 "tools/public_headers_warnings_check.cpp",
766 ]
767 configs -= [ "//gn:warnings_except_public_headers" ]
768 deps = [
769 ":skia",
770 ":skia.h",
771 ]
772 }
773 }
774
mtkleinc095df52016-08-24 12:23:52 -0700775 template("test_lib") {
776 config(target_name + "_config") {
777 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700778 if (defined(invoker.public_defines)) {
779 defines = invoker.public_defines
780 }
mtklein25c81d42016-07-27 13:55:26 -0700781 }
mtkleinc095df52016-08-24 12:23:52 -0700782 source_set(target_name) {
783 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
784 public_configs = [
785 ":" + target_name + "_config",
786 ":skia_private",
787 ]
788
789 if (!defined(deps)) {
790 deps = []
791 }
792 deps += [ ":skia" ]
793 testonly = true
794 }
mtklein25c81d42016-07-27 13:55:26 -0700795 }
mtklein25c81d42016-07-27 13:55:26 -0700796
Mike Kleine6682eb2017-01-05 10:54:57 -0500797 template("test_app") {
798 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
799 shared_library("lib" + target_name) {
800 forward_variables_from(invoker, "*", [ "is_shared_library" ])
801 testonly = true
802 }
803 } else {
Mike Klein7d921032017-01-05 12:20:41 -0500804 _executable = target_name
805 executable(_executable) {
Mike Kleine6682eb2017-01-05 10:54:57 -0500806 forward_variables_from(invoker, "*", [ "is_shared_library" ])
807 testonly = true
808 }
809 }
Mike Klein7d921032017-01-05 12:20:41 -0500810 if (is_android && skia_android_serial != "" && defined(_executable)) {
811 action("push_" + target_name) {
812 script = "gn/push_to_android.py"
813 deps = [
814 ":" + _executable,
815 ]
816 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
817 outputs = [
818 _stamp,
819 ]
820 args = [
821 rebase_path("$root_build_dir/$_executable"),
822 skia_android_serial,
823 rebase_path(_stamp),
824 ]
825 testonly = true
826 }
827 }
Mike Kleine6682eb2017-01-05 10:54:57 -0500828 }
829
mtkleinc095df52016-08-24 12:23:52 -0700830 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700831 public_include_dirs = []
832 if (skia_enable_gpu) {
833 public_defines = []
834 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700835
836 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700837 sources = [
838 "tools/gpu/GrContextFactory.cpp",
839 "tools/gpu/GrTest.cpp",
840 "tools/gpu/TestContext.cpp",
841 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -0700842 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -0700843 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
844 "tools/gpu/gl/debug/GrBufferObj.cpp",
845 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
846 "tools/gpu/gl/debug/GrProgramObj.cpp",
847 "tools/gpu/gl/debug/GrShaderObj.cpp",
848 "tools/gpu/gl/debug/GrTextureObj.cpp",
849 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
850 "tools/gpu/gl/null/NullGLTestContext.cpp",
851 ]
852 libs = []
mtklein25c81d42016-07-27 13:55:26 -0700853
mtklein38925aa2016-09-21 10:11:25 -0700854 if (is_android) {
855 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -0400856 } else if (is_ios) {
857 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
858 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -0700859 } else if (is_linux) {
860 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
861 } else if (is_mac) {
862 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400863 } else if (is_win) {
864 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
865 libs += [
866 "Gdi32.lib",
867 "OpenGL32.lib",
868 ]
mtklein38925aa2016-09-21 10:11:25 -0700869 }
mtklein6ef69992016-09-14 06:12:09 -0700870
Mike Kleinc168a3a2016-11-14 14:53:13 +0000871 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +0000872 deps += [ "//third_party/angle2" ]
873 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
874 }
mtklein38925aa2016-09-21 10:11:25 -0700875 if (skia_use_mesa) {
876 public_defines += [ "SK_MESA" ]
877 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
878 libs += [ "OSMesa" ]
879 }
mtkleind68f9b02016-09-23 13:18:41 -0700880 if (skia_use_vulkan) {
881 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
882 }
mtkleina627b5c2016-09-20 13:36:47 -0700883 }
mtklein25c81d42016-07-27 13:55:26 -0700884 }
mtklein25c81d42016-07-27 13:55:26 -0700885
mtkleinc095df52016-08-24 12:23:52 -0700886 test_lib("flags") {
887 public_include_dirs = [ "tools/flags" ]
888 sources = [
889 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -0700890 ]
891 }
892 test_lib("common_flags") {
893 public_include_dirs = [ "tools/flags" ]
894 sources = [
mtkleinc095df52016-08-24 12:23:52 -0700895 "tools/flags/SkCommonFlags.cpp",
896 "tools/flags/SkCommonFlagsConfig.cpp",
897 ]
898 deps = [
mtklein046cb562016-09-16 10:23:12 -0700899 ":flags",
mtkleinc095df52016-08-24 12:23:52 -0700900 ":gpu_tool_utils",
901 ]
902 }
mtklein25c81d42016-07-27 13:55:26 -0700903
mtkleinc095df52016-08-24 12:23:52 -0700904 test_lib("tool_utils") {
905 public_include_dirs = [
906 "tools",
907 "tools/debugger",
908 "tools/timer",
909 ]
910 sources = [
mtkleinc095df52016-08-24 12:23:52 -0700911 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtkleinb37c0342016-09-09 11:07:45 -0700912 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700913 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -0700914 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700915 "tools/ProcStats.cpp",
916 "tools/Resources.cpp",
917 "tools/ThermalManager.cpp",
918 "tools/UrlDataManager.cpp",
919 "tools/debugger/SkDebugCanvas.cpp",
920 "tools/debugger/SkDrawCommand.cpp",
921 "tools/debugger/SkJsonWriteBuffer.cpp",
922 "tools/debugger/SkObjectParser.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700923 "tools/picture_utils.cpp",
924 "tools/random_parse_path.cpp",
925 "tools/sk_tool_utils.cpp",
926 "tools/sk_tool_utils_font.cpp",
927 "tools/timer/Timer.cpp",
928 ]
929 deps = [
mtklein046cb562016-09-16 10:23:12 -0700930 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -0700931 ":flags",
932 "//third_party/libpng",
933 ]
934 public_deps = [
935 "//third_party/jsoncpp",
936 ]
937 }
mtklein25c81d42016-07-27 13:55:26 -0700938
Mike Klein6e744122016-10-27 12:21:40 -0400939 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -0700940 test_lib("gm") {
941 public_include_dirs = [ "gm" ]
942 sources = gm_sources
943 deps = [
scroggo19b91532016-10-24 09:03:26 -0700944 ":flags",
mtkleinc095df52016-08-24 12:23:52 -0700945 ":gpu_tool_utils",
946 ":skia",
947 ":tool_utils",
948 ]
949 }
mtklein25c81d42016-07-27 13:55:26 -0700950
Mike Klein6e744122016-10-27 12:21:40 -0400951 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -0700952 test_lib("tests") {
953 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -0400954 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -0700955 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -0400956 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -0700957 }
mtkleinc095df52016-08-24 12:23:52 -0700958 deps = [
fmalita6cf896d2016-08-25 08:44:35 -0700959 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -0700960 ":flags",
961 ":gpu_tool_utils",
962 ":skia",
963 ":tool_utils",
964 "//third_party/libpng",
965 "//third_party/zlib",
966 ]
967 }
mtklein2f3416d2016-08-02 16:02:05 -0700968
Mike Klein6e744122016-10-27 12:21:40 -0400969 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -0700970 test_lib("bench") {
971 public_include_dirs = [ "bench" ]
972 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -0700973 deps = [
974 ":flags",
975 ":gm",
976 ":gpu_tool_utils",
977 ":skia",
978 ":tool_utils",
979 ]
980 }
mtklein2b6870c2016-07-28 14:17:33 -0700981
mtkleinc095df52016-08-24 12:23:52 -0700982 test_lib("experimental_svg_model") {
983 public_include_dirs = [ "experimental/svg/model" ]
984 sources = [
985 "experimental/svg/model/SkSVGAttribute.cpp",
986 "experimental/svg/model/SkSVGAttributeParser.cpp",
987 "experimental/svg/model/SkSVGCircle.cpp",
Florin Malitace8840e2016-12-08 09:26:47 -0500988 "experimental/svg/model/SkSVGClipPath.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700989 "experimental/svg/model/SkSVGContainer.cpp",
990 "experimental/svg/model/SkSVGDOM.cpp",
991 "experimental/svg/model/SkSVGEllipse.cpp",
992 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -0700993 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700994 "experimental/svg/model/SkSVGNode.cpp",
995 "experimental/svg/model/SkSVGPath.cpp",
996 "experimental/svg/model/SkSVGPoly.cpp",
997 "experimental/svg/model/SkSVGRect.cpp",
998 "experimental/svg/model/SkSVGRenderContext.cpp",
999 "experimental/svg/model/SkSVGSVG.cpp",
1000 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -07001001 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001002 "experimental/svg/model/SkSVGTransformableNode.cpp",
1003 "experimental/svg/model/SkSVGValue.cpp",
1004 ]
1005 deps = [
1006 ":skia",
1007 ]
1008 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001009
Brian Osman16adfa32016-10-18 14:42:44 -04001010 test_lib("views") {
1011 public_include_dirs = [ "include/views" ]
1012 sources = [
1013 "src/views/SkEvent.cpp",
1014 "src/views/SkEventSink.cpp",
1015 "src/views/SkOSMenu.cpp",
1016 "src/views/SkTagList.cpp",
1017 "src/views/SkTouchGesture.cpp",
1018 "src/views/SkView.cpp",
1019 "src/views/SkViewPriv.cpp",
1020 ]
1021 libs = []
Brian Osman34755e22016-12-05 09:46:02 -05001022 deps = []
Brian Osman16adfa32016-10-18 14:42:44 -04001023 if (!is_android) {
1024 sources += [ "src/views/SkWindow.cpp" ]
1025 }
Jim Van Verth4e56a912016-10-21 10:58:52 -04001026 if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001027 public_include_dirs += [ "src/views/unix" ]
1028 sources += [
1029 "src/views/unix/SkOSWindow_Unix.cpp",
1030 "src/views/unix/keysym2ucs.c",
1031 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001032 } else if (is_mac) {
1033 sources += [
1034 "src/views/mac/SkEventNotifier.mm",
1035 "src/views/mac/SkNSView.mm",
1036 "src/views/mac/SkOSWindow_Mac.mm",
1037 "src/views/mac/SkTextFieldCell.m",
1038 ]
1039 libs += [
1040 "QuartzCore.framework",
1041 "Cocoa.framework",
1042 "Foundation.framework",
1043 ]
1044 } else if (is_win) {
1045 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1046 }
Brian Osman34755e22016-12-05 09:46:02 -05001047 if (skia_use_angle) {
1048 deps += [ "//third_party/angle2" ]
1049 }
Brian Osman16adfa32016-10-18 14:42:44 -04001050 }
1051
Mike Klein38af9432016-11-11 11:39:44 -05001052 if (skia_use_lua) {
1053 test_lib("lua") {
1054 public_include_dirs = []
1055 sources = [
1056 "src/utils/SkLua.cpp",
1057 "src/utils/SkLuaCanvas.cpp",
1058 ]
1059 deps = [
1060 "//third_party/lua",
1061 ]
1062 }
1063
Mike Kleine6682eb2017-01-05 10:54:57 -05001064 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001065 sources = [
1066 "tools/lua/lua_app.cpp",
1067 ]
1068 deps = [
1069 ":lua",
1070 ":skia",
1071 "//third_party/lua",
1072 ]
Mike Klein38af9432016-11-11 11:39:44 -05001073 }
1074
Mike Kleine6682eb2017-01-05 10:54:57 -05001075 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001076 sources = [
1077 "tools/lua/lua_pictures.cpp",
1078 ]
1079 deps = [
1080 ":flags",
1081 ":lua",
1082 ":skia",
1083 ":tool_utils",
1084 "//third_party/lua",
1085 ]
Mike Klein38af9432016-11-11 11:39:44 -05001086 }
1087 }
1088
Mike Klein6e744122016-10-27 12:21:40 -04001089 import("gn/samples.gni")
Brian Osman16adfa32016-10-18 14:42:44 -04001090 test_lib("samples") {
Brian Osman16adfa32016-10-18 14:42:44 -04001091 public_include_dirs = [ "samplecode" ]
Mike Klein6e744122016-10-27 12:21:40 -04001092 include_dirs = [ "experimental" ]
1093 sources = samples_sources + [
1094 "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp",
1095 "experimental/SkSetPoly3To3.cpp",
1096 "experimental/SkSetPoly3To3_A.cpp",
1097 "experimental/SkSetPoly3To3_D.cpp",
1098 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001099 deps = [
1100 ":experimental_svg_model",
Mike Klein6e744122016-10-27 12:21:40 -04001101 ":gm",
Brian Osman16adfa32016-10-18 14:42:44 -04001102 ":tool_utils",
1103 ":views",
1104 ":xml",
1105 ]
Mike Klein38af9432016-11-11 11:39:44 -05001106
1107 if (skia_use_lua) {
1108 sources += [ "samplecode/SampleLua.cpp" ]
1109 deps += [
1110 ":lua",
1111 "//third_party/lua",
1112 ]
1113 }
Brian Osman16adfa32016-10-18 14:42:44 -04001114 }
1115
Mike Kleine6682eb2017-01-05 10:54:57 -05001116 test_app("dm") {
mtklein2b6870c2016-07-28 14:17:33 -07001117 sources = [
1118 "dm/DM.cpp",
1119 "dm/DMJsonWriter.cpp",
1120 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -07001121 ]
1122 include_dirs = [ "tests" ]
1123 deps = [
mtklein046cb562016-09-16 10:23:12 -07001124 ":common_flags",
fmalitaa2b9fdf2016-08-03 19:53:36 -07001125 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001126 ":flags",
1127 ":gm",
1128 ":gpu_tool_utils",
1129 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -07001130 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -07001131 ":tool_utils",
1132 "//third_party/jsoncpp",
1133 "//third_party/libpng",
1134 ]
mtklein2b6870c2016-07-28 14:17:33 -07001135 }
1136
Mike Kleina3430172016-09-27 16:46:29 -04001137 if (!is_debug) { # I've benchmarked debug code once too many times...
Mike Kleine6682eb2017-01-05 10:54:57 -05001138 test_app("monobench") {
Mike Kleina3430172016-09-27 16:46:29 -04001139 sources = [
1140 "tools/monobench.cpp",
1141 ]
1142 deps = [
1143 ":bench",
1144 ":skia",
1145 ]
Mike Kleina3430172016-09-27 16:46:29 -04001146 }
mtklein2b6870c2016-07-28 14:17:33 -07001147 }
1148
Mike Kleine6682eb2017-01-05 10:54:57 -05001149 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001150 sources = [
1151 "bench/nanobench.cpp",
1152 ]
1153 deps = [
1154 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001155 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001156 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001157 ":flags",
1158 ":gm",
1159 ":gpu_tool_utils",
1160 ":skia",
1161 ":tool_utils",
1162 "//third_party/jsoncpp",
1163 ]
mtklein2b6870c2016-07-28 14:17:33 -07001164 }
halcanary19a97202016-08-03 15:08:04 -07001165
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001166 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001167 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001168 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001169 "samplecode/SampleApp.cpp",
1170 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001171 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001172 if (is_mac) {
1173 sources += [ "src/views/mac/skia_mac.mm" ]
1174 } else if (is_win) {
1175 sources += [ "src/views/win/skia_win.cpp" ]
1176 } else if (is_linux) {
1177 sources += [ "src/views/unix/skia_unix.cpp" ]
1178 }
mtklein38925aa2016-09-21 10:11:25 -07001179 deps = [
1180 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001181 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001182 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001183 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001184 ":skia",
1185 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001186 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001187 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001188 if (skia_use_angle) {
1189 deps += [ "//third_party/angle2" ]
1190 }
mtklein38925aa2016-09-21 10:11:25 -07001191 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001192 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001193
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001194 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001195 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001196 sources = [
1197 "tools/skpbench/skpbench.cpp",
1198 ]
1199 deps = [
1200 ":flags",
1201 ":gpu_tool_utils",
1202 ":skia",
1203 ":tool_utils",
1204 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001205 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001206 }
1207
Mike Klein7d302882016-11-03 14:06:31 -04001208 # We can't yet build ICU on iOS or Windows.
1209 if (!is_ios && !is_win) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001210 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001211 sources = [
1212 "tools/SkShaper_harfbuzz.cpp",
1213 "tools/using_skia_and_harfbuzz.cpp",
1214 ]
1215 deps = [
1216 ":skia",
1217 "//third_party/harfbuzz",
1218 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001219 }
halcanary19a97202016-08-03 15:08:04 -07001220 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001221 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001222 sources = [
1223 "tools/SkShaper_primitive.cpp",
1224 "tools/using_skia_and_harfbuzz.cpp",
1225 ]
1226 deps = [
1227 ":skia",
1228 ]
halcanary3eee9d92016-09-10 07:01:53 -07001229 }
mtklein046cb562016-09-16 10:23:12 -07001230
Mike Kleine6682eb2017-01-05 10:54:57 -05001231 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001232 sources = [
1233 "tools/get_images_from_skps.cpp",
1234 ]
1235 deps = [
1236 ":flags",
1237 ":skia",
1238 "//third_party/jsoncpp",
1239 ]
mtklein046cb562016-09-16 10:23:12 -07001240 }
mtkleinecbc5262016-09-22 11:51:24 -07001241
Mike Kleine6682eb2017-01-05 10:54:57 -05001242 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001243 sources = [
1244 "tools/colorspaceinfo.cpp",
1245 ]
1246 deps = [
1247 ":flags",
1248 ":skia",
1249 ":tool_utils",
1250 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001251 }
1252
Mike Klein7d302882016-11-03 14:06:31 -04001253 if (!is_ios) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001254 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001255 sources = [
1256 "tools/skiaserve/Request.cpp",
1257 "tools/skiaserve/Response.cpp",
1258 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001259 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1260 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1261 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1262 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1263 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1264 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1265 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1266 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1267 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001268 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1269 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001270 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1271 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1272 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1273 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1274 ]
1275 deps = [
1276 ":flags",
1277 ":gpu_tool_utils",
1278 ":skia",
1279 ":tool_utils",
1280 "//third_party/jsoncpp",
1281 "//third_party/libmicrohttpd",
1282 "//third_party/libpng",
1283 ]
Mike Klein7d302882016-11-03 14:06:31 -04001284 }
mtkleinecbc5262016-09-22 11:51:24 -07001285 }
kjlubick14f984b2016-10-03 11:49:45 -07001286
Mike Kleine6682eb2017-01-05 10:54:57 -05001287 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001288 sources = [
1289 "fuzz/FilterFuzz.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001290 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001291 "fuzz/FuzzGradients.cpp",
1292 "fuzz/FuzzParsePath.cpp",
1293 "fuzz/FuzzPathop.cpp",
1294 "fuzz/FuzzScaleToSides.cpp",
1295 "fuzz/fuzz.cpp",
1296 ]
1297 deps = [
1298 ":flags",
1299 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001300 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001301 ]
kjlubick14f984b2016-10-03 11:49:45 -07001302 }
Mike Klein38312422016-10-05 15:41:01 -04001303
Mike Kleine6682eb2017-01-05 10:54:57 -05001304 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001305 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001306 rebase_path("tests/skia_test.cpp"),
1307 rebase_path("tests/Test.cpp"),
1308 ]
caryclark9feb6322016-10-25 08:58:26 -07001309 deps = [
1310 ":flags",
1311 ":gpu_tool_utils",
1312 ":skia",
1313 ":tool_utils",
1314 ]
caryclark9feb6322016-10-25 08:58:26 -07001315 }
1316
Mike Kleine6682eb2017-01-05 10:54:57 -05001317 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001318 sources = [
1319 "tools/DumpRecord.cpp",
1320 "tools/dump_record.cpp",
1321 ]
1322 deps = [
1323 ":flags",
1324 ":skia",
1325 ]
Mike Klein38312422016-10-05 15:41:01 -04001326 }
bungemanfe917272016-10-13 17:36:40 -04001327
Mike Kleine6682eb2017-01-05 10:54:57 -05001328 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001329 sources = [
1330 "tools/skdiff/skdiff.cpp",
1331 "tools/skdiff/skdiff_html.cpp",
1332 "tools/skdiff/skdiff_main.cpp",
1333 "tools/skdiff/skdiff_utils.cpp",
1334 ]
1335 deps = [
1336 ":skia",
1337 ":tool_utils",
1338 ]
bungemanfe917272016-10-13 17:36:40 -04001339 }
halcanarya73d76a2016-10-17 13:19:02 -07001340
Mike Kleine6682eb2017-01-05 10:54:57 -05001341 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001342 sources = [
1343 "tools/skp_parser.cpp",
1344 ]
1345 deps = [
1346 ":skia",
1347 ":tool_utils",
1348 "//third_party/jsoncpp",
1349 ]
halcanarya73d76a2016-10-17 13:19:02 -07001350 }
Brian Osman16adfa32016-10-18 14:42:44 -04001351
Mike Kleina92c3832016-12-08 09:49:39 -05001352 if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001353 test_app("viewer") {
1354 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001355 sources = [
1356 "tools/viewer/GMSlide.cpp",
1357 "tools/viewer/ImageSlide.cpp",
1358 "tools/viewer/SKPSlide.cpp",
1359 "tools/viewer/SampleSlide.cpp",
1360 "tools/viewer/Viewer.cpp",
1361 "tools/viewer/sk_app/CommandSet.cpp",
1362 "tools/viewer/sk_app/GLWindowContext.cpp",
1363 "tools/viewer/sk_app/Window.cpp",
1364 "tools/viewer/sk_app/WindowContext.cpp",
1365 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001366 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001367
Jim Van Verth4e56a912016-10-21 10:58:52 -04001368 if (is_android) {
1369 sources += [
1370 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1371 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1372 "tools/viewer/sk_app/android/Window_android.cpp",
1373 "tools/viewer/sk_app/android/main_android.cpp",
1374 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1375 ]
1376 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001377 sources += [
1378 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1379 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1380 "tools/viewer/sk_app/unix/Window_unix.cpp",
1381 "tools/viewer/sk_app/unix/main_unix.cpp",
1382 ]
1383 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001384 sources += [
1385 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1386 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1387 "tools/viewer/sk_app/win/Window_win.cpp",
1388 "tools/viewer/sk_app/win/main_win.cpp",
1389 ]
Mike Klein43c25262016-10-20 10:17:47 -04001390 } else if (is_mac) {
1391 sources += [
1392 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1393 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1394 "tools/viewer/sk_app/mac/Window_mac.cpp",
1395 "tools/viewer/sk_app/mac/main_mac.cpp",
1396 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001397 }
1398
1399 if (skia_use_vulkan) {
1400 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001401 if (is_android) {
1402 sources +=
1403 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
1404 libs += [ "android" ]
1405 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001406 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1407 libs += [ "X11-xcb" ]
1408 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001409 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1410 }
1411 }
1412
1413 include_dirs = []
1414 deps = [
1415 ":flags",
1416 ":gm",
1417 ":gpu_tool_utils",
1418 ":samples",
1419 ":skia",
1420 ":tool_utils",
1421 ":views",
1422 "//third_party/jsoncpp",
1423 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001424 if (is_android) {
1425 deps += [ "//third_party/native_app_glue" ]
1426 } else if (is_mac) {
Mike Klein43c25262016-10-20 10:17:47 -04001427 deps += [ "//third_party/libsdl" ]
1428 }
Mike Kleina92c3832016-12-08 09:49:39 -05001429 }
Brian Osman16adfa32016-10-18 14:42:44 -04001430 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001431
Derek Sollenberger70120c72017-01-05 11:39:04 -05001432 if (is_android) {
1433 copy("gdbserver") {
1434 sources = [
1435 "$ndk/$ndk_gdbserver",
1436 ]
1437 outputs = [
1438 "$root_out_dir/gdbserver",
1439 ]
1440 }
1441 if (ndk_simpleperf != "") {
1442 copy("simpleperf") {
1443 sources = [
1444 "$ndk/$ndk_simpleperf",
1445 "$ndk/simpleperf/simpleperf_report.py",
1446 ]
1447 outputs = [
1448 "$root_out_dir/{{source_file_part}}",
1449 ]
1450 }
1451 }
1452 }
1453
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001454 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001455 test_app("skslc") {
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001456 sources = [
1457 "src/sksl/SkSLMain.cpp",
1458 ]
1459 deps = [
1460 ":flags",
1461 ":skia",
1462 ]
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001463 }
1464 }
mtklein25c81d42016-07-27 13:55:26 -07001465}