blob: d402f59c6412763da57347f2900c7b5306ec14f2 [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
mikejurka8c24f4f2016-09-12 16:51:58 -07006import("gn/shared_sources.gni")
brettwb9447282016-09-01 14:24:39 -07007
mtklein3e8012e2016-09-21 09:14:19 -07008if (!defined(is_skia_standalone)) {
9 is_skia_standalone = false
10}
11
mtkleinc04ff472016-06-23 10:29:30 -070012declare_args() {
mtkleind68f9b02016-09-23 13:18:41 -070013 skia_use_angle = false
mtklein63213812016-08-24 09:55:56 -070014 skia_use_expat = true
mtklein3cc22182016-08-29 13:26:14 -070015 skia_use_fontconfig = is_linux
mtkleincdedd0e2016-09-12 15:15:44 -070016 skia_use_freetype = is_android || is_fuchsia || is_linux
Mike Klein69f6ed42016-10-13 15:45:07 -040017 skia_use_gdi = false
mtklein457b42a2016-08-23 13:56:37 -070018 skia_use_giflib = !is_fuchsia
mtklein63213812016-08-24 09:55:56 -070019 skia_use_libjpeg_turbo = true
20 skia_use_libpng = true
mtkleineb3c4252016-08-23 07:38:09 -070021 skia_use_libwebp = !is_fuchsia
mtkleina627b5c2016-09-20 13:36:47 -070022 skia_use_mesa = false
Mike Kleinae7e6712016-10-11 17:49:33 -040023 skia_use_sfntly = !is_fuchsia && !is_win # TODO: icu on Windows, re-enable this.
mtkleinf29180e2016-09-16 07:01:17 -070024 skia_use_vulkan = is_android && defined(ndk_api) && ndk_api >= 24
mtklein63213812016-08-24 09:55:56 -070025 skia_use_zlib = true
mtklein1bd72ba2016-09-16 07:45:52 -070026
27 skia_enable_android_framework_defines = false
mtklein06c35c02016-09-20 12:28:12 -070028 skia_enable_gpu = true
mtklein3e8012e2016-09-21 09:14:19 -070029 skia_enable_tools = is_skia_standalone
30 skia_enable_vulkan_debug_layers = is_skia_standalone && is_debug
Brian Salomon789e25e2016-09-30 13:41:03 -040031 skia_vulkan_sdk = ""
mtkleinc04ff472016-06-23 10:29:30 -070032}
33
Brian Salomon789e25e2016-09-30 13:41:03 -040034skia_use_vulkan = skia_use_vulkan || skia_vulkan_sdk != ""
35
mtklein38925aa2016-09-21 10:11:25 -070036# Our tools require static linking (they use non-exported symbols).
37skia_enable_tools = skia_enable_tools && !is_component_build
mtklein06c35c02016-09-20 12:28:12 -070038
mtkleina45be612016-08-29 15:22:10 -070039fontmgr_android_enabled = skia_use_expat && skia_use_freetype
40
mtklein1211e0c2016-07-26 13:55:45 -070041skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070042 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070043 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070044 "include/codec",
45 "include/config",
46 "include/core",
47 "include/effects",
48 "include/gpu",
49 "include/gpu/gl",
50 "include/images",
51 "include/pathops",
52 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070053 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070054 "include/utils",
55 "include/utils/mac",
mtklein25c81d42016-07-27 13:55:26 -070056 "include/xml",
mtklein1211e0c2016-07-26 13:55:45 -070057]
58
mtkleinc04ff472016-06-23 10:29:30 -070059# Skia public API, generally provided by :skia.
60config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -070061 include_dirs = skia_public_includes
Mike Kleinae7e6712016-10-11 17:49:33 -040062 defines = []
63 if (is_component_build) {
64 defines += [ "SKIA_DLL" ]
65 }
Mike Kleinc4cbd742016-09-26 21:37:09 -040066 if (is_fuchsia || is_linux) {
jcgregorio5561e3d2016-08-25 09:25:11 -070067 defines += [ "SK_SAMPLES_FOR_X" ]
68 }
mtkleincae1be52016-09-20 08:24:34 -070069 if (skia_enable_android_framework_defines) {
70 defines += skia_android_framework_defines
71 }
mtklein06c35c02016-09-20 12:28:12 -070072 if (!skia_enable_gpu) {
73 defines += [ "SK_SUPPORT_GPU=0" ]
74 }
mtkleinc04ff472016-06-23 10:29:30 -070075}
76
77# Skia internal APIs, used by Skia itself and a few test tools.
78config("skia_private") {
79 visibility = [ ":*" ]
80
81 include_dirs = [
82 "include/private",
83 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -070084 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -070085 "src/config",
86 "src/core",
87 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -070088 "src/effects/gradients",
89 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -070090 "src/gpu",
91 "src/image",
92 "src/images",
93 "src/lazy",
94 "src/opts",
95 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -070096 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -070097 "src/ports",
98 "src/sfnt",
mtklein9e0d9dd2016-08-30 10:37:19 -070099 "src/sksl",
mtkleinc04ff472016-06-23 10:29:30 -0700100 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -0700101 "src/utils/win",
mtkleinc04ff472016-06-23 10:29:30 -0700102 "third_party/etc1",
103 "third_party/ktx",
104 ]
mtklein150d1132016-08-01 06:56:40 -0700105
mtklein63213812016-08-24 09:55:56 -0700106 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
mtkleinb37c0342016-09-09 11:07:45 -0700107 if (is_android) {
108 defines += [
109 "SK_GAMMA_EXPONENT=1.4",
110 "SK_GAMMA_CONTRAST=0.0",
111 ]
112 }
mtklein88a7ac02016-09-14 11:16:49 -0700113 if (is_official_build || is_android) {
114 # TODO(bsalomon): it'd be nice to make Android normal.
115 defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
116 }
Brian Salomon789e25e2016-09-30 13:41:03 -0400117 libs = []
118 lib_dirs = []
119 if (skia_use_vulkan) {
120 if (skia_vulkan_sdk != "") {
121 include_dirs += [ "$skia_vulkan_sdk/x86_64/include/" ]
122 lib_dirs += [ "$skia_vulkan_sdk/x86_64/lib/" ]
123 }
124 libs += [ "vulkan" ]
125 }
mtkleinc04ff472016-06-23 10:29:30 -0700126}
127
128# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
129config("skia_library") {
130 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -0700131 defines = [ "SKIA_IMPLEMENTATION=1" ]
132}
133
134skia_library_configs = [
135 ":skia_public",
136 ":skia_private",
137 ":skia_library",
138]
139
mtklein9b8583d2016-08-24 17:32:30 -0700140# Use for CPU-specific Skia code that needs particular compiler flags.
141template("opts") {
142 if (invoker.enabled) {
143 source_set(target_name) {
144 forward_variables_from(invoker, "*")
145 configs += skia_library_configs
146 }
147 } else {
148 # If not enabled, a phony empty target that swallows all otherwise unused variables.
149 source_set(target_name) {
150 forward_variables_from(invoker,
151 "*",
152 [
153 "sources",
154 "cflags",
155 ])
156 }
157 }
anmittala7eaf2e2016-08-17 13:57:26 -0700158}
159
mtklein422310d2016-08-16 18:28:43 -0700160is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700161
mtklein7d6fb2c2016-08-25 14:50:44 -0700162opts("none") {
163 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700164 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700165 cflags = []
166}
167
mtklein7d6fb2c2016-08-25 14:50:44 -0700168opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700169 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700170 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700171 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700172}
173
174opts("arm64") {
175 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700176 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700177 cflags = []
178}
179
180opts("crc32") {
181 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700182 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700183 cflags = [ "-march=armv8-a+crc" ]
184}
185
mtklein9b8583d2016-08-24 17:32:30 -0700186opts("sse2") {
187 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700188 sources = skia_opts.sse2_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400189 if (!is_win) {
190 cflags = [ "-msse2" ]
191 }
mtklein9b8583d2016-08-24 17:32:30 -0700192}
mtkleinc04ff472016-06-23 10:29:30 -0700193
mtklein9b8583d2016-08-24 17:32:30 -0700194opts("ssse3") {
195 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700196 sources = skia_opts.ssse3_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400197 if (!is_win) {
198 cflags = [ "-mssse3" ]
199 }
mtklein9b8583d2016-08-24 17:32:30 -0700200}
mtkleinc04ff472016-06-23 10:29:30 -0700201
mtklein9b8583d2016-08-24 17:32:30 -0700202opts("sse41") {
203 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700204 sources = skia_opts.sse41_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400205 if (!is_win) {
206 cflags = [ "-msse4.1" ]
207 }
mtklein9b8583d2016-08-24 17:32:30 -0700208}
mtklein4e976072016-08-08 09:06:27 -0700209
mtklein9b8583d2016-08-24 17:32:30 -0700210opts("sse42") {
211 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700212 sources = skia_opts.sse42_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400213 if (!is_win) {
214 cflags = [ "-msse4.2" ]
215 }
mtklein9b8583d2016-08-24 17:32:30 -0700216}
217
218opts("avx") {
219 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700220 sources = skia_opts.avx_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400221 if (is_win) {
222 cflags = [ "/arch:AVX" ]
223 } else {
224 cflags = [ "-mavx" ]
225 }
mtkleinc04ff472016-06-23 10:29:30 -0700226}
227
Mike Klein78d5a3b2016-09-30 10:48:01 -0400228opts("hsw") {
229 enabled = is_x86
230 sources = skia_opts.hsw_sources
Mike Klein3eb71212016-10-11 17:08:53 -0400231 if (is_win) {
232 cflags = [ "/arch:AVX2" ]
233 } else {
234 cflags = [
235 "-mavx2",
236 "-mbmi",
237 "-mbmi2",
238 "-mf16c",
239 "-mfma",
240 ]
241 }
Mike Klein78d5a3b2016-09-30 10:48:01 -0400242}
243
mtklein349cece2016-08-26 08:13:04 -0700244opts("dsp") {
245 enabled = current_cpu == "mipsel"
brettwb9447282016-09-01 14:24:39 -0700246 sources = skia_opts.mips_dsp_sources
mtkleinb6064ef2016-08-30 11:49:24 -0700247 cflags = []
mtklein349cece2016-08-26 08:13:04 -0700248}
249
mtkleinc095df52016-08-24 12:23:52 -0700250# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700251template("optional") {
252 if (invoker.enabled) {
253 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700254 if (defined(invoker.public_defines)) {
255 defines = invoker.public_defines
256 }
mtklein457b42a2016-08-23 13:56:37 -0700257 }
258 source_set(target_name) {
mtkleincd01b032016-08-31 04:58:19 -0700259 forward_variables_from(invoker,
260 "*",
261 [
262 "public_defines",
263 "sources_when_disabled",
264 ])
mtklein457b42a2016-08-23 13:56:37 -0700265 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700266 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700267 }
268 } else {
mtklein457b42a2016-08-23 13:56:37 -0700269 source_set(target_name) {
270 forward_variables_from(invoker,
271 "*",
272 [
273 "public_defines",
mtklein457b42a2016-08-23 13:56:37 -0700274 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700275 "libs",
mtklein457b42a2016-08-23 13:56:37 -0700276 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700277 "sources_when_disabled",
mtklein457b42a2016-08-23 13:56:37 -0700278 ])
mtkleincd01b032016-08-31 04:58:19 -0700279 if (defined(invoker.sources_when_disabled)) {
280 sources = invoker.sources_when_disabled
281 }
282 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700283 }
mtkleineb3c4252016-08-23 07:38:09 -0700284 }
mtklein457b42a2016-08-23 13:56:37 -0700285}
mtklein457b42a2016-08-23 13:56:37 -0700286
mtkleina45be612016-08-29 15:22:10 -0700287optional("fontmgr_android") {
288 enabled = fontmgr_android_enabled
mtkleina45be612016-08-29 15:22:10 -0700289
290 deps = [
291 "//third_party/expat",
292 "//third_party/freetype2",
293 ]
294 sources = [
295 "src/ports/SkFontMgr_android.cpp",
296 "src/ports/SkFontMgr_android_factory.cpp",
297 "src/ports/SkFontMgr_android_parser.cpp",
298 ]
299}
300
mtkleind2e39db2016-09-07 07:52:55 -0700301optional("fontmgr_custom") {
302 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
303
304 deps = [
305 "//third_party/freetype2",
306 ]
307 sources = [
308 "src/ports/SkFontMgr_custom.cpp",
309 "src/ports/SkFontMgr_custom_directory_factory.cpp",
310 ]
311}
312
mtklein3cc22182016-08-29 13:26:14 -0700313optional("fontmgr_fontconfig") {
314 enabled = skia_use_freetype && skia_use_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700315
316 deps = [
317 "//third_party:fontconfig",
318 "//third_party/freetype2",
319 ]
320 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700321 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700322 "src/ports/SkFontConfigInterface_direct.cpp",
323 "src/ports/SkFontConfigInterface_direct_factory.cpp",
324 "src/ports/SkFontMgr_FontConfigInterface.cpp",
325 "src/ports/SkFontMgr_fontconfig.cpp",
326 "src/ports/SkFontMgr_fontconfig_factory.cpp",
327 ]
328}
329
mtkleincdedd0e2016-09-12 15:15:44 -0700330optional("fontmgr_fuchsia") {
331 enabled = is_fuchsia && skia_use_freetype
332
333 deps = [
334 "//third_party/freetype2",
335 ]
336 sources = [
337 "src/ports/SkFontMgr_custom.cpp",
338 "src/ports/SkFontMgr_custom_empty_factory.cpp",
339 ]
340}
341
mtklein457b42a2016-08-23 13:56:37 -0700342optional("gif") {
343 enabled = skia_use_giflib
344 public_defines = [ "SK_HAS_GIF_LIBRARY" ]
345
mtklein457b42a2016-08-23 13:56:37 -0700346 deps = [
347 "//third_party/giflib",
348 ]
349 sources = [
350 "src/codec/SkGifCodec.cpp",
351 ]
352}
353
mtklein06c35c02016-09-20 12:28:12 -0700354optional("gpu") {
355 enabled = skia_enable_gpu
mtkleine9fb3d52016-09-20 15:11:46 -0700356 public_defines = []
357
mtklein06c35c02016-09-20 12:28:12 -0700358 sources = skia_gpu_sources + [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]
359
360 # These paths need to be absolute to match the ones produced by shared_sources.gni.
361 sources -= get_path_info([
362 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
363 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
364 ],
365 "abspath")
366 if (is_android) {
367 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
368 } else if (is_linux) {
369 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
370 } else if (is_mac) {
371 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
372 } else {
373 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
374 }
mtkleine9fb3d52016-09-20 15:11:46 -0700375 libs = []
376
377 if (skia_use_vulkan) {
378 public_defines += [ "SK_VULKAN" ]
379 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700380 if (skia_enable_vulkan_debug_layers) {
381 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
382 }
mtkleine9fb3d52016-09-20 15:11:46 -0700383 }
mtklein06c35c02016-09-20 12:28:12 -0700384}
385
mtklein63213812016-08-24 09:55:56 -0700386optional("jpeg") {
387 enabled = skia_use_libjpeg_turbo
388 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
389
mtklein63213812016-08-24 09:55:56 -0700390 deps = [
391 "//third_party/libjpeg-turbo:libjpeg",
392 ]
393 sources = [
394 "src/codec/SkJpegCodec.cpp",
395 "src/codec/SkJpegDecoderMgr.cpp",
396 "src/codec/SkJpegUtility.cpp",
397 "src/images/SkJPEGImageEncoder.cpp",
398 "src/images/SkJPEGWriteUtility.cpp",
399 ]
400}
401
402optional("pdf") {
403 enabled = skia_use_zlib
mtklein63213812016-08-24 09:55:56 -0700404
mtklein63213812016-08-24 09:55:56 -0700405 deps = [
406 "//third_party/zlib",
407 ]
brettwb9447282016-09-01 14:24:39 -0700408 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700409 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700410
411 if (skia_use_sfntly) {
412 deps += [ "//third_party/sfntly" ]
mtkleincd01b032016-08-31 04:58:19 -0700413 public_defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700414 }
415}
416
417optional("png") {
418 enabled = skia_use_libpng
419 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
420
mtklein63213812016-08-24 09:55:56 -0700421 deps = [
422 "//third_party/libpng",
423 ]
424 sources = [
425 "src/codec/SkIcoCodec.cpp",
426 "src/codec/SkPngCodec.cpp",
427 "src/images/SkPNGImageEncoder.cpp",
428 ]
429}
430
mtklein3cc22182016-08-29 13:26:14 -0700431optional("typeface_freetype") {
432 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700433
434 deps = [
435 "//third_party/freetype2",
436 ]
437 sources = [
438 "src/ports/SkFontHost_FreeType.cpp",
439 "src/ports/SkFontHost_FreeType_common.cpp",
440 ]
441}
442
mtklein457b42a2016-08-23 13:56:37 -0700443optional("webp") {
444 enabled = skia_use_libwebp
445 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
446
mtklein457b42a2016-08-23 13:56:37 -0700447 deps = [
448 "//third_party/libwebp",
449 ]
450 sources = [
451 "src/codec/SkWebpAdapterCodec.cpp",
452 "src/codec/SkWebpCodec.cpp",
453 "src/images/SkWEBPImageEncoder.cpp",
454 ]
mtkleineb3c4252016-08-23 07:38:09 -0700455}
456
mtklein63213812016-08-24 09:55:56 -0700457optional("xml") {
458 enabled = skia_use_expat
mtklein63213812016-08-24 09:55:56 -0700459
mtklein63213812016-08-24 09:55:56 -0700460 deps = [
461 "//third_party/expat",
462 ]
463 sources = [
464 "src/xml/SkDOM.cpp",
465 "src/xml/SkXMLParser.cpp",
466 "src/xml/SkXMLWriter.cpp",
467 ]
468}
469
mtkleinc04ff472016-06-23 10:29:30 -0700470component("skia") {
471 public_configs = [ ":skia_public" ]
472 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700473
474 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700475 ":arm64",
476 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700477 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700478 ":crc32",
mtklein349cece2016-08-26 08:13:04 -0700479 ":dsp",
mtkleina45be612016-08-29 15:22:10 -0700480 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700481 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700482 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700483 ":fontmgr_fuchsia",
mtklein457b42a2016-08-23 13:56:37 -0700484 ":gif",
mtklein06c35c02016-09-20 12:28:12 -0700485 ":gpu",
Mike Klein78d5a3b2016-09-30 10:48:01 -0400486 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700487 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700488 ":none",
mtklein63213812016-08-24 09:55:56 -0700489 ":pdf",
490 ":png",
mtklein9b8583d2016-08-24 17:32:30 -0700491 ":sse2",
492 ":sse41",
493 ":sse42",
494 ":ssse3",
mtklein3cc22182016-08-29 13:26:14 -0700495 ":typeface_freetype",
mtkleineb3c4252016-08-23 07:38:09 -0700496 ":webp",
mtklein63213812016-08-24 09:55:56 -0700497 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700498 ]
499
mtkleinc04ff472016-06-23 10:29:30 -0700500 sources = []
brettwb9447282016-09-01 14:24:39 -0700501 sources += skia_core_sources
502 sources += skia_effects_sources
brettwb9447282016-09-01 14:24:39 -0700503 sources += skia_sksl_sources
504 sources += skia_utils_sources
mtkleinc04ff472016-06-23 10:29:30 -0700505 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700506 "src/android/SkBitmapRegionCodec.cpp",
507 "src/android/SkBitmapRegionDecoder.cpp",
508 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700509 "src/codec/SkBmpCodec.cpp",
510 "src/codec/SkBmpMaskCodec.cpp",
511 "src/codec/SkBmpRLECodec.cpp",
512 "src/codec/SkBmpStandardCodec.cpp",
513 "src/codec/SkCodec.cpp",
514 "src/codec/SkCodecImageGenerator.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700515 "src/codec/SkMaskSwizzler.cpp",
516 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700517 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700518 "src/codec/SkSampler.cpp",
519 "src/codec/SkSwizzler.cpp",
520 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700521 "src/images/SkImageEncoder.cpp",
522 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700523 "src/images/SkKTXImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700524 "src/ports/SkDiscardableMemory_none.cpp",
525 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700526 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700527 "src/ports/SkMemory_malloc.cpp",
528 "src/ports/SkOSFile_stdio.cpp",
529 "src/sfnt/SkOTTable_name.cpp",
530 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700531 "src/svg/SkSVGCanvas.cpp",
532 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700533 "src/utils/mac/SkStream_mac.cpp",
534 "third_party/etc1/etc1.cpp",
535 "third_party/ktx/ktx.cpp",
536 ]
brettwb9447282016-09-01 14:24:39 -0700537
mtklein7d6fb2c2016-08-25 14:50:44 -0700538 libs = []
539
mtkleinc04ff472016-06-23 10:29:30 -0700540 if (is_win) {
541 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400542 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700543 "src/ports/SkDebug_win.cpp",
544 "src/ports/SkFontHost_win.cpp",
545 "src/ports/SkFontMgr_win_dw.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700546 "src/ports/SkImageEncoder_WIC.cpp",
547 "src/ports/SkImageGeneratorWIC.cpp",
548 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700549 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700550 "src/ports/SkScalerContext_win_dw.cpp",
551 "src/ports/SkTLS_win.cpp",
552 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700553 "src/xps/SkDocument_XPS.cpp",
Mike Klein4b167fc2016-10-11 18:13:53 -0400554 "src/xps/SkXPSDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700555 ]
Mike Klein69f6ed42016-10-13 15:45:07 -0400556 if (skia_use_gdi) {
557 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
558 libs += [
559 "Gdi32.lib",
560 "Usp10.lib",
561 ]
562 } else {
563 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
564 }
mtkleinb9be9792016-09-16 14:44:18 -0700565 sources -=
566 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400567 libs += [
568 "FontSub.lib",
569 "Ole32.lib",
570 "OleAut32.lib",
571 "User32.lib",
572 ]
mtkleinc04ff472016-06-23 10:29:30 -0700573 } else {
574 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700575 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700576 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700577 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700578 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700579 ]
580 }
581
mtklein7d6fb2c2016-08-25 14:50:44 -0700582 if (is_android) {
583 deps += [
584 "//third_party/cpu-features",
585 "//third_party/expat",
mtklein7d6fb2c2016-08-25 14:50:44 -0700586 ]
mtklein06c35c02016-09-20 12:28:12 -0700587 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700588 libs += [
589 "EGL",
590 "GLESv2",
591 "log",
592 ]
593 }
594
mtkleinc04ff472016-06-23 10:29:30 -0700595 if (is_linux) {
mtklein09e61f72016-08-23 13:35:28 -0700596 libs += [
597 "GL",
598 "GLU",
599 "X11",
600 ]
mtklein06c35c02016-09-20 12:28:12 -0700601 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700602 }
603
604 if (is_mac) {
605 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700606 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700607 "src/ports/SkFontHost_mac.cpp",
608 "src/ports/SkImageEncoder_CG.cpp",
609 "src/ports/SkImageGeneratorCG.cpp",
610 ]
mtklein09e61f72016-08-23 13:35:28 -0700611 libs += [
612 "ApplicationServices.framework",
613 "OpenGL.framework",
614 ]
mtkleinc04ff472016-06-23 10:29:30 -0700615 }
abarth6fc8ff02016-07-15 15:15:15 -0700616
617 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700618 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700619 }
mtkleinc04ff472016-06-23 10:29:30 -0700620}
621
mtkleinada5a442016-08-02 14:28:26 -0700622skia_h_headers = exec_script("gyp/find.py",
623 [ "*.h" ] + rebase_path(skia_public_includes),
624 "list lines",
625 []) -
626 [
627 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
628 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
629 rebase_path("include/gpu/vk/GrVkDefines.h"),
630 rebase_path("include/gpu/vk/GrVkInterface.h"),
631 rebase_path("include/gpu/vk/GrVkTypes.h"),
632 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
633 ]
634
mtklein1211e0c2016-07-26 13:55:45 -0700635action("skia.h") {
636 script = "gn/echo_headers.py"
637 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinc095df52016-08-24 12:23:52 -0700638 rebase_path(skia_h_headers, target_gen_dir)
Ben Wagnerbc344042016-09-29 15:41:53 -0400639 inputs = skia_h_headers
mtklein1211e0c2016-07-26 13:55:45 -0700640 outputs = [
641 "$target_gen_dir/skia.h",
642 ]
643}
644
mtklein06c35c02016-09-20 12:28:12 -0700645if (skia_enable_gpu && target_cpu == "x64") {
mtklein1fbdf982016-09-15 12:07:48 -0700646 # Our bots only have 64-bit libOSMesa installed.
647 # TODO: worth fixing?
648 executable("fiddle") {
649 include_dirs = [ "$target_gen_dir" ]
650 libs = []
651 if (is_linux) {
652 libs += [ "OSMesa" ]
653 }
mtklein56d56692016-09-15 11:18:55 -0700654
mtklein1fbdf982016-09-15 12:07:48 -0700655 sources = [
656 "src/images/SkForceLinking.cpp",
657 "tools/fiddle/draw.cpp",
658 "tools/fiddle/fiddle_main.cpp",
659 ]
660 deps = [
661 ":skia",
662 ":skia.h",
663 ]
664 }
mtkleinc04ff472016-06-23 10:29:30 -0700665}
mtklein25c81d42016-07-27 13:55:26 -0700666
mtkleinc095df52016-08-24 12:23:52 -0700667# Targets guarded by skia_enable_tools may use //third_party freely.
668if (skia_enable_tools) {
669 template("test_lib") {
670 config(target_name + "_config") {
671 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700672 if (defined(invoker.public_defines)) {
673 defines = invoker.public_defines
674 }
mtklein25c81d42016-07-27 13:55:26 -0700675 }
mtkleinc095df52016-08-24 12:23:52 -0700676 source_set(target_name) {
677 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
678 public_configs = [
679 ":" + target_name + "_config",
680 ":skia_private",
681 ]
682
683 if (!defined(deps)) {
684 deps = []
685 }
686 deps += [ ":skia" ]
687 testonly = true
688 }
mtklein25c81d42016-07-27 13:55:26 -0700689 }
mtklein25c81d42016-07-27 13:55:26 -0700690
mtkleinc095df52016-08-24 12:23:52 -0700691 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700692 public_include_dirs = []
693 if (skia_enable_gpu) {
694 public_defines = []
695 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700696
697 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700698 sources = [
699 "tools/gpu/GrContextFactory.cpp",
700 "tools/gpu/GrTest.cpp",
701 "tools/gpu/TestContext.cpp",
702 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -0700703 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -0700704 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
705 "tools/gpu/gl/debug/GrBufferObj.cpp",
706 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
707 "tools/gpu/gl/debug/GrProgramObj.cpp",
708 "tools/gpu/gl/debug/GrShaderObj.cpp",
709 "tools/gpu/gl/debug/GrTextureObj.cpp",
710 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
711 "tools/gpu/gl/null/NullGLTestContext.cpp",
712 ]
713 libs = []
mtklein25c81d42016-07-27 13:55:26 -0700714
mtklein38925aa2016-09-21 10:11:25 -0700715 if (is_android) {
716 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
717 } else if (is_linux) {
718 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
719 } else if (is_mac) {
720 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400721 } else if (is_win) {
722 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
723 libs += [
724 "Gdi32.lib",
725 "OpenGL32.lib",
726 ]
mtklein38925aa2016-09-21 10:11:25 -0700727 }
mtklein6ef69992016-09-14 06:12:09 -0700728
mtkleind68f9b02016-09-23 13:18:41 -0700729 if (skia_use_angle) {
730 public_defines += [ "SK_ANGLE" ]
731 deps += [ "//third_party/angle2" ]
732 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
mtklein38925aa2016-09-21 10:11:25 -0700733 }
734 if (skia_use_mesa) {
735 public_defines += [ "SK_MESA" ]
736 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
737 libs += [ "OSMesa" ]
738 }
mtkleind68f9b02016-09-23 13:18:41 -0700739 if (skia_use_vulkan) {
740 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
741 }
mtkleina627b5c2016-09-20 13:36:47 -0700742 }
mtklein25c81d42016-07-27 13:55:26 -0700743 }
mtklein25c81d42016-07-27 13:55:26 -0700744
mtkleinc095df52016-08-24 12:23:52 -0700745 test_lib("flags") {
746 public_include_dirs = [ "tools/flags" ]
747 sources = [
748 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -0700749 ]
750 }
751 test_lib("common_flags") {
752 public_include_dirs = [ "tools/flags" ]
753 sources = [
mtkleinc095df52016-08-24 12:23:52 -0700754 "tools/flags/SkCommonFlags.cpp",
755 "tools/flags/SkCommonFlagsConfig.cpp",
756 ]
757 deps = [
mtklein046cb562016-09-16 10:23:12 -0700758 ":flags",
mtkleinc095df52016-08-24 12:23:52 -0700759 ":gpu_tool_utils",
760 ]
761 }
mtklein25c81d42016-07-27 13:55:26 -0700762
mtkleinc095df52016-08-24 12:23:52 -0700763 test_lib("tool_utils") {
764 public_include_dirs = [
765 "tools",
766 "tools/debugger",
767 "tools/timer",
768 ]
769 sources = [
770 "src/images/SkForceLinking.cpp",
771 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtkleinb37c0342016-09-09 11:07:45 -0700772 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700773 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -0700774 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700775 "tools/ProcStats.cpp",
776 "tools/Resources.cpp",
777 "tools/ThermalManager.cpp",
778 "tools/UrlDataManager.cpp",
779 "tools/debugger/SkDebugCanvas.cpp",
780 "tools/debugger/SkDrawCommand.cpp",
781 "tools/debugger/SkJsonWriteBuffer.cpp",
782 "tools/debugger/SkObjectParser.cpp",
783 "tools/debugger/SkOverdrawMode.cpp",
784 "tools/picture_utils.cpp",
785 "tools/random_parse_path.cpp",
786 "tools/sk_tool_utils.cpp",
787 "tools/sk_tool_utils_font.cpp",
788 "tools/timer/Timer.cpp",
789 ]
790 deps = [
mtklein046cb562016-09-16 10:23:12 -0700791 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -0700792 ":flags",
793 "//third_party/libpng",
794 ]
795 public_deps = [
796 "//third_party/jsoncpp",
797 ]
798 }
mtklein25c81d42016-07-27 13:55:26 -0700799
mtkleinc095df52016-08-24 12:23:52 -0700800 gm_sources = exec_script("gyp/find.py",
801 [
802 "*.c*",
803 rebase_path("gm"),
804 ],
805 "list lines",
806 [])
807 test_lib("gm") {
808 public_include_dirs = [ "gm" ]
809 sources = gm_sources
810 deps = [
811 ":gpu_tool_utils",
812 ":skia",
813 ":tool_utils",
814 ]
815 }
mtklein25c81d42016-07-27 13:55:26 -0700816
mtkleinc095df52016-08-24 12:23:52 -0700817 tests_sources = exec_script("gyp/find.py",
818 [
819 "*.c*",
820 rebase_path("tests"),
821 ],
822 "list lines",
823 [])
mtklein2f3416d2016-08-02 16:02:05 -0700824
mtkleinc095df52016-08-24 12:23:52 -0700825 test_lib("tests") {
826 public_include_dirs = [ "tests" ]
mtkleina45be612016-08-29 15:22:10 -0700827 sources = tests_sources - [
828 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtkleina45be612016-08-29 15:22:10 -0700829 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
830 rebase_path("tests/skia_test.cpp"), # alternate main
831 ]
832 if (!fontmgr_android_enabled) {
833 sources -= [ rebase_path("tests/FontMgrAndroidParserTest.cpp") ]
834 }
mtkleinc095df52016-08-24 12:23:52 -0700835 deps = [
fmalita6cf896d2016-08-25 08:44:35 -0700836 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -0700837 ":flags",
838 ":gpu_tool_utils",
839 ":skia",
840 ":tool_utils",
841 "//third_party/libpng",
842 "//third_party/zlib",
843 ]
844 }
mtklein2f3416d2016-08-02 16:02:05 -0700845
mtkleinc095df52016-08-24 12:23:52 -0700846 bench_sources = exec_script("gyp/find.py",
847 [
848 "*.c*",
849 rebase_path("bench"),
850 ],
851 "list lines",
852 [])
mtklein25c81d42016-07-27 13:55:26 -0700853
mtkleinc095df52016-08-24 12:23:52 -0700854 test_lib("bench") {
855 public_include_dirs = [ "bench" ]
856 sources = bench_sources
857 sources -= [
858 rebase_path("bench/nanobench.cpp"),
859 rebase_path("bench/nanobenchAndroid.cpp"),
860 ]
861 deps = [
862 ":flags",
863 ":gm",
864 ":gpu_tool_utils",
865 ":skia",
866 ":tool_utils",
867 ]
868 }
mtklein2b6870c2016-07-28 14:17:33 -0700869
mtkleinc095df52016-08-24 12:23:52 -0700870 test_lib("experimental_svg_model") {
871 public_include_dirs = [ "experimental/svg/model" ]
872 sources = [
873 "experimental/svg/model/SkSVGAttribute.cpp",
874 "experimental/svg/model/SkSVGAttributeParser.cpp",
875 "experimental/svg/model/SkSVGCircle.cpp",
876 "experimental/svg/model/SkSVGContainer.cpp",
877 "experimental/svg/model/SkSVGDOM.cpp",
878 "experimental/svg/model/SkSVGEllipse.cpp",
879 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -0700880 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700881 "experimental/svg/model/SkSVGNode.cpp",
882 "experimental/svg/model/SkSVGPath.cpp",
883 "experimental/svg/model/SkSVGPoly.cpp",
884 "experimental/svg/model/SkSVGRect.cpp",
885 "experimental/svg/model/SkSVGRenderContext.cpp",
886 "experimental/svg/model/SkSVGSVG.cpp",
887 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -0700888 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700889 "experimental/svg/model/SkSVGTransformableNode.cpp",
890 "experimental/svg/model/SkSVGValue.cpp",
891 ]
892 deps = [
893 ":skia",
894 ]
895 }
fmalitaa2b9fdf2016-08-03 19:53:36 -0700896
mtklein2b6870c2016-07-28 14:17:33 -0700897 executable("dm") {
898 sources = [
899 "dm/DM.cpp",
900 "dm/DMJsonWriter.cpp",
901 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700902 ]
903 include_dirs = [ "tests" ]
904 deps = [
mtklein046cb562016-09-16 10:23:12 -0700905 ":common_flags",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700906 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700907 ":flags",
908 ":gm",
909 ":gpu_tool_utils",
910 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700911 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700912 ":tool_utils",
913 "//third_party/jsoncpp",
914 "//third_party/libpng",
915 ]
916 testonly = true
917 }
918
Mike Kleina3430172016-09-27 16:46:29 -0400919 if (!is_debug) { # I've benchmarked debug code once too many times...
920 executable("monobench") {
921 sources = [
922 "tools/monobench.cpp",
923 ]
924 deps = [
925 ":bench",
926 ":skia",
927 ]
928 testonly = true
929 }
mtklein2b6870c2016-07-28 14:17:33 -0700930 }
931
932 executable("nanobench") {
933 sources = [
934 "bench/nanobench.cpp",
935 ]
936 deps = [
937 ":bench",
mtklein046cb562016-09-16 10:23:12 -0700938 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -0700939 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700940 ":flags",
941 ":gm",
942 ":gpu_tool_utils",
943 ":skia",
944 ":tool_utils",
945 "//third_party/jsoncpp",
946 ]
947 testonly = true
948 }
halcanary19a97202016-08-03 15:08:04 -0700949
mtklein38925aa2016-09-21 10:11:25 -0700950 if (skia_enable_gpu) {
951 executable("skpbench") {
952 sources = [
953 "tools/skpbench/skpbench.cpp",
954 ]
955 deps = [
956 ":flags",
957 ":gpu_tool_utils",
958 ":skia",
959 ":tool_utils",
960 ]
961 testonly = true
962 }
csmartdalton4b5179b2016-09-19 11:03:58 -0700963 }
964
Mike Klein4b167fc2016-10-11 18:13:53 -0400965 # We can't yet build ICU on Windows.
Mike Klein768bdfc2016-10-11 19:59:22 -0400966 if (!is_win) {
halcanary3eee9d92016-09-10 07:01:53 -0700967 executable("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -0700968 sources = [
969 "tools/SkShaper_harfbuzz.cpp",
970 "tools/using_skia_and_harfbuzz.cpp",
971 ]
972 deps = [
973 ":skia",
974 "//third_party/harfbuzz",
975 ]
976 testonly = true
977 }
halcanary19a97202016-08-03 15:08:04 -0700978 }
halcanary3eee9d92016-09-10 07:01:53 -0700979 executable("sktexttopdf") {
980 sources = [
981 "tools/SkShaper_primitive.cpp",
982 "tools/using_skia_and_harfbuzz.cpp",
983 ]
984 deps = [
985 ":skia",
986 ]
987 testonly = true
988 }
mtklein046cb562016-09-16 10:23:12 -0700989
990 executable("get_images_from_skps") {
991 sources = [
992 "tools/get_images_from_skps.cpp",
993 ]
994 deps = [
995 ":flags",
996 ":skia",
997 "//third_party/jsoncpp",
998 ]
999 testonly = true
1000 }
mtkleinecbc5262016-09-22 11:51:24 -07001001
1002 executable("skiaserve") {
1003 sources = [
1004 "tools/skiaserve/Request.cpp",
1005 "tools/skiaserve/Response.cpp",
1006 "tools/skiaserve/skiaserve.cpp",
1007 "tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp",
1008 "tools/skiaserve/urlhandlers/BatchesHandler.cpp",
1009 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1010 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1011 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1012 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1013 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1014 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1015 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1016 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1017 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
1018 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1019 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1020 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1021 ]
1022 deps = [
1023 ":flags",
1024 ":gpu_tool_utils",
1025 ":skia",
1026 ":tool_utils",
1027 "//third_party/jsoncpp",
1028 "//third_party/libmicrohttpd",
1029 "//third_party/libpng",
1030 ]
1031 testonly = true
1032 }
kjlubick14f984b2016-10-03 11:49:45 -07001033
1034 executable("fuzz") {
1035 sources = [
1036 "fuzz/FilterFuzz.cpp",
1037 "fuzz/FuzzGradients.cpp",
1038 "fuzz/FuzzParsePath.cpp",
1039 "fuzz/FuzzPathop.cpp",
1040 "fuzz/FuzzScaleToSides.cpp",
1041 "fuzz/fuzz.cpp",
1042 ]
1043 deps = [
1044 ":flags",
1045 ":skia",
1046 ]
1047 testonly = true
1048 }
Mike Klein38312422016-10-05 15:41:01 -04001049
1050 executable("dump_record") {
1051 sources = [
1052 "tools/DumpRecord.cpp",
1053 "tools/dump_record.cpp",
1054 ]
1055 deps = [
1056 ":flags",
1057 ":skia",
1058 ]
1059 testonly = true
1060 }
mtklein25c81d42016-07-27 13:55:26 -07001061}