blob: d7dd484fc3f0148d77be07894844c8061aa87487 [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
6declare_args() {
7}
8
mtklein1211e0c2016-07-26 13:55:45 -07009skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070010 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070011 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070012 "include/codec",
13 "include/config",
14 "include/core",
15 "include/effects",
16 "include/gpu",
17 "include/gpu/gl",
18 "include/images",
19 "include/pathops",
20 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070021 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070022 "include/utils",
23 "include/utils/mac",
mtklein25c81d42016-07-27 13:55:26 -070024 "include/xml",
mtklein1211e0c2016-07-26 13:55:45 -070025]
26
mtkleinc04ff472016-06-23 10:29:30 -070027# Skia public API, generally provided by :skia.
28config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -070029 include_dirs = skia_public_includes
mtkleinc04ff472016-06-23 10:29:30 -070030 defines = [ "SKIA_DLL" ]
31}
32
33# Skia internal APIs, used by Skia itself and a few test tools.
34config("skia_private") {
35 visibility = [ ":*" ]
36
37 include_dirs = [
38 "include/private",
39 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -070040 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -070041 "src/config",
42 "src/core",
43 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -070044 "src/effects/gradients",
45 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -070046 "src/gpu",
47 "src/image",
48 "src/images",
49 "src/lazy",
50 "src/opts",
51 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -070052 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -070053 "src/ports",
54 "src/sfnt",
55 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -070056 "src/utils/win",
mtkleinc04ff472016-06-23 10:29:30 -070057 "third_party/etc1",
58 "third_party/ktx",
59 ]
mtklein150d1132016-08-01 06:56:40 -070060
61 defines = [
mtklein9be68662016-08-01 08:37:48 -070062 "SK_GAMMA_APPLY_TO_A8",
63
mtklein150d1132016-08-01 06:56:40 -070064 "SK_HAS_GIF_LIBRARY",
65 "SK_HAS_JPEG_LIBRARY",
66 "SK_HAS_PNG_LIBRARY",
67 "SK_HAS_WEBP_LIBRARY",
mtklein7c1ae7a2016-08-01 15:50:27 -070068
halcanary19a97202016-08-03 15:08:04 -070069 # TODO(halcanary): make this the default; this is the value Android uses.
70 "SK_SFNTLY_SUBSETTER=\"sample/chromium/font_subsetter.h\"",
71
mtklein7c1ae7a2016-08-01 15:50:27 -070072 "TURBO_HAS_565",
73 "TURBO_HAS_CROP",
74 "TURBO_HAS_SKIP",
mtklein150d1132016-08-01 06:56:40 -070075 ]
mtkleinee269f42016-08-04 09:52:11 -070076 if (is_linux) {
77 defines += [ "SK_SAMPLES_FOR_X" ]
78 }
mtkleinc04ff472016-06-23 10:29:30 -070079}
80
81# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
82config("skia_library") {
83 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -070084 defines = [ "SKIA_IMPLEMENTATION=1" ]
85}
86
87skia_library_configs = [
88 ":skia_public",
89 ":skia_private",
90 ":skia_library",
91]
92
mtklein7fbfbbe2016-07-21 12:25:45 -070093core_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -070094 [
95 rebase_path("gyp/core.gypi"),
96 "--replace=<(skia_include_path)=include",
97 "--replace=<(skia_src_path)=src",
98 ],
99 "scope",
100 [ "gyp/core.gypi" ])
101
mtklein7fbfbbe2016-07-21 12:25:45 -0700102effects_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700103 [
104 rebase_path("gyp/effects.gypi"),
105 "--replace=<(skia_include_path)=include",
106 "--replace=<(skia_src_path)=src",
107 ],
108 "scope",
109 [ "gyp/effects.gypi" ])
110
mtklein7fbfbbe2016-07-21 12:25:45 -0700111gpu_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700112 [
113 rebase_path("gyp/gpu.gypi"),
114 "--replace=<(skia_include_path)=include",
115 "--replace=<(skia_src_path)=src",
116 ],
117 "scope",
118 [ "gyp/gpu.gypi" ])
119
mtklein7fbfbbe2016-07-21 12:25:45 -0700120opts_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700121 [
122 rebase_path("gyp/opts.gypi"),
123 "--replace=<(skia_include_path)=include",
124 "--replace=<(skia_src_path)=src",
125 ],
126 "scope",
127 [ "gyp/opts.gypi" ])
128
mtklein7fbfbbe2016-07-21 12:25:45 -0700129pdf_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700130 [
131 rebase_path("gyp/pdf.gypi"),
132 "--replace=<(skia_include_path)=include",
133 "--replace=<(skia_src_path)=src",
134 ],
135 "scope",
136 [ "gyp/pdf.gypi" ])
137
mtklein7fbfbbe2016-07-21 12:25:45 -0700138utils_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700139 [
140 rebase_path("gyp/utils.gypi"),
141 "--replace=<(skia_include_path)=include",
142 "--replace=<(skia_src_path)=src",
143 ],
144 "scope",
145 [ "gyp/utils.gypi" ])
146
147source_set("opts_ssse3") {
148 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700149
150 sources = opts_gypi.ssse3_sources
151 cflags = [ "-mssse3" ]
152}
153
154source_set("opts_sse41") {
155 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700156
157 sources = opts_gypi.sse41_sources
158 cflags = [ "-msse4.1" ]
159}
160
mtklein4e976072016-08-08 09:06:27 -0700161source_set("opts_sse42") {
162 configs += skia_library_configs
163
164 sources = opts_gypi.sse42_sources
165 cflags = [ "-msse4.2" ]
166}
167
mtkleinc04ff472016-06-23 10:29:30 -0700168source_set("opts_avx") {
169 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700170
171 sources = opts_gypi.avx_sources
172 cflags = [ "-mavx" ]
173}
174
175component("skia") {
176 public_configs = [ ":skia_public" ]
177 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700178
179 deps = [
180 ":opts_avx",
181 ":opts_sse41",
mtklein4e976072016-08-08 09:06:27 -0700182 ":opts_sse42",
mtkleinc04ff472016-06-23 10:29:30 -0700183 ":opts_ssse3",
mtklein25c81d42016-07-27 13:55:26 -0700184 "//third_party/expat",
185 "//third_party/giflib",
mtklein7d10b9f2016-07-27 11:17:18 -0700186 "//third_party/libjpeg_turbo",
187 "//third_party/libpng",
mtklein25c81d42016-07-27 13:55:26 -0700188 "//third_party/libwebp",
halcanary19a97202016-08-03 15:08:04 -0700189 "//third_party/sfntly",
abarth6fc8ff02016-07-15 15:15:15 -0700190 "//third_party/zlib",
mtkleinc04ff472016-06-23 10:29:30 -0700191 ]
192
mtklein7a1f45f2016-08-04 06:19:33 -0700193 if (!is_win) {
194 libs = [ "pthread" ]
195 }
mtkleinc04ff472016-06-23 10:29:30 -0700196
197 sources = []
198 sources += core_gypi.sources
199 sources += effects_gypi.sources
200 sources += gpu_gypi.skgpu_sources
201 sources += opts_gypi.sse2_sources
202 sources += pdf_gypi.sources
203 sources += utils_gypi.sources
204 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700205 "src/android/SkBitmapRegionCodec.cpp",
206 "src/android/SkBitmapRegionDecoder.cpp",
207 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700208 "src/codec/SkBmpCodec.cpp",
209 "src/codec/SkBmpMaskCodec.cpp",
210 "src/codec/SkBmpRLECodec.cpp",
211 "src/codec/SkBmpStandardCodec.cpp",
212 "src/codec/SkCodec.cpp",
213 "src/codec/SkCodecImageGenerator.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700214 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700215 "src/codec/SkIcoCodec.cpp",
216 "src/codec/SkJpegCodec.cpp",
217 "src/codec/SkJpegDecoderMgr.cpp",
218 "src/codec/SkJpegUtility.cpp",
219 "src/codec/SkMaskSwizzler.cpp",
220 "src/codec/SkMasks.cpp",
221 "src/codec/SkPngCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700222 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700223 "src/codec/SkSampler.cpp",
224 "src/codec/SkSwizzler.cpp",
225 "src/codec/SkWbmpCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700226 "src/codec/SkWebpAdapterCodec.cpp",
227 "src/codec/SkWebpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700228 "src/images/SkImageEncoder.cpp",
229 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700230 "src/images/SkJPEGImageEncoder.cpp",
231 "src/images/SkJPEGWriteUtility.cpp",
232 "src/images/SkKTXImageEncoder.cpp",
233 "src/images/SkPNGImageEncoder.cpp",
234 "src/images/SkWEBPImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700235 "src/ports/SkDiscardableMemory_none.cpp",
236 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700237 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700238 "src/ports/SkMemory_malloc.cpp",
239 "src/ports/SkOSFile_stdio.cpp",
240 "src/sfnt/SkOTTable_name.cpp",
241 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700242 "src/svg/SkSVGCanvas.cpp",
243 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700244 "src/utils/mac/SkStream_mac.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700245 "src/xml/SkDOM.cpp",
246 "src/xml/SkXMLParser.cpp",
247 "src/xml/SkXMLWriter.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700248 "third_party/etc1/etc1.cpp",
249 "third_party/ktx/ktx.cpp",
250 ]
251
252 if (is_win) {
253 sources += [
254 "src/ports/SkDebug_win.cpp",
255 "src/ports/SkFontHost_win.cpp",
256 "src/ports/SkFontMgr_win_dw.cpp",
257 "src/ports/SkFontMgr_win_dw_factory.cpp",
258 "src/ports/SkImageEncoder_WIC.cpp",
259 "src/ports/SkImageGeneratorWIC.cpp",
260 "src/ports/SkOSFile_win.cpp",
261 "src/ports/SkScalerContext_win_dw.cpp",
262 "src/ports/SkTLS_win.cpp",
263 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700264 "src/xps/SkDocument_XPS.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700265 ]
mtklein7a1f45f2016-08-04 06:19:33 -0700266 sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700267 } else {
268 sources += [
269 "src/ports/SkDebug_stdio.cpp",
270 "src/ports/SkOSFile_posix.cpp",
271 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700272 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700273 ]
274 }
275
276 if (is_linux) {
277 deps += [
278 "third_party:fontconfig",
279 "third_party:freetype2",
mtkleinc04ff472016-06-23 10:29:30 -0700280 ]
281 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700282 "src/ports/SkFontConfigInterface_direct.cpp",
283 "src/ports/SkFontConfigInterface_direct_factory.cpp",
284 "src/ports/SkFontHost_FreeType.cpp",
285 "src/ports/SkFontHost_FreeType_common.cpp",
bungeman7d0e3bc2016-08-02 07:07:33 -0700286 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein7a34b1c2016-08-01 13:08:46 -0700287 "src/ports/SkFontMgr_fontconfig.cpp",
288 "src/ports/SkFontMgr_fontconfig_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700289 ]
290 }
291
292 if (is_mac) {
293 sources += [
294 "src/ports/SkFontHost_mac.cpp",
295 "src/ports/SkImageEncoder_CG.cpp",
296 "src/ports/SkImageGeneratorCG.cpp",
297 ]
298 libs += [ "ApplicationServices.framework" ]
299 }
abarth6fc8ff02016-07-15 15:15:15 -0700300
301 if (is_fuchsia) {
mtkleine817ddf2016-07-19 06:03:22 -0700302 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700303 }
mtkleinc04ff472016-06-23 10:29:30 -0700304}
305
mtkleinada5a442016-08-02 14:28:26 -0700306skia_h_headers = exec_script("gyp/find.py",
307 [ "*.h" ] + rebase_path(skia_public_includes),
308 "list lines",
309 []) -
310 [
311 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
312 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
313 rebase_path("include/gpu/vk/GrVkDefines.h"),
314 rebase_path("include/gpu/vk/GrVkInterface.h"),
315 rebase_path("include/gpu/vk/GrVkTypes.h"),
316 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
317 ]
318
mtklein1211e0c2016-07-26 13:55:45 -0700319action("skia.h") {
320 script = "gn/echo_headers.py"
321 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinada5a442016-08-02 14:28:26 -0700322 rebase_path(skia_h_headers, root_build_dir)
mtklein1211e0c2016-07-26 13:55:45 -0700323 outputs = [
324 "$target_gen_dir/skia.h",
325 ]
326}
327
328executable("fiddle") {
329 include_dirs = [ "$target_gen_dir" ]
mtklein7d10b9f2016-07-27 11:17:18 -0700330 libs = []
331 if (is_linux) {
332 libs += [ "OSMesa" ]
333 }
mtklein1211e0c2016-07-26 13:55:45 -0700334
mtkleinc04ff472016-06-23 10:29:30 -0700335 sources = [
mtklein1211e0c2016-07-26 13:55:45 -0700336 "tools/fiddle/draw.cpp",
337 "tools/fiddle/fiddle_main.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700338 ]
339 deps = [
340 ":skia",
mtklein1211e0c2016-07-26 13:55:45 -0700341 ":skia.h",
mtklein5dbd2742016-08-02 11:13:48 -0700342 ":tool_utils",
mtkleinc04ff472016-06-23 10:29:30 -0700343 ]
mtklein5dbd2742016-08-02 11:13:48 -0700344 testonly = true
mtkleinc04ff472016-06-23 10:29:30 -0700345}
mtklein25c81d42016-07-27 13:55:26 -0700346
347template("test_lib") {
348 config(target_name + "_config") {
349 include_dirs = invoker.public_include_dirs
350 }
351 source_set(target_name) {
352 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
353 public_configs = [
354 ":" + target_name + "_config",
355 ":skia_private",
356 ]
357
358 if (!defined(deps)) {
359 deps = []
360 }
361 deps += [ ":skia" ]
362 testonly = true
363 }
364}
365
366test_lib("gpu_tool_utils") {
367 public_include_dirs = [ "tools/gpu" ]
368 sources = [
369 "tools/gpu/GrContextFactory.cpp",
370 "tools/gpu/GrTest.cpp",
371 "tools/gpu/TestContext.cpp",
372 "tools/gpu/gl/GLTestContext.cpp",
373 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
374 "tools/gpu/gl/debug/GrBufferObj.cpp",
375 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
376 "tools/gpu/gl/debug/GrProgramObj.cpp",
377 "tools/gpu/gl/debug/GrShaderObj.cpp",
378 "tools/gpu/gl/debug/GrTextureObj.cpp",
379 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
380 "tools/gpu/gl/null/NullGLTestContext.cpp",
381 ]
382 libs = []
383
384 if (is_linux) {
mtklein5259da52016-08-03 08:28:20 -0700385 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700386 "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp",
387 "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp",
mtklein5259da52016-08-03 08:28:20 -0700388 ]
mtklein25c81d42016-07-27 13:55:26 -0700389 libs += [
390 "GL",
391 "GLU",
392 "X11",
393 ]
394 } else if (is_mac) {
mtklein5259da52016-08-03 08:28:20 -0700395 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700396 "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp",
397 "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp",
mtklein5259da52016-08-03 08:28:20 -0700398 ]
mtklein25c81d42016-07-27 13:55:26 -0700399 libs += [ "OpenGL.framework" ]
400 }
401}
402
403test_lib("flags") {
404 public_include_dirs = [ "tools/flags" ]
405 sources = [
406 "tools/flags/SkCommandLineFlags.cpp",
407 "tools/flags/SkCommonFlags.cpp",
408 "tools/flags/SkCommonFlagsConfig.cpp",
409 ]
410 deps = [
411 ":gpu_tool_utils",
412 ]
413}
414
415test_lib("tool_utils") {
416 public_include_dirs = [
417 "tools",
mtklein2f3416d2016-08-02 16:02:05 -0700418 "tools/debugger",
mtklein25c81d42016-07-27 13:55:26 -0700419 "tools/timer",
420 ]
421 sources = [
mtklein2b6870c2016-07-28 14:17:33 -0700422 "src/images/SkForceLinking.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700423 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtklein2b6870c2016-07-28 14:17:33 -0700424 "tools/CrashHandler.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700425 "tools/ProcStats.cpp",
426 "tools/Resources.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700427 "tools/ThermalManager.cpp",
mtklein2f3416d2016-08-02 16:02:05 -0700428 "tools/UrlDataManager.cpp",
429 "tools/debugger/SkDebugCanvas.cpp",
430 "tools/debugger/SkDrawCommand.cpp",
431 "tools/debugger/SkJsonWriteBuffer.cpp",
432 "tools/debugger/SkObjectParser.cpp",
433 "tools/debugger/SkOverdrawMode.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700434 "tools/picture_utils.cpp",
435 "tools/random_parse_path.cpp",
436 "tools/sk_tool_utils.cpp",
437 "tools/sk_tool_utils_font.cpp",
438 "tools/timer/Timer.cpp",
439 ]
440 deps = [
441 ":flags",
mtklein2f3416d2016-08-02 16:02:05 -0700442 "//third_party/libpng",
443 ]
444 public_deps = [
445 "//third_party/jsoncpp",
mtklein25c81d42016-07-27 13:55:26 -0700446 ]
447}
448
449gm_sources = exec_script("gyp/find.py",
450 [
mtklein25c81d42016-07-27 13:55:26 -0700451 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700452 rebase_path("gm"),
mtklein25c81d42016-07-27 13:55:26 -0700453 ],
454 "list lines",
455 [])
456test_lib("gm") {
457 public_include_dirs = [ "gm" ]
458 sources = gm_sources
459 deps = [
460 ":gpu_tool_utils",
461 ":skia",
462 ":tool_utils",
463 ]
464}
465
mtklein2f3416d2016-08-02 16:02:05 -0700466tests_sources = exec_script("gyp/find.py",
467 [
468 "*.c*",
469 rebase_path("tests"),
470 ],
471 "list lines",
472 [])
473
474test_lib("tests") {
475 public_include_dirs = [ "tests" ]
476 sources = tests_sources - [
477 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only
478 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtklein4db3b792016-08-03 14:18:22 -0700479 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work
480 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work
mtklein2f3416d2016-08-02 16:02:05 -0700481 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
482 rebase_path("tests/skia_test.cpp"), # alternate main
483 ]
484 deps = [
485 ":flags",
486 ":gpu_tool_utils",
487 ":skia",
488 ":tool_utils",
489 "//third_party/libpng",
490 "//third_party/zlib",
491 ]
492}
493
mtklein2b6870c2016-07-28 14:17:33 -0700494bench_sources = exec_script("gyp/find.py",
495 [
mtklein2b6870c2016-07-28 14:17:33 -0700496 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700497 rebase_path("bench"),
mtklein2b6870c2016-07-28 14:17:33 -0700498 ],
499 "list lines",
500 [])
mtklein25c81d42016-07-27 13:55:26 -0700501
mtklein2b6870c2016-07-28 14:17:33 -0700502test_lib("bench") {
503 public_include_dirs = [ "bench" ]
504 sources = bench_sources
505 sources -= [
506 rebase_path("bench/nanobench.cpp"),
507 rebase_path("bench/nanobenchAndroid.cpp"),
508 ]
509 deps = [
510 ":flags",
511 ":gm",
512 ":gpu_tool_utils",
513 ":skia",
514 ":tool_utils",
515 ]
516}
517
fmalitaa2b9fdf2016-08-03 19:53:36 -0700518test_lib("experimental_svg_model") {
519 public_include_dirs = [ "experimental/svg/model" ]
520 sources = [
521 "experimental/svg/model/SkSVGAttribute.cpp",
522 "experimental/svg/model/SkSVGAttributeParser.cpp",
523 "experimental/svg/model/SkSVGContainer.cpp",
524 "experimental/svg/model/SkSVGDOM.cpp",
525 "experimental/svg/model/SkSVGNode.cpp",
526 "experimental/svg/model/SkSVGPath.cpp",
fmalita5b31f322016-08-12 12:15:33 -0700527 "experimental/svg/model/SkSVGPoly.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700528 "experimental/svg/model/SkSVGRect.cpp",
529 "experimental/svg/model/SkSVGRenderContext.cpp",
530 "experimental/svg/model/SkSVGSVG.cpp",
531 "experimental/svg/model/SkSVGShape.cpp",
532 "experimental/svg/model/SkSVGTransformableNode.cpp",
533 "experimental/svg/model/SkSVGValue.cpp",
534 ]
535 deps = [
536 ":skia",
537 ]
538}
539
mtklein2b6870c2016-07-28 14:17:33 -0700540if (!is_component_build) { # Our test tools use many non-SK_API APIs...
541 executable("dm") {
542 sources = [
543 "dm/DM.cpp",
544 "dm/DMJsonWriter.cpp",
545 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700546 ]
547 include_dirs = [ "tests" ]
548 deps = [
fmalitaa2b9fdf2016-08-03 19:53:36 -0700549 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700550 ":flags",
551 ":gm",
552 ":gpu_tool_utils",
553 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700554 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700555 ":tool_utils",
556 "//third_party/jsoncpp",
557 "//third_party/libpng",
558 ]
559 testonly = true
560 }
561
562 executable("monobench") {
563 sources = [
564 "tools/monobench.cpp",
565 ]
566 deps = [
567 ":bench",
568 ":skia",
569 ]
570 testonly = true
571 }
572
573 executable("nanobench") {
574 sources = [
575 "bench/nanobench.cpp",
576 ]
577 deps = [
578 ":bench",
579 ":flags",
580 ":gm",
581 ":gpu_tool_utils",
582 ":skia",
583 ":tool_utils",
584 "//third_party/jsoncpp",
585 ]
586 testonly = true
587 }
halcanary19a97202016-08-03 15:08:04 -0700588
589 executable("sktexttopdf") {
590 sources = [
591 "tools/SkShaper_harfbuzz.cpp",
592 "tools/using_skia_and_harfbuzz.cpp",
593 ]
594 deps = [
595 ":skia",
596 "//third_party/harfbuzz",
597 ]
598 testonly = true
599 }
mtklein25c81d42016-07-27 13:55:26 -0700600}