blob: 681a7882e32314bb637050875e05bfa03f3bf1ac [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
mtklein63213812016-08-24 09:55:56 -070026 skia_use_zlib = true
mtklein1bd72ba2016-09-16 07:45:52 -070027
28 skia_enable_android_framework_defines = false
Brian Osman3f375d02016-12-28 11:19:22 -050029 skia_enable_discrete_gpu = true
mtklein06c35c02016-09-20 12:28:12 -070030 skia_enable_gpu = true
Hal Canary43fb7a02016-12-30 13:09:03 -050031 skia_enable_pdf = true
mtklein3e8012e2016-09-21 09:14:19 -070032 skia_enable_tools = is_skia_standalone
33 skia_enable_vulkan_debug_layers = is_skia_standalone && is_debug
Greg Daniel686bb212016-10-27 10:48:48 -040034 skia_vulkan_sdk = getenv("VULKAN_SDK")
mtkleinc04ff472016-06-23 10:29:30 -070035}
Brian Salomon23d73ea2016-10-27 13:31:37 -040036declare_args() {
James Robinson14b748d2016-11-12 18:29:39 -080037 skia_use_dng_sdk =
38 !is_fuchsia && !is_win && skia_use_libjpeg_turbo && skia_use_zlib
Mike Klein10d665d2016-11-01 11:46:10 -040039 skia_use_sfntly = skia_use_icu
40
Mike Klein4d598a32016-10-31 13:44:49 -040041 if (is_android) {
42 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
43 } else {
44 skia_use_vulkan = skia_vulkan_sdk != ""
45 }
Brian Salomon23d73ea2016-10-27 13:31:37 -040046}
Brian Salomon789e25e2016-09-30 13:41:03 -040047
mtklein38925aa2016-09-21 10:11:25 -070048# Our tools require static linking (they use non-exported symbols).
49skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070050
mtkleina45be612016-08-29 15:22:10 -070051fontmgr_android_enabled = skia_use_expat && skia_use_freetype
52
mtklein1211e0c2016-07-26 13:55:45 -070053skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070054 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070055 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070056 "include/codec",
57 "include/config",
58 "include/core",
59 "include/effects",
60 "include/gpu",
61 "include/gpu/gl",
62 "include/images",
63 "include/pathops",
64 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070065 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070066 "include/utils",
67 "include/utils/mac",
mtklein25c81d42016-07-27 13:55:26 -070068 "include/xml",
mtklein1211e0c2016-07-26 13:55:45 -070069]
70
mtkleinc04ff472016-06-23 10:29:30 -070071# Skia public API, generally provided by :skia.
72config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -070073 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -040074 defines = []
75 if (is_component_build) {
76 defines += [ "SKIA_DLL" ]
77 }
Mike Kleinc4cbd742016-09-26 21:37:09 -040078 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -070079 defines += [ "SK_SAMPLES_FOR_X" ]
80 }
mtkleincae1be52016-09-20 08:24:34 -070081 if (skia_enable_android_framework_defines) {
Mike Kleincfc4f442016-10-26 17:19:03 -040082 defines += android_framework_defines
mtkleincae1be52016-09-20 08:24:34 -070083 }
mtklein06c35c02016-09-20 12:28:12 -070084 if (!skia_enable_gpu) {
85 defines += [ "SK_SUPPORT_GPU=0" ]
86 }
mtkleinc04ff472016-06-23 10:29:30 -070087}
88
89# Skia internal APIs, used by Skia itself and a few test tools.
90config("skia_private") {
91 visibility = [ ":*" ]
92
93 include_dirs = [
94 "include/private",
95 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -070096 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -070097 "src/core",
98 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -070099 "src/effects/gradients",
100 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -0700101 "src/gpu",
102 "src/image",
103 "src/images",
104 "src/lazy",
105 "src/opts",
106 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -0700107 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -0700108 "src/ports",
109 "src/sfnt",
mtklein9e0d9dd2016-08-30 10:37:19 -0700110 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700111 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700112 "src/utils/win",
mtkleinc04ff472016-06-23 10:29:30 -0700113 "third_party/etc1",
scroggo19b91532016-10-24 09:03:26 -0700114 "third_party/gif",
Leon Scroggins427da6f2016-12-16 13:51:59 +0000115 "third_party/ktx",
mtkleinc04ff472016-06-23 10:29:30 -0700116 ]
mtklein150d1132016-08-01 06:56:40 -0700117
Jim Van Verthb6c5e532016-10-28 10:38:08 -0400118 defines = [
119 "SK_GAMMA_APPLY_TO_A8",
120 "SK_INTERNAL",
121 ]
mtkleinb37c0342016-09-09 11:07:45 -0700122 if (is_android) {
123 defines += [
124 "SK_GAMMA_EXPONENT=1.4",
125 "SK_GAMMA_CONTRAST=0.0",
126 ]
127 }
mtklein88a7ac02016-09-14 11:16:49 -0700128 if (is_official_build || is_android) {
129 # TODO(bsalomon): it'd be nice to make Android normal.
130 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
131 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400132 libs = []
133 lib_dirs = []
134 if (skia_use_vulkan) {
Greg Danielab563d42016-10-31 11:19:59 -0400135 if (skia_vulkan_sdk != "" && !is_android) {
Mike Klein487bfc22016-10-14 14:04:56 -0400136 if (is_win) {
137 include_dirs += [ "$skia_vulkan_sdk/Include/" ]
138 lib_dirs += [ "$skia_vulkan_sdk/Bin" ]
139 } else {
Greg Daniel686bb212016-10-27 10:48:48 -0400140 include_dirs += [ "$skia_vulkan_sdk/include/" ]
141 lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
Mike Klein487bfc22016-10-14 14:04:56 -0400142 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400143 }
Mike Klein487bfc22016-10-14 14:04:56 -0400144 if (is_win) {
145 libs += [ "vulkan-1.lib" ]
146 } else {
147 libs += [ "vulkan" ]
148 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400149 }
Brian Osman34755e22016-12-05 09:46:02 -0500150 if (skia_use_angle) {
151 defines += [ "SK_ANGLE" ]
152 }
Brian Osman3f375d02016-12-28 11:19:22 -0500153 if (skia_enable_discrete_gpu) {
154 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
155 }
mtkleinc04ff472016-06-23 10:29:30 -0700156}
157
158# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
159config("skia_library") {
160 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700161 defines = [ "SKIA_IMPLEMENTATION=1" ]
162}
163
164skia_library_configs = [
165 ":skia_public",
166 ":skia_private",
167 ":skia_library",
168]
169
mtklein9b8583d2016-08-24 17:32:30 -0700170# Use for CPU-specific Skia code that needs particular compiler flags.
171template("opts") {
172 if (invoker.enabled) {
173 source_set(target_name) {
174 forward_variables_from(invoker, "*")
175 configs += skia_library_configs
176 }
177 } else {
178 # If not enabled, a phony empty target that swallows all otherwise unused variables.
179 source_set(target_name) {
180 forward_variables_from(invoker,
181 "*",
182 [
183 "sources",
184 "cflags",
185 ])
186 }
187 }
anmittala7eaf2e2016-08-17 13:57:26 -0700188}
189
mtklein422310d2016-08-16 18:28:43 -0700190is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700191
mtklein7d6fb2c2016-08-25 14:50:44 -0700192opts("none") {
193 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700194 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700195 cflags = []
196}
197
mtklein7d6fb2c2016-08-25 14:50:44 -0700198opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700199 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700200 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700201 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700202}
203
204opts("arm64") {
205 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700206 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700207 cflags = []
208}
209
210opts("crc32") {
211 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700212 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700213 cflags = [ "-march=armv8-a+crc" ]
214}
215
mtklein9b8583d2016-08-24 17:32:30 -0700216opts("sse2") {
217 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700218 sources = skia_opts.sse2_sources
Mike Kleind8765e32016-10-19 13:39:13 -0400219 if (is_win) {
220 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
221 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400222 cflags = [ "-msse2" ]
223 }
mtklein9b8583d2016-08-24 17:32:30 -0700224}
mtkleinc04ff472016-06-23 10:29:30 -0700225
mtklein9b8583d2016-08-24 17:32:30 -0700226opts("ssse3") {
227 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700228 sources = skia_opts.ssse3_sources
Mike Kleind8765e32016-10-19 13:39:13 -0400229 if (is_win) {
230 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
231 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400232 cflags = [ "-mssse3" ]
233 }
mtklein9b8583d2016-08-24 17:32:30 -0700234}
mtkleinc04ff472016-06-23 10:29:30 -0700235
mtklein9b8583d2016-08-24 17:32:30 -0700236opts("sse41") {
237 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700238 sources = skia_opts.sse41_sources
Mike Kleind8765e32016-10-19 13:39:13 -0400239 if (is_win) {
240 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
241 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400242 cflags = [ "-msse4.1" ]
243 }
mtklein9b8583d2016-08-24 17:32:30 -0700244}
mtklein4e976072016-08-08 09:06:27 -0700245
mtklein9b8583d2016-08-24 17:32:30 -0700246opts("sse42") {
247 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700248 sources = skia_opts.sse42_sources
Mike Kleind8765e32016-10-19 13:39:13 -0400249 if (is_win) {
250 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
251 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400252 cflags = [ "-msse4.2" ]
253 }
mtklein9b8583d2016-08-24 17:32:30 -0700254}
255
256opts("avx") {
257 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700258 sources = skia_opts.avx_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400259 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000260 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400261 } else {
262 cflags = [ "-mavx" ]
263 }
mtkleinc04ff472016-06-23 10:29:30 -0700264}
265
Mike Klein78d5a3b2016-09-30 10:48:01 -0400266opts("hsw") {
267 enabled = is_x86
268 sources = skia_opts.hsw_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400269 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000270 cflags = [ "/arch:AVX2" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400271 } else {
272 cflags = [
273 "-mavx2",
274 "-mbmi",
275 "-mbmi2",
276 "-mf16c",
277 "-mfma",
278 ]
279 }
Mike Klein78d5a3b2016-09-30 10:48:01 -0400280}
281
mtkleinc095df52016-08-24 12:23:52 -0700282# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700283template("optional") {
284 if (invoker.enabled) {
285 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700286 if (defined(invoker.public_defines)) {
287 defines = invoker.public_defines
288 }
mtklein457b42a2016-08-23 13:56:37 -0700289 }
290 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700291 forward_variables_from(invoker,
292 "*",
293 [
294 "public_defines",
295 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700296 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700297 ])
mtklein457b42a2016-08-23 13:56:37 -0700298 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700299 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700300 if (defined(invoker.configs_to_remove)) {
301 configs -= invoker.configs_to_remove
302 }
mtklein457b42a2016-08-23 13:56:37 -0700303 }
304 } else {
mtklein457b42a2016-08-23 13:56:37 -0700305 source_set(target_name) {
306 forward_variables_from(invoker,
307 "*",
308 [
309 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700310 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700311 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700312 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700313 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700314 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700315 ])
mtkleincd01b032016-08-31 04:58:19 -0700316 if (defined(invoker.sources_when_disabled)) {
317 sources = invoker.sources_when_disabled
318 }
319 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700320 }
mtkleineb3c4252016-08-23 07:38:09 -0700321 }
mtklein457b42a2016-08-23 13:56:37 -0700322}
mtklein457b42a2016-08-23 13:56:37 -0700323
mtkleina45be612016-08-29 15:22:10 -0700324optional("fontmgr_android") {
325 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700326
327 deps = [
328 "//third_party/expat",
329 "//third_party/freetype2",
330 ]
331 sources = [
332 "src/ports/SkFontMgr_android.cpp",
333 "src/ports/SkFontMgr_android_factory.cpp",
334 "src/ports/SkFontMgr_android_parser.cpp",
335 ]
336}
337
mtkleind2e39db2016-09-07 07:52:55 -0700338optional("fontmgr_custom") {
339 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
340
341 deps = [
342 "//third_party/freetype2",
343 ]
344 sources = [
345 "src/ports/SkFontMgr_custom.cpp",
346 "src/ports/SkFontMgr_custom_directory_factory.cpp",
347 ]
348}
349
mtklein3cc22182016-08-29 13:26:14 -0700350optional("fontmgr_fontconfig") {
351 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700352
353 deps = [
354 "//third_party:fontconfig",
355 "//third_party/freetype2",
356 ]
357 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700358 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700359 "src/ports/SkFontConfigInterface_direct.cpp",
360 "src/ports/SkFontConfigInterface_direct_factory.cpp",
361 "src/ports/SkFontMgr_FontConfigInterface.cpp",
362 "src/ports/SkFontMgr_fontconfig.cpp",
363 "src/ports/SkFontMgr_fontconfig_factory.cpp",
364 ]
365}
366
mtkleincdedd0e2016-09-12 15:15:44 -0700367optional("fontmgr_fuchsia") {
368 enabled = is_fuchsia && skia_use_freetype
369
370 deps = [
371 "//third_party/freetype2",
372 ]
373 sources = [
374 "src/ports/SkFontMgr_custom.cpp",
375 "src/ports/SkFontMgr_custom_empty_factory.cpp",
376 ]
377}
378
mtklein06c35c02016-09-20 12:28:12 -0700379optional("gpu") {
380 enabled = skia_enable_gpu
mtkleine9fb3d52016-09-20 15:11:46 -0700381 public_defines = []
382
mtklein06c35c02016-09-20 12:28:12 -0700383 sources = skia_gpu_sources + [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]
384
385 # These paths need to be absolute to match the ones produced by shared_sources.gni.
386 sources -= get_path_info([
387 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
388 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
389 ],
390 "abspath")
Mike Klein703cf5a2016-10-13 17:18:04 -0400391 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700392 if (is_android) {
393 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
394 } else if (is_linux) {
395 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
396 } else if (is_mac) {
397 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
Chinmay Garde130a1182016-11-23 11:43:56 -0800398 } else if (is_ios) {
399 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400400 } else if (is_win) {
401 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
402 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700403 } else {
404 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
405 }
mtkleine9fb3d52016-09-20 15:11:46 -0700406
407 if (skia_use_vulkan) {
408 public_defines += [ "SK_VULKAN" ]
409 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700410 if (skia_enable_vulkan_debug_layers) {
411 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
412 }
mtkleine9fb3d52016-09-20 15:11:46 -0700413 }
mtklein06c35c02016-09-20 12:28:12 -0700414}
415
mtklein63213812016-08-24 09:55:56 -0700416optional("jpeg") {
417 enabled = skia_use_libjpeg_turbo
418 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
419
mtklein63213812016-08-24 09:55:56 -0700420 deps = [
421 "//third_party/libjpeg-turbo:libjpeg",
422 ]
423 sources = [
424 "src/codec/SkJpegCodec.cpp",
425 "src/codec/SkJpegDecoderMgr.cpp",
426 "src/codec/SkJpegUtility.cpp",
427 "src/images/SkJPEGImageEncoder.cpp",
428 "src/images/SkJPEGWriteUtility.cpp",
429 ]
430}
431
432optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500433 enabled = skia_use_zlib && skia_enable_pdf
434 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700435
mtklein63213812016-08-24 09:55:56 -0700436 deps = [
437 "//third_party/zlib",
438 ]
brettwb9447282016-09-01 14:24:39 -0700439 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700440 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700441
442 if (skia_use_sfntly) {
443 deps += [ "//third_party/sfntly" ]
Hal Canary43fb7a02016-12-30 13:09:03 -0500444 public_defines += [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700445 }
446}
447
448optional("png") {
449 enabled = skia_use_libpng
450 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
451
mtklein63213812016-08-24 09:55:56 -0700452 deps = [
453 "//third_party/libpng",
454 ]
455 sources = [
456 "src/codec/SkIcoCodec.cpp",
457 "src/codec/SkPngCodec.cpp",
458 "src/images/SkPNGImageEncoder.cpp",
459 ]
460}
461
scroggof84ad642016-10-31 09:02:57 -0700462optional("raw") {
Mike Klein10d665d2016-11-01 11:46:10 -0400463 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700464 public_defines = [ "SK_CODEC_DECODES_RAW" ]
465
466 deps = [
467 "//third_party/dng_sdk",
468 "//third_party/libjpeg-turbo:libjpeg",
469 "//third_party/piex",
470 ]
471
472 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
473 # Skia.
474 configs_to_remove = [ "//gn:no_exceptions" ]
475
476 sources = [
477 "src/codec/SkRawAdapterCodec.cpp",
478 "src/codec/SkRawCodec.cpp",
479 ]
480}
481
mtklein3cc22182016-08-29 13:26:14 -0700482optional("typeface_freetype") {
483 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700484
485 deps = [
486 "//third_party/freetype2",
487 ]
488 sources = [
489 "src/ports/SkFontHost_FreeType.cpp",
490 "src/ports/SkFontHost_FreeType_common.cpp",
491 ]
492}
493
mtklein457b42a2016-08-23 13:56:37 -0700494optional("webp") {
495 enabled = skia_use_libwebp
496 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
497
mtklein457b42a2016-08-23 13:56:37 -0700498 deps = [
499 "//third_party/libwebp",
500 ]
501 sources = [
502 "src/codec/SkWebpAdapterCodec.cpp",
503 "src/codec/SkWebpCodec.cpp",
504 "src/images/SkWEBPImageEncoder.cpp",
505 ]
mtkleineb3c4252016-08-23 07:38:09 -0700506}
507
mtklein63213812016-08-24 09:55:56 -0700508optional("xml") {
509 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +0000510 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -0700511
mtklein63213812016-08-24 09:55:56 -0700512 deps = [
513 "//third_party/expat",
514 ]
515 sources = [
516 "src/xml/SkDOM.cpp",
517 "src/xml/SkXMLParser.cpp",
518 "src/xml/SkXMLWriter.cpp",
519 ]
520}
521
mtkleinc04ff472016-06-23 10:29:30 -0700522component("skia") {
523 public_configs = [ ":skia_public" ]
524 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700525
526 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700527 ":arm64",
528 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700529 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700530 ":crc32",
mtkleina45be612016-08-29 15:22:10 -0700531 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700532 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700533 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700534 ":fontmgr_fuchsia",
mtklein06c35c02016-09-20 12:28:12 -0700535 ":gpu",
Mike Klein78d5a3b2016-09-30 10:48:01 -0400536 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700537 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700538 ":none",
mtklein63213812016-08-24 09:55:56 -0700539 ":pdf",
540 ":png",
scroggof84ad642016-10-31 09:02:57 -0700541 ":raw",
mtklein9b8583d2016-08-24 17:32:30 -0700542 ":sse2",
543 ":sse41",
544 ":sse42",
545 ":ssse3",
mtklein3cc22182016-08-29 13:26:14 -0700546 ":typeface_freetype",
mtkleineb3c4252016-08-23 07:38:09 -0700547 ":webp",
mtklein63213812016-08-24 09:55:56 -0700548 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700549 ]
550
Chinmay Garde43f115c2016-11-16 15:04:12 -0800551 # This file (and all GN files in Skia) are designed to work with an
552 # empty sources assignment filter; we handle all that explicitly.
553 # We clear the filter here for clients who may have set up a global filter.
554 set_sources_assignment_filter([])
555
mtkleinc04ff472016-06-23 10:29:30 -0700556 sources = []
brettwb9447282016-09-01 14:24:39 -0700557 sources += skia_core_sources
558 sources += skia_effects_sources
brettwb9447282016-09-01 14:24:39 -0700559 sources += skia_sksl_sources
560 sources += skia_utils_sources
Hal Canary6ad3d2f2016-12-20 16:15:56 -0500561 sources += skia_xps_sources
mtkleinc04ff472016-06-23 10:29:30 -0700562 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700563 "src/android/SkBitmapRegionCodec.cpp",
564 "src/android/SkBitmapRegionDecoder.cpp",
565 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700566 "src/codec/SkBmpCodec.cpp",
567 "src/codec/SkBmpMaskCodec.cpp",
568 "src/codec/SkBmpRLECodec.cpp",
569 "src/codec/SkBmpStandardCodec.cpp",
570 "src/codec/SkCodec.cpp",
571 "src/codec/SkCodecImageGenerator.cpp",
scroggo19b91532016-10-24 09:03:26 -0700572 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700573 "src/codec/SkMaskSwizzler.cpp",
574 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700575 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700576 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -0700577 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700578 "src/codec/SkSwizzler.cpp",
579 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700580 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700581 "src/ports/SkDiscardableMemory_none.cpp",
582 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700583 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700584 "src/ports/SkMemory_malloc.cpp",
585 "src/ports/SkOSFile_stdio.cpp",
586 "src/sfnt/SkOTTable_name.cpp",
587 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700588 "src/svg/SkSVGCanvas.cpp",
589 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700590 "src/utils/mac/SkStream_mac.cpp",
591 "third_party/etc1/etc1.cpp",
scroggo3d3a65c2016-10-24 12:28:30 -0700592 "third_party/gif/SkGifImageReader.cpp",
Leon Scroggins427da6f2016-12-16 13:51:59 +0000593 "third_party/ktx/ktx.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700594 ]
brettwb9447282016-09-01 14:24:39 -0700595
mtklein7d6fb2c2016-08-25 14:50:44 -0700596 libs = []
597
mtkleinc04ff472016-06-23 10:29:30 -0700598 if (is_win) {
599 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400600 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700601 "src/ports/SkDebug_win.cpp",
602 "src/ports/SkFontHost_win.cpp",
603 "src/ports/SkFontMgr_win_dw.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700604 "src/ports/SkImageEncoder_WIC.cpp",
605 "src/ports/SkImageGeneratorWIC.cpp",
606 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700607 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700608 "src/ports/SkScalerContext_win_dw.cpp",
609 "src/ports/SkTLS_win.cpp",
610 "src/ports/SkTypeface_win_dw.cpp",
611 ]
Mike Klein69f6ed42016-10-13 15:45:07 -0400612 if (skia_use_gdi) {
613 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
614 libs += [
615 "Gdi32.lib",
616 "Usp10.lib",
617 ]
618 } else {
619 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
620 }
mtkleinb9be9792016-09-16 14:44:18 -0700621 sources -=
622 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400623 libs += [
624 "FontSub.lib",
625 "Ole32.lib",
626 "OleAut32.lib",
627 "User32.lib",
628 ]
mtkleinc04ff472016-06-23 10:29:30 -0700629 } else {
630 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700631 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700632 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700633 "src/ports/SkTLS_pthread.cpp",
634 ]
635 }
636
mtklein7d6fb2c2016-08-25 14:50:44 -0700637 if (is_android) {
Mike Kleinc3083332016-12-12 09:03:56 -0500638 deps += [ "//third_party/expat" ]
mtklein06c35c02016-09-20 12:28:12 -0700639 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700640 libs += [
641 "EGL",
642 "GLESv2",
643 "log",
644 ]
645 }
646
mtkleinc04ff472016-06-23 10:29:30 -0700647 if (is_linux) {
mtklein09e61f72016-08-23 13:35:28 -0700648 libs += [
649 "GL",
650 "GLU",
651 "X11",
652 ]
mtklein06c35c02016-09-20 12:28:12 -0700653 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700654 }
655
656 if (is_mac) {
657 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700658 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700659 "src/ports/SkFontHost_mac.cpp",
660 "src/ports/SkImageEncoder_CG.cpp",
661 "src/ports/SkImageGeneratorCG.cpp",
662 ]
mtklein09e61f72016-08-23 13:35:28 -0700663 libs += [
664 "ApplicationServices.framework",
665 "OpenGL.framework",
666 ]
mtkleinc04ff472016-06-23 10:29:30 -0700667 }
abarth6fc8ff02016-07-15 15:15:15 -0700668
Mike Klein7d302882016-11-03 14:06:31 -0400669 if (is_ios) {
670 sources += [
671 "src/ports/SkDebug_stdio.cpp",
672 "src/ports/SkFontHost_mac.cpp",
673 "src/ports/SkImageEncoder_CG.cpp",
674 "src/ports/SkImageGeneratorCG.cpp",
675 ]
676 libs += [
677 "CoreFoundation.framework",
678 "CoreGraphics.framework",
679 "CoreText.framework",
680 "ImageIO.framework",
681 "MobileCoreServices.framework",
682 ]
683 }
684
abarth6fc8ff02016-07-15 15:15:15 -0700685 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700686 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700687 }
mtkleinc04ff472016-06-23 10:29:30 -0700688}
689
mtkleinc095df52016-08-24 12:23:52 -0700690# Targets guarded by skia_enable_tools may use //third_party freely.
691if (skia_enable_tools) {
Mike Klein308b5ac2016-12-06 16:03:52 -0500692 # Used by gn_to_bp.py to list our public include dirs.
693 source_set("public") {
694 configs += [ ":skia_public" ]
695 }
696
Mike Kleinc36dedf2016-11-18 09:35:28 -0500697 config("skia.h_config") {
698 include_dirs = [ "$target_gen_dir" ]
699 }
700 action("skia.h") {
701 public_configs = [ ":skia.h_config" ]
702 skia_h = "$target_gen_dir/skia.h"
703 script = "gn/find_headers.py"
704 args = [ rebase_path(skia_h, root_build_dir) ] +
705 rebase_path(skia_public_includes)
706 depfile = "$skia_h.deps"
707 outputs = [
708 skia_h,
709 ]
710 }
711
712 if (skia_enable_gpu && target_cpu == "x64") {
713 # Our bots only have 64-bit libOSMesa installed.
714 # TODO: worth fixing?
715 executable("fiddle") {
716 libs = []
717 if (is_linux) {
718 libs += [ "OSMesa" ]
719 }
720
721 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -0500722 "tools/fiddle/draw.cpp",
723 "tools/fiddle/fiddle_main.cpp",
724 ]
725 deps = [
726 ":skia",
727 ":skia.h",
728 ]
729 }
730 }
731
732 if (skia_enable_gpu) {
733 source_set("public_headers_warnings_check") {
734 sources = [
735 "tools/public_headers_warnings_check.cpp",
736 ]
737 configs -= [ "//gn:warnings_except_public_headers" ]
738 deps = [
739 ":skia",
740 ":skia.h",
741 ]
742 }
743 }
744
mtkleinc095df52016-08-24 12:23:52 -0700745 template("test_lib") {
746 config(target_name + "_config") {
747 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700748 if (defined(invoker.public_defines)) {
749 defines = invoker.public_defines
750 }
mtklein25c81d42016-07-27 13:55:26 -0700751 }
mtkleinc095df52016-08-24 12:23:52 -0700752 source_set(target_name) {
753 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
754 public_configs = [
755 ":" + target_name + "_config",
756 ":skia_private",
757 ]
758
759 if (!defined(deps)) {
760 deps = []
761 }
762 deps += [ ":skia" ]
763 testonly = true
764 }
mtklein25c81d42016-07-27 13:55:26 -0700765 }
mtklein25c81d42016-07-27 13:55:26 -0700766
Mike Kleine6682eb2017-01-05 10:54:57 -0500767 template("test_app") {
768 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
769 shared_library("lib" + target_name) {
770 forward_variables_from(invoker, "*", [ "is_shared_library" ])
771 testonly = true
772 }
773 } else {
774 executable(target_name) {
775 forward_variables_from(invoker, "*", [ "is_shared_library" ])
776 testonly = true
777 }
778 }
779 }
780
mtkleinc095df52016-08-24 12:23:52 -0700781 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700782 public_include_dirs = []
783 if (skia_enable_gpu) {
784 public_defines = []
785 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700786
787 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700788 sources = [
789 "tools/gpu/GrContextFactory.cpp",
790 "tools/gpu/GrTest.cpp",
791 "tools/gpu/TestContext.cpp",
792 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -0700793 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -0700794 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
795 "tools/gpu/gl/debug/GrBufferObj.cpp",
796 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
797 "tools/gpu/gl/debug/GrProgramObj.cpp",
798 "tools/gpu/gl/debug/GrShaderObj.cpp",
799 "tools/gpu/gl/debug/GrTextureObj.cpp",
800 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
801 "tools/gpu/gl/null/NullGLTestContext.cpp",
802 ]
803 libs = []
mtklein25c81d42016-07-27 13:55:26 -0700804
mtklein38925aa2016-09-21 10:11:25 -0700805 if (is_android) {
806 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
Mike Klein7d302882016-11-03 14:06:31 -0400807 } else if (is_ios) {
808 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
809 libs += [ "OpenGLES.framework" ]
mtklein38925aa2016-09-21 10:11:25 -0700810 } else if (is_linux) {
811 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
812 } else if (is_mac) {
813 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400814 } else if (is_win) {
815 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
816 libs += [
817 "Gdi32.lib",
818 "OpenGL32.lib",
819 ]
mtklein38925aa2016-09-21 10:11:25 -0700820 }
mtklein6ef69992016-09-14 06:12:09 -0700821
Mike Kleinc168a3a2016-11-14 14:53:13 +0000822 if (skia_use_angle) {
Mike Kleinc168a3a2016-11-14 14:53:13 +0000823 deps += [ "//third_party/angle2" ]
824 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
825 }
mtklein38925aa2016-09-21 10:11:25 -0700826 if (skia_use_mesa) {
827 public_defines += [ "SK_MESA" ]
828 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
829 libs += [ "OSMesa" ]
830 }
mtkleind68f9b02016-09-23 13:18:41 -0700831 if (skia_use_vulkan) {
832 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
833 }
mtkleina627b5c2016-09-20 13:36:47 -0700834 }
mtklein25c81d42016-07-27 13:55:26 -0700835 }
mtklein25c81d42016-07-27 13:55:26 -0700836
mtkleinc095df52016-08-24 12:23:52 -0700837 test_lib("flags") {
838 public_include_dirs = [ "tools/flags" ]
839 sources = [
840 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -0700841 ]
842 }
843 test_lib("common_flags") {
844 public_include_dirs = [ "tools/flags" ]
845 sources = [
mtkleinc095df52016-08-24 12:23:52 -0700846 "tools/flags/SkCommonFlags.cpp",
847 "tools/flags/SkCommonFlagsConfig.cpp",
848 ]
849 deps = [
mtklein046cb562016-09-16 10:23:12 -0700850 ":flags",
mtkleinc095df52016-08-24 12:23:52 -0700851 ":gpu_tool_utils",
852 ]
853 }
mtklein25c81d42016-07-27 13:55:26 -0700854
mtkleinc095df52016-08-24 12:23:52 -0700855 test_lib("tool_utils") {
856 public_include_dirs = [
857 "tools",
858 "tools/debugger",
859 "tools/timer",
860 ]
861 sources = [
mtkleinc095df52016-08-24 12:23:52 -0700862 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtkleinb37c0342016-09-09 11:07:45 -0700863 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700864 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -0700865 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700866 "tools/ProcStats.cpp",
867 "tools/Resources.cpp",
868 "tools/ThermalManager.cpp",
869 "tools/UrlDataManager.cpp",
870 "tools/debugger/SkDebugCanvas.cpp",
871 "tools/debugger/SkDrawCommand.cpp",
872 "tools/debugger/SkJsonWriteBuffer.cpp",
873 "tools/debugger/SkObjectParser.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700874 "tools/picture_utils.cpp",
875 "tools/random_parse_path.cpp",
876 "tools/sk_tool_utils.cpp",
877 "tools/sk_tool_utils_font.cpp",
878 "tools/timer/Timer.cpp",
879 ]
880 deps = [
mtklein046cb562016-09-16 10:23:12 -0700881 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -0700882 ":flags",
883 "//third_party/libpng",
884 ]
885 public_deps = [
886 "//third_party/jsoncpp",
887 ]
888 }
mtklein25c81d42016-07-27 13:55:26 -0700889
Mike Klein6e744122016-10-27 12:21:40 -0400890 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -0700891 test_lib("gm") {
892 public_include_dirs = [ "gm" ]
893 sources = gm_sources
894 deps = [
scroggo19b91532016-10-24 09:03:26 -0700895 ":flags",
mtkleinc095df52016-08-24 12:23:52 -0700896 ":gpu_tool_utils",
897 ":skia",
898 ":tool_utils",
899 ]
900 }
mtklein25c81d42016-07-27 13:55:26 -0700901
Mike Klein6e744122016-10-27 12:21:40 -0400902 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -0700903 test_lib("tests") {
904 public_include_dirs = [ "tests" ]
Mike Klein6e744122016-10-27 12:21:40 -0400905 sources = tests_sources + pathops_tests_sources
mtkleina45be612016-08-29 15:22:10 -0700906 if (!fontmgr_android_enabled) {
Mike Klein6e744122016-10-27 12:21:40 -0400907 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -0700908 }
mtkleinc095df52016-08-24 12:23:52 -0700909 deps = [
fmalita6cf896d2016-08-25 08:44:35 -0700910 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -0700911 ":flags",
912 ":gpu_tool_utils",
913 ":skia",
914 ":tool_utils",
915 "//third_party/libpng",
916 "//third_party/zlib",
917 ]
918 }
mtklein2f3416d2016-08-02 16:02:05 -0700919
Mike Klein6e744122016-10-27 12:21:40 -0400920 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -0700921 test_lib("bench") {
922 public_include_dirs = [ "bench" ]
923 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -0700924 deps = [
925 ":flags",
926 ":gm",
927 ":gpu_tool_utils",
928 ":skia",
929 ":tool_utils",
930 ]
931 }
mtklein2b6870c2016-07-28 14:17:33 -0700932
mtkleinc095df52016-08-24 12:23:52 -0700933 test_lib("experimental_svg_model") {
934 public_include_dirs = [ "experimental/svg/model" ]
935 sources = [
936 "experimental/svg/model/SkSVGAttribute.cpp",
937 "experimental/svg/model/SkSVGAttributeParser.cpp",
938 "experimental/svg/model/SkSVGCircle.cpp",
Florin Malitace8840e2016-12-08 09:26:47 -0500939 "experimental/svg/model/SkSVGClipPath.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700940 "experimental/svg/model/SkSVGContainer.cpp",
941 "experimental/svg/model/SkSVGDOM.cpp",
942 "experimental/svg/model/SkSVGEllipse.cpp",
943 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -0700944 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700945 "experimental/svg/model/SkSVGNode.cpp",
946 "experimental/svg/model/SkSVGPath.cpp",
947 "experimental/svg/model/SkSVGPoly.cpp",
948 "experimental/svg/model/SkSVGRect.cpp",
949 "experimental/svg/model/SkSVGRenderContext.cpp",
950 "experimental/svg/model/SkSVGSVG.cpp",
951 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -0700952 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700953 "experimental/svg/model/SkSVGTransformableNode.cpp",
954 "experimental/svg/model/SkSVGValue.cpp",
955 ]
956 deps = [
957 ":skia",
958 ]
959 }
fmalitaa2b9fdf2016-08-03 19:53:36 -0700960
Brian Osman16adfa32016-10-18 14:42:44 -0400961 test_lib("views") {
962 public_include_dirs = [ "include/views" ]
963 sources = [
964 "src/views/SkEvent.cpp",
965 "src/views/SkEventSink.cpp",
966 "src/views/SkOSMenu.cpp",
967 "src/views/SkTagList.cpp",
968 "src/views/SkTouchGesture.cpp",
969 "src/views/SkView.cpp",
970 "src/views/SkViewPriv.cpp",
971 ]
972 libs = []
Brian Osman34755e22016-12-05 09:46:02 -0500973 deps = []
Brian Osman16adfa32016-10-18 14:42:44 -0400974 if (!is_android) {
975 sources += [ "src/views/SkWindow.cpp" ]
976 }
Jim Van Verth4e56a912016-10-21 10:58:52 -0400977 if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -0400978 public_include_dirs += [ "src/views/unix" ]
979 sources += [
980 "src/views/unix/SkOSWindow_Unix.cpp",
981 "src/views/unix/keysym2ucs.c",
982 ]
Brian Osman16adfa32016-10-18 14:42:44 -0400983 } else if (is_mac) {
984 sources += [
985 "src/views/mac/SkEventNotifier.mm",
986 "src/views/mac/SkNSView.mm",
987 "src/views/mac/SkOSWindow_Mac.mm",
988 "src/views/mac/SkTextFieldCell.m",
989 ]
990 libs += [
991 "QuartzCore.framework",
992 "Cocoa.framework",
993 "Foundation.framework",
994 ]
995 } else if (is_win) {
996 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
997 }
Brian Osman34755e22016-12-05 09:46:02 -0500998 if (skia_use_angle) {
999 deps += [ "//third_party/angle2" ]
1000 }
Brian Osman16adfa32016-10-18 14:42:44 -04001001 }
1002
Mike Klein38af9432016-11-11 11:39:44 -05001003 if (skia_use_lua) {
1004 test_lib("lua") {
1005 public_include_dirs = []
1006 sources = [
1007 "src/utils/SkLua.cpp",
1008 "src/utils/SkLuaCanvas.cpp",
1009 ]
1010 deps = [
1011 "//third_party/lua",
1012 ]
1013 }
1014
Mike Kleine6682eb2017-01-05 10:54:57 -05001015 test_app("lua_app") {
Mike Klein38af9432016-11-11 11:39:44 -05001016 sources = [
1017 "tools/lua/lua_app.cpp",
1018 ]
1019 deps = [
1020 ":lua",
1021 ":skia",
1022 "//third_party/lua",
1023 ]
Mike Klein38af9432016-11-11 11:39:44 -05001024 }
1025
Mike Kleine6682eb2017-01-05 10:54:57 -05001026 test_app("lua_pictures") {
Mike Klein38af9432016-11-11 11:39:44 -05001027 sources = [
1028 "tools/lua/lua_pictures.cpp",
1029 ]
1030 deps = [
1031 ":flags",
1032 ":lua",
1033 ":skia",
1034 ":tool_utils",
1035 "//third_party/lua",
1036 ]
Mike Klein38af9432016-11-11 11:39:44 -05001037 }
1038 }
1039
Mike Klein6e744122016-10-27 12:21:40 -04001040 import("gn/samples.gni")
Brian Osman16adfa32016-10-18 14:42:44 -04001041 test_lib("samples") {
Brian Osman16adfa32016-10-18 14:42:44 -04001042 public_include_dirs = [ "samplecode" ]
Mike Klein6e744122016-10-27 12:21:40 -04001043 include_dirs = [ "experimental" ]
1044 sources = samples_sources + [
1045 "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp",
1046 "experimental/SkSetPoly3To3.cpp",
1047 "experimental/SkSetPoly3To3_A.cpp",
1048 "experimental/SkSetPoly3To3_D.cpp",
1049 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001050 deps = [
1051 ":experimental_svg_model",
Mike Klein6e744122016-10-27 12:21:40 -04001052 ":gm",
Brian Osman16adfa32016-10-18 14:42:44 -04001053 ":tool_utils",
1054 ":views",
1055 ":xml",
1056 ]
Mike Klein38af9432016-11-11 11:39:44 -05001057
1058 if (skia_use_lua) {
1059 sources += [ "samplecode/SampleLua.cpp" ]
1060 deps += [
1061 ":lua",
1062 "//third_party/lua",
1063 ]
1064 }
Brian Osman16adfa32016-10-18 14:42:44 -04001065 }
1066
Mike Kleine6682eb2017-01-05 10:54:57 -05001067 test_app("dm") {
mtklein2b6870c2016-07-28 14:17:33 -07001068 sources = [
1069 "dm/DM.cpp",
1070 "dm/DMJsonWriter.cpp",
1071 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -07001072 ]
1073 include_dirs = [ "tests" ]
1074 deps = [
mtklein046cb562016-09-16 10:23:12 -07001075 ":common_flags",
fmalitaa2b9fdf2016-08-03 19:53:36 -07001076 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001077 ":flags",
1078 ":gm",
1079 ":gpu_tool_utils",
1080 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -07001081 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -07001082 ":tool_utils",
1083 "//third_party/jsoncpp",
1084 "//third_party/libpng",
1085 ]
mtklein2b6870c2016-07-28 14:17:33 -07001086 }
1087
Mike Kleina3430172016-09-27 16:46:29 -04001088 if (!is_debug) { # I've benchmarked debug code once too many times...
Mike Kleine6682eb2017-01-05 10:54:57 -05001089 test_app("monobench") {
Mike Kleina3430172016-09-27 16:46:29 -04001090 sources = [
1091 "tools/monobench.cpp",
1092 ]
1093 deps = [
1094 ":bench",
1095 ":skia",
1096 ]
Mike Kleina3430172016-09-27 16:46:29 -04001097 }
mtklein2b6870c2016-07-28 14:17:33 -07001098 }
1099
Mike Kleine6682eb2017-01-05 10:54:57 -05001100 test_app("nanobench") {
mtklein2b6870c2016-07-28 14:17:33 -07001101 sources = [
1102 "bench/nanobench.cpp",
1103 ]
1104 deps = [
1105 ":bench",
mtklein046cb562016-09-16 10:23:12 -07001106 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -07001107 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07001108 ":flags",
1109 ":gm",
1110 ":gpu_tool_utils",
1111 ":skia",
1112 ":tool_utils",
1113 "//third_party/jsoncpp",
1114 ]
mtklein2b6870c2016-07-28 14:17:33 -07001115 }
halcanary19a97202016-08-03 15:08:04 -07001116
Jim Van Verth57a98fc2016-10-28 13:35:50 -04001117 if (is_linux || is_win || is_mac) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001118 test_app("SampleApp") {
mtklein38925aa2016-09-21 10:11:25 -07001119 sources = [
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001120 "samplecode/SampleApp.cpp",
1121 "samplecode/SamplePictFile.cpp",
mtklein38925aa2016-09-21 10:11:25 -07001122 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001123 if (is_mac) {
1124 sources += [ "src/views/mac/skia_mac.mm" ]
1125 } else if (is_win) {
1126 sources += [ "src/views/win/skia_win.cpp" ]
1127 } else if (is_linux) {
1128 sources += [ "src/views/unix/skia_unix.cpp" ]
1129 }
mtklein38925aa2016-09-21 10:11:25 -07001130 deps = [
1131 ":flags",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001132 ":gm",
mtklein38925aa2016-09-21 10:11:25 -07001133 ":gpu_tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001134 ":samples",
mtklein38925aa2016-09-21 10:11:25 -07001135 ":skia",
1136 ":tool_utils",
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001137 ":views",
mtklein38925aa2016-09-21 10:11:25 -07001138 ]
Mike Kleinc168a3a2016-11-14 14:53:13 +00001139 if (skia_use_angle) {
1140 deps += [ "//third_party/angle2" ]
1141 }
mtklein38925aa2016-09-21 10:11:25 -07001142 }
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001143 }
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001144
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001145 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001146 test_app("skpbench") {
Jim Van Verth8f5468f2016-10-31 09:52:33 -04001147 sources = [
1148 "tools/skpbench/skpbench.cpp",
1149 ]
1150 deps = [
1151 ":flags",
1152 ":gpu_tool_utils",
1153 ":skia",
1154 ":tool_utils",
1155 ]
Jim Van Verthb6c5e532016-10-28 10:38:08 -04001156 }
csmartdalton4b5179b2016-09-19 11:03:58 -07001157 }
1158
Mike Klein7d302882016-11-03 14:06:31 -04001159 # We can't yet build ICU on iOS or Windows.
1160 if (!is_ios && !is_win) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001161 test_app("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -07001162 sources = [
1163 "tools/SkShaper_harfbuzz.cpp",
1164 "tools/using_skia_and_harfbuzz.cpp",
1165 ]
1166 deps = [
1167 ":skia",
1168 "//third_party/harfbuzz",
1169 ]
mtklein6f5df6a2016-08-29 16:01:10 -07001170 }
halcanary19a97202016-08-03 15:08:04 -07001171 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001172 test_app("sktexttopdf") {
halcanary3eee9d92016-09-10 07:01:53 -07001173 sources = [
1174 "tools/SkShaper_primitive.cpp",
1175 "tools/using_skia_and_harfbuzz.cpp",
1176 ]
1177 deps = [
1178 ":skia",
1179 ]
halcanary3eee9d92016-09-10 07:01:53 -07001180 }
mtklein046cb562016-09-16 10:23:12 -07001181
Mike Kleine6682eb2017-01-05 10:54:57 -05001182 test_app("get_images_from_skps") {
mtklein046cb562016-09-16 10:23:12 -07001183 sources = [
1184 "tools/get_images_from_skps.cpp",
1185 ]
1186 deps = [
1187 ":flags",
1188 ":skia",
1189 "//third_party/jsoncpp",
1190 ]
mtklein046cb562016-09-16 10:23:12 -07001191 }
mtkleinecbc5262016-09-22 11:51:24 -07001192
Mike Kleine6682eb2017-01-05 10:54:57 -05001193 test_app("colorspaceinfo") {
Matt Sarett8740d582016-11-11 13:59:14 -05001194 sources = [
1195 "tools/colorspaceinfo.cpp",
1196 ]
1197 deps = [
1198 ":flags",
1199 ":skia",
1200 ":tool_utils",
1201 ]
Matt Sarett8740d582016-11-11 13:59:14 -05001202 }
1203
Mike Klein7d302882016-11-03 14:06:31 -04001204 if (!is_ios) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001205 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04001206 sources = [
1207 "tools/skiaserve/Request.cpp",
1208 "tools/skiaserve/Response.cpp",
1209 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001210 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1211 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1212 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1213 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1214 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1215 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1216 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1217 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1218 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05001219 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1220 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001221 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1222 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1223 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1224 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1225 ]
1226 deps = [
1227 ":flags",
1228 ":gpu_tool_utils",
1229 ":skia",
1230 ":tool_utils",
1231 "//third_party/jsoncpp",
1232 "//third_party/libmicrohttpd",
1233 "//third_party/libpng",
1234 ]
Mike Klein7d302882016-11-03 14:06:31 -04001235 }
mtkleinecbc5262016-09-22 11:51:24 -07001236 }
kjlubick14f984b2016-10-03 11:49:45 -07001237
Mike Kleine6682eb2017-01-05 10:54:57 -05001238 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07001239 sources = [
1240 "fuzz/FilterFuzz.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05001241 "fuzz/FuzzDrawFunctions.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07001242 "fuzz/FuzzGradients.cpp",
1243 "fuzz/FuzzParsePath.cpp",
1244 "fuzz/FuzzPathop.cpp",
1245 "fuzz/FuzzScaleToSides.cpp",
1246 "fuzz/fuzz.cpp",
1247 ]
1248 deps = [
1249 ":flags",
1250 ":skia",
Hal Canarydb683012016-11-23 08:55:18 -07001251 ":tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07001252 ]
kjlubick14f984b2016-10-03 11:49:45 -07001253 }
Mike Klein38312422016-10-05 15:41:01 -04001254
Mike Kleine6682eb2017-01-05 10:54:57 -05001255 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04001256 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04001257 rebase_path("tests/skia_test.cpp"),
1258 rebase_path("tests/Test.cpp"),
1259 ]
caryclark9feb6322016-10-25 08:58:26 -07001260 deps = [
1261 ":flags",
1262 ":gpu_tool_utils",
1263 ":skia",
1264 ":tool_utils",
1265 ]
caryclark9feb6322016-10-25 08:58:26 -07001266 }
1267
Mike Kleine6682eb2017-01-05 10:54:57 -05001268 test_app("dump_record") {
Mike Klein38312422016-10-05 15:41:01 -04001269 sources = [
1270 "tools/DumpRecord.cpp",
1271 "tools/dump_record.cpp",
1272 ]
1273 deps = [
1274 ":flags",
1275 ":skia",
1276 ]
Mike Klein38312422016-10-05 15:41:01 -04001277 }
bungemanfe917272016-10-13 17:36:40 -04001278
Mike Kleine6682eb2017-01-05 10:54:57 -05001279 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04001280 sources = [
1281 "tools/skdiff/skdiff.cpp",
1282 "tools/skdiff/skdiff_html.cpp",
1283 "tools/skdiff/skdiff_main.cpp",
1284 "tools/skdiff/skdiff_utils.cpp",
1285 ]
1286 deps = [
1287 ":skia",
1288 ":tool_utils",
1289 ]
bungemanfe917272016-10-13 17:36:40 -04001290 }
halcanarya73d76a2016-10-17 13:19:02 -07001291
Mike Kleine6682eb2017-01-05 10:54:57 -05001292 test_app("skp_parser") {
halcanarya73d76a2016-10-17 13:19:02 -07001293 sources = [
1294 "tools/skp_parser.cpp",
1295 ]
1296 deps = [
1297 ":skia",
1298 ":tool_utils",
1299 "//third_party/jsoncpp",
1300 ]
halcanarya73d76a2016-10-17 13:19:02 -07001301 }
Brian Osman16adfa32016-10-18 14:42:44 -04001302
Mike Kleina92c3832016-12-08 09:49:39 -05001303 if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001304 test_app("viewer") {
1305 is_shared_library = is_android
Brian Osman16adfa32016-10-18 14:42:44 -04001306 sources = [
1307 "tools/viewer/GMSlide.cpp",
1308 "tools/viewer/ImageSlide.cpp",
1309 "tools/viewer/SKPSlide.cpp",
1310 "tools/viewer/SampleSlide.cpp",
1311 "tools/viewer/Viewer.cpp",
1312 "tools/viewer/sk_app/CommandSet.cpp",
1313 "tools/viewer/sk_app/GLWindowContext.cpp",
1314 "tools/viewer/sk_app/Window.cpp",
1315 "tools/viewer/sk_app/WindowContext.cpp",
1316 ]
Brian Osman2dd96932016-10-18 15:33:53 -04001317 libs = []
Brian Osman16adfa32016-10-18 14:42:44 -04001318
Jim Van Verth4e56a912016-10-21 10:58:52 -04001319 if (is_android) {
1320 sources += [
1321 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1322 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1323 "tools/viewer/sk_app/android/Window_android.cpp",
1324 "tools/viewer/sk_app/android/main_android.cpp",
1325 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1326 ]
1327 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001328 sources += [
1329 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1330 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1331 "tools/viewer/sk_app/unix/Window_unix.cpp",
1332 "tools/viewer/sk_app/unix/main_unix.cpp",
1333 ]
1334 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001335 sources += [
1336 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1337 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1338 "tools/viewer/sk_app/win/Window_win.cpp",
1339 "tools/viewer/sk_app/win/main_win.cpp",
1340 ]
Mike Klein43c25262016-10-20 10:17:47 -04001341 } else if (is_mac) {
1342 sources += [
1343 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1344 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1345 "tools/viewer/sk_app/mac/Window_mac.cpp",
1346 "tools/viewer/sk_app/mac/main_mac.cpp",
1347 ]
Brian Osman16adfa32016-10-18 14:42:44 -04001348 }
1349
1350 if (skia_use_vulkan) {
1351 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001352 if (is_android) {
1353 sources +=
1354 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
1355 libs += [ "android" ]
1356 } else if (is_linux) {
Brian Osman2dd96932016-10-18 15:33:53 -04001357 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1358 libs += [ "X11-xcb" ]
1359 } else if (is_win) {
Brian Osman16adfa32016-10-18 14:42:44 -04001360 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1361 }
1362 }
1363
1364 include_dirs = []
1365 deps = [
1366 ":flags",
1367 ":gm",
1368 ":gpu_tool_utils",
1369 ":samples",
1370 ":skia",
1371 ":tool_utils",
1372 ":views",
1373 "//third_party/jsoncpp",
1374 ]
Jim Van Verth4e56a912016-10-21 10:58:52 -04001375 if (is_android) {
1376 deps += [ "//third_party/native_app_glue" ]
1377 } else if (is_mac) {
Mike Klein43c25262016-10-20 10:17:47 -04001378 deps += [ "//third_party/libsdl" ]
1379 }
Mike Kleina92c3832016-12-08 09:49:39 -05001380 }
Brian Osman16adfa32016-10-18 14:42:44 -04001381 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001382
Derek Sollenberger70120c72017-01-05 11:39:04 -05001383 if (is_android) {
1384 copy("gdbserver") {
1385 sources = [
1386 "$ndk/$ndk_gdbserver",
1387 ]
1388 outputs = [
1389 "$root_out_dir/gdbserver",
1390 ]
1391 }
1392 if (ndk_simpleperf != "") {
1393 copy("simpleperf") {
1394 sources = [
1395 "$ndk/$ndk_simpleperf",
1396 "$ndk/simpleperf/simpleperf_report.py",
1397 ]
1398 outputs = [
1399 "$root_out_dir/{{source_file_part}}",
1400 ]
1401 }
1402 }
1403 }
1404
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001405 if (skia_enable_gpu) {
Mike Kleine6682eb2017-01-05 10:54:57 -05001406 test_app("skslc") {
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001407 sources = [
1408 "src/sksl/SkSLMain.cpp",
1409 ]
1410 deps = [
1411 ":flags",
1412 ":skia",
1413 ]
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05001414 }
1415 }
mtklein25c81d42016-07-27 13:55:26 -07001416}