blob: 7935e7433033d42cd67fc7814c9cd4b0fc27d586 [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")
Mike Klein703cf5a2016-10-13 17:18:04 -0400366 libs = []
mtklein06c35c02016-09-20 12:28:12 -0700367 if (is_android) {
368 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
369 } else if (is_linux) {
370 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
371 } else if (is_mac) {
372 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
Mike Klein703cf5a2016-10-13 17:18:04 -0400373 } else if (is_win) {
374 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
375 libs += [ "OpenGL32.lib" ]
mtklein06c35c02016-09-20 12:28:12 -0700376 } else {
377 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
378 }
mtkleine9fb3d52016-09-20 15:11:46 -0700379
380 if (skia_use_vulkan) {
381 public_defines += [ "SK_VULKAN" ]
382 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700383 if (skia_enable_vulkan_debug_layers) {
384 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
385 }
mtkleine9fb3d52016-09-20 15:11:46 -0700386 }
mtklein06c35c02016-09-20 12:28:12 -0700387}
388
mtklein63213812016-08-24 09:55:56 -0700389optional("jpeg") {
390 enabled = skia_use_libjpeg_turbo
391 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
392
mtklein63213812016-08-24 09:55:56 -0700393 deps = [
394 "//third_party/libjpeg-turbo:libjpeg",
395 ]
396 sources = [
397 "src/codec/SkJpegCodec.cpp",
398 "src/codec/SkJpegDecoderMgr.cpp",
399 "src/codec/SkJpegUtility.cpp",
400 "src/images/SkJPEGImageEncoder.cpp",
401 "src/images/SkJPEGWriteUtility.cpp",
402 ]
403}
404
405optional("pdf") {
406 enabled = skia_use_zlib
mtklein63213812016-08-24 09:55:56 -0700407
mtklein63213812016-08-24 09:55:56 -0700408 deps = [
409 "//third_party/zlib",
410 ]
brettwb9447282016-09-01 14:24:39 -0700411 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700412 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700413
414 if (skia_use_sfntly) {
415 deps += [ "//third_party/sfntly" ]
mtkleincd01b032016-08-31 04:58:19 -0700416 public_defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700417 }
418}
419
420optional("png") {
421 enabled = skia_use_libpng
422 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
423
mtklein63213812016-08-24 09:55:56 -0700424 deps = [
425 "//third_party/libpng",
426 ]
427 sources = [
428 "src/codec/SkIcoCodec.cpp",
429 "src/codec/SkPngCodec.cpp",
430 "src/images/SkPNGImageEncoder.cpp",
431 ]
432}
433
mtklein3cc22182016-08-29 13:26:14 -0700434optional("typeface_freetype") {
435 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700436
437 deps = [
438 "//third_party/freetype2",
439 ]
440 sources = [
441 "src/ports/SkFontHost_FreeType.cpp",
442 "src/ports/SkFontHost_FreeType_common.cpp",
443 ]
444}
445
mtklein457b42a2016-08-23 13:56:37 -0700446optional("webp") {
447 enabled = skia_use_libwebp
448 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
449
mtklein457b42a2016-08-23 13:56:37 -0700450 deps = [
451 "//third_party/libwebp",
452 ]
453 sources = [
454 "src/codec/SkWebpAdapterCodec.cpp",
455 "src/codec/SkWebpCodec.cpp",
456 "src/images/SkWEBPImageEncoder.cpp",
457 ]
mtkleineb3c4252016-08-23 07:38:09 -0700458}
459
mtklein63213812016-08-24 09:55:56 -0700460optional("xml") {
461 enabled = skia_use_expat
mtklein63213812016-08-24 09:55:56 -0700462
mtklein63213812016-08-24 09:55:56 -0700463 deps = [
464 "//third_party/expat",
465 ]
466 sources = [
467 "src/xml/SkDOM.cpp",
468 "src/xml/SkXMLParser.cpp",
469 "src/xml/SkXMLWriter.cpp",
470 ]
471}
472
mtkleinc04ff472016-06-23 10:29:30 -0700473component("skia") {
474 public_configs = [ ":skia_public" ]
475 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700476
477 deps = [
anmittalb8b3f712016-08-25 04:55:19 -0700478 ":arm64",
479 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -0700480 ":avx",
anmittalb8b3f712016-08-25 04:55:19 -0700481 ":crc32",
mtklein349cece2016-08-26 08:13:04 -0700482 ":dsp",
mtkleina45be612016-08-29 15:22:10 -0700483 ":fontmgr_android",
mtkleind2e39db2016-09-07 07:52:55 -0700484 ":fontmgr_custom",
mtklein3cc22182016-08-29 13:26:14 -0700485 ":fontmgr_fontconfig",
mtkleincdedd0e2016-09-12 15:15:44 -0700486 ":fontmgr_fuchsia",
mtklein457b42a2016-08-23 13:56:37 -0700487 ":gif",
mtklein06c35c02016-09-20 12:28:12 -0700488 ":gpu",
Mike Klein78d5a3b2016-09-30 10:48:01 -0400489 ":hsw",
mtklein63213812016-08-24 09:55:56 -0700490 ":jpeg",
mtklein9b8583d2016-08-24 17:32:30 -0700491 ":none",
mtklein63213812016-08-24 09:55:56 -0700492 ":pdf",
493 ":png",
mtklein9b8583d2016-08-24 17:32:30 -0700494 ":sse2",
495 ":sse41",
496 ":sse42",
497 ":ssse3",
mtklein3cc22182016-08-29 13:26:14 -0700498 ":typeface_freetype",
mtkleineb3c4252016-08-23 07:38:09 -0700499 ":webp",
mtklein63213812016-08-24 09:55:56 -0700500 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -0700501 ]
502
mtkleinc04ff472016-06-23 10:29:30 -0700503 sources = []
brettwb9447282016-09-01 14:24:39 -0700504 sources += skia_core_sources
505 sources += skia_effects_sources
brettwb9447282016-09-01 14:24:39 -0700506 sources += skia_sksl_sources
507 sources += skia_utils_sources
mtkleinc04ff472016-06-23 10:29:30 -0700508 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700509 "src/android/SkBitmapRegionCodec.cpp",
510 "src/android/SkBitmapRegionDecoder.cpp",
511 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700512 "src/codec/SkBmpCodec.cpp",
513 "src/codec/SkBmpMaskCodec.cpp",
514 "src/codec/SkBmpRLECodec.cpp",
515 "src/codec/SkBmpStandardCodec.cpp",
516 "src/codec/SkCodec.cpp",
517 "src/codec/SkCodecImageGenerator.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700518 "src/codec/SkMaskSwizzler.cpp",
519 "src/codec/SkMasks.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700520 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700521 "src/codec/SkSampler.cpp",
522 "src/codec/SkSwizzler.cpp",
523 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700524 "src/images/SkImageEncoder.cpp",
525 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700526 "src/images/SkKTXImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700527 "src/ports/SkDiscardableMemory_none.cpp",
528 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700529 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700530 "src/ports/SkMemory_malloc.cpp",
531 "src/ports/SkOSFile_stdio.cpp",
532 "src/sfnt/SkOTTable_name.cpp",
533 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700534 "src/svg/SkSVGCanvas.cpp",
535 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700536 "src/utils/mac/SkStream_mac.cpp",
537 "third_party/etc1/etc1.cpp",
538 "third_party/ktx/ktx.cpp",
539 ]
brettwb9447282016-09-01 14:24:39 -0700540
mtklein7d6fb2c2016-08-25 14:50:44 -0700541 libs = []
542
mtkleinc04ff472016-06-23 10:29:30 -0700543 if (is_win) {
544 sources += [
Mike Kleinae7e6712016-10-11 17:49:33 -0400545 "src/fonts/SkFontMgr_indirect.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700546 "src/ports/SkDebug_win.cpp",
547 "src/ports/SkFontHost_win.cpp",
548 "src/ports/SkFontMgr_win_dw.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700549 "src/ports/SkImageEncoder_WIC.cpp",
550 "src/ports/SkImageGeneratorWIC.cpp",
551 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -0700552 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700553 "src/ports/SkScalerContext_win_dw.cpp",
554 "src/ports/SkTLS_win.cpp",
555 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700556 "src/xps/SkDocument_XPS.cpp",
Mike Klein4b167fc2016-10-11 18:13:53 -0400557 "src/xps/SkXPSDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700558 ]
Mike Klein69f6ed42016-10-13 15:45:07 -0400559 if (skia_use_gdi) {
560 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
561 libs += [
562 "Gdi32.lib",
563 "Usp10.lib",
564 ]
565 } else {
566 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
567 }
mtkleinb9be9792016-09-16 14:44:18 -0700568 sources -=
569 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400570 libs += [
571 "FontSub.lib",
572 "Ole32.lib",
573 "OleAut32.lib",
574 "User32.lib",
575 ]
mtkleinc04ff472016-06-23 10:29:30 -0700576 } else {
577 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700578 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -0700579 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700580 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700581 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700582 ]
583 }
584
mtklein7d6fb2c2016-08-25 14:50:44 -0700585 if (is_android) {
586 deps += [
587 "//third_party/cpu-features",
588 "//third_party/expat",
mtklein7d6fb2c2016-08-25 14:50:44 -0700589 ]
mtklein06c35c02016-09-20 12:28:12 -0700590 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -0700591 libs += [
592 "EGL",
593 "GLESv2",
594 "log",
595 ]
596 }
597
mtkleinc04ff472016-06-23 10:29:30 -0700598 if (is_linux) {
mtklein09e61f72016-08-23 13:35:28 -0700599 libs += [
600 "GL",
601 "GLU",
602 "X11",
603 ]
mtklein06c35c02016-09-20 12:28:12 -0700604 sources += [ "src/ports/SkDebug_stdio.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700605 }
606
607 if (is_mac) {
608 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -0700609 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700610 "src/ports/SkFontHost_mac.cpp",
611 "src/ports/SkImageEncoder_CG.cpp",
612 "src/ports/SkImageGeneratorCG.cpp",
613 ]
mtklein09e61f72016-08-23 13:35:28 -0700614 libs += [
615 "ApplicationServices.framework",
616 "OpenGL.framework",
617 ]
mtkleinc04ff472016-06-23 10:29:30 -0700618 }
abarth6fc8ff02016-07-15 15:15:15 -0700619
620 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -0700621 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700622 }
mtkleinc04ff472016-06-23 10:29:30 -0700623}
624
mtkleinada5a442016-08-02 14:28:26 -0700625skia_h_headers = exec_script("gyp/find.py",
626 [ "*.h" ] + rebase_path(skia_public_includes),
627 "list lines",
628 []) -
629 [
630 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
631 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
632 rebase_path("include/gpu/vk/GrVkDefines.h"),
633 rebase_path("include/gpu/vk/GrVkInterface.h"),
634 rebase_path("include/gpu/vk/GrVkTypes.h"),
635 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
636 ]
637
mtklein1211e0c2016-07-26 13:55:45 -0700638action("skia.h") {
639 script = "gn/echo_headers.py"
640 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinc095df52016-08-24 12:23:52 -0700641 rebase_path(skia_h_headers, target_gen_dir)
Ben Wagnerbc344042016-09-29 15:41:53 -0400642 inputs = skia_h_headers
mtklein1211e0c2016-07-26 13:55:45 -0700643 outputs = [
644 "$target_gen_dir/skia.h",
645 ]
646}
647
mtklein06c35c02016-09-20 12:28:12 -0700648if (skia_enable_gpu && target_cpu == "x64") {
mtklein1fbdf982016-09-15 12:07:48 -0700649 # Our bots only have 64-bit libOSMesa installed.
650 # TODO: worth fixing?
651 executable("fiddle") {
652 include_dirs = [ "$target_gen_dir" ]
653 libs = []
654 if (is_linux) {
655 libs += [ "OSMesa" ]
656 }
mtklein56d56692016-09-15 11:18:55 -0700657
mtklein1fbdf982016-09-15 12:07:48 -0700658 sources = [
659 "src/images/SkForceLinking.cpp",
660 "tools/fiddle/draw.cpp",
661 "tools/fiddle/fiddle_main.cpp",
662 ]
663 deps = [
664 ":skia",
665 ":skia.h",
666 ]
667 }
mtkleinc04ff472016-06-23 10:29:30 -0700668}
mtklein25c81d42016-07-27 13:55:26 -0700669
mtkleinc095df52016-08-24 12:23:52 -0700670# Targets guarded by skia_enable_tools may use //third_party freely.
671if (skia_enable_tools) {
672 template("test_lib") {
673 config(target_name + "_config") {
674 include_dirs = invoker.public_include_dirs
mtkleina627b5c2016-09-20 13:36:47 -0700675 if (defined(invoker.public_defines)) {
676 defines = invoker.public_defines
677 }
mtklein25c81d42016-07-27 13:55:26 -0700678 }
mtkleinc095df52016-08-24 12:23:52 -0700679 source_set(target_name) {
680 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
681 public_configs = [
682 ":" + target_name + "_config",
683 ":skia_private",
684 ]
685
686 if (!defined(deps)) {
687 deps = []
688 }
689 deps += [ ":skia" ]
690 testonly = true
691 }
mtklein25c81d42016-07-27 13:55:26 -0700692 }
mtklein25c81d42016-07-27 13:55:26 -0700693
mtkleinc095df52016-08-24 12:23:52 -0700694 test_lib("gpu_tool_utils") {
mtklein38925aa2016-09-21 10:11:25 -0700695 public_include_dirs = []
696 if (skia_enable_gpu) {
697 public_defines = []
698 public_include_dirs += [ "tools/gpu" ]
mtkleind68f9b02016-09-23 13:18:41 -0700699
700 deps = []
mtklein38925aa2016-09-21 10:11:25 -0700701 sources = [
702 "tools/gpu/GrContextFactory.cpp",
703 "tools/gpu/GrTest.cpp",
704 "tools/gpu/TestContext.cpp",
705 "tools/gpu/gl/GLTestContext.cpp",
mtklein605d9522016-09-21 14:01:32 -0700706 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
mtklein38925aa2016-09-21 10:11:25 -0700707 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
708 "tools/gpu/gl/debug/GrBufferObj.cpp",
709 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
710 "tools/gpu/gl/debug/GrProgramObj.cpp",
711 "tools/gpu/gl/debug/GrShaderObj.cpp",
712 "tools/gpu/gl/debug/GrTextureObj.cpp",
713 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
714 "tools/gpu/gl/null/NullGLTestContext.cpp",
715 ]
716 libs = []
mtklein25c81d42016-07-27 13:55:26 -0700717
mtklein38925aa2016-09-21 10:11:25 -0700718 if (is_android) {
719 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
720 } else if (is_linux) {
721 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
722 } else if (is_mac) {
723 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Mike Klein4b167fc2016-10-11 18:13:53 -0400724 } else if (is_win) {
725 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
726 libs += [
727 "Gdi32.lib",
728 "OpenGL32.lib",
729 ]
mtklein38925aa2016-09-21 10:11:25 -0700730 }
mtklein6ef69992016-09-14 06:12:09 -0700731
mtkleind68f9b02016-09-23 13:18:41 -0700732 if (skia_use_angle) {
733 public_defines += [ "SK_ANGLE" ]
734 deps += [ "//third_party/angle2" ]
735 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
mtklein38925aa2016-09-21 10:11:25 -0700736 }
737 if (skia_use_mesa) {
738 public_defines += [ "SK_MESA" ]
739 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
740 libs += [ "OSMesa" ]
741 }
mtkleind68f9b02016-09-23 13:18:41 -0700742 if (skia_use_vulkan) {
743 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
744 }
mtkleina627b5c2016-09-20 13:36:47 -0700745 }
mtklein25c81d42016-07-27 13:55:26 -0700746 }
mtklein25c81d42016-07-27 13:55:26 -0700747
mtkleinc095df52016-08-24 12:23:52 -0700748 test_lib("flags") {
749 public_include_dirs = [ "tools/flags" ]
750 sources = [
751 "tools/flags/SkCommandLineFlags.cpp",
mtklein046cb562016-09-16 10:23:12 -0700752 ]
753 }
754 test_lib("common_flags") {
755 public_include_dirs = [ "tools/flags" ]
756 sources = [
mtkleinc095df52016-08-24 12:23:52 -0700757 "tools/flags/SkCommonFlags.cpp",
758 "tools/flags/SkCommonFlagsConfig.cpp",
759 ]
760 deps = [
mtklein046cb562016-09-16 10:23:12 -0700761 ":flags",
mtkleinc095df52016-08-24 12:23:52 -0700762 ":gpu_tool_utils",
763 ]
764 }
mtklein25c81d42016-07-27 13:55:26 -0700765
mtkleinc095df52016-08-24 12:23:52 -0700766 test_lib("tool_utils") {
767 public_include_dirs = [
768 "tools",
769 "tools/debugger",
770 "tools/timer",
771 ]
772 sources = [
773 "src/images/SkForceLinking.cpp",
774 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtkleinb37c0342016-09-09 11:07:45 -0700775 "tools/AndroidSkDebugToStdOut.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700776 "tools/CrashHandler.cpp",
mtklein0590fa52016-09-01 07:06:54 -0700777 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700778 "tools/ProcStats.cpp",
779 "tools/Resources.cpp",
780 "tools/ThermalManager.cpp",
781 "tools/UrlDataManager.cpp",
782 "tools/debugger/SkDebugCanvas.cpp",
783 "tools/debugger/SkDrawCommand.cpp",
784 "tools/debugger/SkJsonWriteBuffer.cpp",
785 "tools/debugger/SkObjectParser.cpp",
786 "tools/debugger/SkOverdrawMode.cpp",
787 "tools/picture_utils.cpp",
788 "tools/random_parse_path.cpp",
789 "tools/sk_tool_utils.cpp",
790 "tools/sk_tool_utils_font.cpp",
791 "tools/timer/Timer.cpp",
792 ]
793 deps = [
mtklein046cb562016-09-16 10:23:12 -0700794 ":common_flags",
mtkleinc095df52016-08-24 12:23:52 -0700795 ":flags",
796 "//third_party/libpng",
797 ]
798 public_deps = [
799 "//third_party/jsoncpp",
800 ]
801 }
mtklein25c81d42016-07-27 13:55:26 -0700802
mtkleinc095df52016-08-24 12:23:52 -0700803 gm_sources = exec_script("gyp/find.py",
804 [
805 "*.c*",
806 rebase_path("gm"),
807 ],
808 "list lines",
809 [])
810 test_lib("gm") {
811 public_include_dirs = [ "gm" ]
812 sources = gm_sources
813 deps = [
814 ":gpu_tool_utils",
815 ":skia",
816 ":tool_utils",
817 ]
818 }
mtklein25c81d42016-07-27 13:55:26 -0700819
mtkleinc095df52016-08-24 12:23:52 -0700820 tests_sources = exec_script("gyp/find.py",
821 [
822 "*.c*",
823 rebase_path("tests"),
824 ],
825 "list lines",
826 [])
mtklein2f3416d2016-08-02 16:02:05 -0700827
mtkleinc095df52016-08-24 12:23:52 -0700828 test_lib("tests") {
829 public_include_dirs = [ "tests" ]
mtkleina45be612016-08-29 15:22:10 -0700830 sources = tests_sources - [
831 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtkleina45be612016-08-29 15:22:10 -0700832 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
833 rebase_path("tests/skia_test.cpp"), # alternate main
834 ]
835 if (!fontmgr_android_enabled) {
836 sources -= [ rebase_path("tests/FontMgrAndroidParserTest.cpp") ]
837 }
mtkleinc095df52016-08-24 12:23:52 -0700838 deps = [
fmalita6cf896d2016-08-25 08:44:35 -0700839 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -0700840 ":flags",
841 ":gpu_tool_utils",
842 ":skia",
843 ":tool_utils",
844 "//third_party/libpng",
845 "//third_party/zlib",
846 ]
847 }
mtklein2f3416d2016-08-02 16:02:05 -0700848
mtkleinc095df52016-08-24 12:23:52 -0700849 bench_sources = exec_script("gyp/find.py",
850 [
851 "*.c*",
852 rebase_path("bench"),
853 ],
854 "list lines",
855 [])
mtklein25c81d42016-07-27 13:55:26 -0700856
mtkleinc095df52016-08-24 12:23:52 -0700857 test_lib("bench") {
858 public_include_dirs = [ "bench" ]
859 sources = bench_sources
860 sources -= [
861 rebase_path("bench/nanobench.cpp"),
862 rebase_path("bench/nanobenchAndroid.cpp"),
863 ]
864 deps = [
865 ":flags",
866 ":gm",
867 ":gpu_tool_utils",
868 ":skia",
869 ":tool_utils",
870 ]
871 }
mtklein2b6870c2016-07-28 14:17:33 -0700872
mtkleinc095df52016-08-24 12:23:52 -0700873 test_lib("experimental_svg_model") {
874 public_include_dirs = [ "experimental/svg/model" ]
875 sources = [
876 "experimental/svg/model/SkSVGAttribute.cpp",
877 "experimental/svg/model/SkSVGAttributeParser.cpp",
878 "experimental/svg/model/SkSVGCircle.cpp",
879 "experimental/svg/model/SkSVGContainer.cpp",
880 "experimental/svg/model/SkSVGDOM.cpp",
881 "experimental/svg/model/SkSVGEllipse.cpp",
882 "experimental/svg/model/SkSVGLine.cpp",
fmalita28d5b722016-09-12 17:06:47 -0700883 "experimental/svg/model/SkSVGLinearGradient.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700884 "experimental/svg/model/SkSVGNode.cpp",
885 "experimental/svg/model/SkSVGPath.cpp",
886 "experimental/svg/model/SkSVGPoly.cpp",
887 "experimental/svg/model/SkSVGRect.cpp",
888 "experimental/svg/model/SkSVGRenderContext.cpp",
889 "experimental/svg/model/SkSVGSVG.cpp",
890 "experimental/svg/model/SkSVGShape.cpp",
fmalita28d5b722016-09-12 17:06:47 -0700891 "experimental/svg/model/SkSVGStop.cpp",
mtkleinc095df52016-08-24 12:23:52 -0700892 "experimental/svg/model/SkSVGTransformableNode.cpp",
893 "experimental/svg/model/SkSVGValue.cpp",
894 ]
895 deps = [
896 ":skia",
897 ]
898 }
fmalitaa2b9fdf2016-08-03 19:53:36 -0700899
mtklein2b6870c2016-07-28 14:17:33 -0700900 executable("dm") {
901 sources = [
902 "dm/DM.cpp",
903 "dm/DMJsonWriter.cpp",
904 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700905 ]
906 include_dirs = [ "tests" ]
907 deps = [
mtklein046cb562016-09-16 10:23:12 -0700908 ":common_flags",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700909 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700910 ":flags",
911 ":gm",
912 ":gpu_tool_utils",
913 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700914 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700915 ":tool_utils",
916 "//third_party/jsoncpp",
917 "//third_party/libpng",
918 ]
919 testonly = true
920 }
921
Mike Kleina3430172016-09-27 16:46:29 -0400922 if (!is_debug) { # I've benchmarked debug code once too many times...
923 executable("monobench") {
924 sources = [
925 "tools/monobench.cpp",
926 ]
927 deps = [
928 ":bench",
929 ":skia",
930 ]
931 testonly = true
932 }
mtklein2b6870c2016-07-28 14:17:33 -0700933 }
934
935 executable("nanobench") {
936 sources = [
937 "bench/nanobench.cpp",
938 ]
939 deps = [
940 ":bench",
mtklein046cb562016-09-16 10:23:12 -0700941 ":common_flags",
fmalita6519c212016-09-14 08:05:17 -0700942 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700943 ":flags",
944 ":gm",
945 ":gpu_tool_utils",
946 ":skia",
947 ":tool_utils",
948 "//third_party/jsoncpp",
949 ]
950 testonly = true
951 }
halcanary19a97202016-08-03 15:08:04 -0700952
mtklein38925aa2016-09-21 10:11:25 -0700953 if (skia_enable_gpu) {
954 executable("skpbench") {
955 sources = [
956 "tools/skpbench/skpbench.cpp",
957 ]
958 deps = [
959 ":flags",
960 ":gpu_tool_utils",
961 ":skia",
962 ":tool_utils",
963 ]
964 testonly = true
965 }
csmartdalton4b5179b2016-09-19 11:03:58 -0700966 }
967
Mike Klein4b167fc2016-10-11 18:13:53 -0400968 # We can't yet build ICU on Windows.
Mike Klein768bdfc2016-10-11 19:59:22 -0400969 if (!is_win) {
halcanary3eee9d92016-09-10 07:01:53 -0700970 executable("sktexttopdf-hb") {
mtklein6f5df6a2016-08-29 16:01:10 -0700971 sources = [
972 "tools/SkShaper_harfbuzz.cpp",
973 "tools/using_skia_and_harfbuzz.cpp",
974 ]
975 deps = [
976 ":skia",
977 "//third_party/harfbuzz",
978 ]
979 testonly = true
980 }
halcanary19a97202016-08-03 15:08:04 -0700981 }
halcanary3eee9d92016-09-10 07:01:53 -0700982 executable("sktexttopdf") {
983 sources = [
984 "tools/SkShaper_primitive.cpp",
985 "tools/using_skia_and_harfbuzz.cpp",
986 ]
987 deps = [
988 ":skia",
989 ]
990 testonly = true
991 }
mtklein046cb562016-09-16 10:23:12 -0700992
993 executable("get_images_from_skps") {
994 sources = [
995 "tools/get_images_from_skps.cpp",
996 ]
997 deps = [
998 ":flags",
999 ":skia",
1000 "//third_party/jsoncpp",
1001 ]
1002 testonly = true
1003 }
mtkleinecbc5262016-09-22 11:51:24 -07001004
1005 executable("skiaserve") {
1006 sources = [
1007 "tools/skiaserve/Request.cpp",
1008 "tools/skiaserve/Response.cpp",
1009 "tools/skiaserve/skiaserve.cpp",
1010 "tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp",
1011 "tools/skiaserve/urlhandlers/BatchesHandler.cpp",
1012 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1013 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1014 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1015 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1016 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1017 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1018 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1019 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1020 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
1021 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1022 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1023 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1024 ]
1025 deps = [
1026 ":flags",
1027 ":gpu_tool_utils",
1028 ":skia",
1029 ":tool_utils",
1030 "//third_party/jsoncpp",
1031 "//third_party/libmicrohttpd",
1032 "//third_party/libpng",
1033 ]
1034 testonly = true
1035 }
kjlubick14f984b2016-10-03 11:49:45 -07001036
1037 executable("fuzz") {
1038 sources = [
1039 "fuzz/FilterFuzz.cpp",
1040 "fuzz/FuzzGradients.cpp",
1041 "fuzz/FuzzParsePath.cpp",
1042 "fuzz/FuzzPathop.cpp",
1043 "fuzz/FuzzScaleToSides.cpp",
1044 "fuzz/fuzz.cpp",
1045 ]
1046 deps = [
1047 ":flags",
1048 ":skia",
1049 ]
1050 testonly = true
1051 }
Mike Klein38312422016-10-05 15:41:01 -04001052
1053 executable("dump_record") {
1054 sources = [
1055 "tools/DumpRecord.cpp",
1056 "tools/dump_record.cpp",
1057 ]
1058 deps = [
1059 ":flags",
1060 ":skia",
1061 ]
1062 testonly = true
1063 }
mtklein25c81d42016-07-27 13:55:26 -07001064}