blob: ccf2e6bfc223e386edc99bfc4fc914308a6829f3 [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() {
mtkleineb3c4252016-08-23 07:38:09 -07007 skia_use_libwebp = !is_fuchsia
mtkleinc04ff472016-06-23 10:29:30 -07008}
9
mtklein1211e0c2016-07-26 13:55:45 -070010skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070011 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070012 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070013 "include/codec",
14 "include/config",
15 "include/core",
16 "include/effects",
17 "include/gpu",
18 "include/gpu/gl",
19 "include/images",
20 "include/pathops",
21 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070022 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070023 "include/utils",
24 "include/utils/mac",
mtklein25c81d42016-07-27 13:55:26 -070025 "include/xml",
mtklein1211e0c2016-07-26 13:55:45 -070026]
27
mtkleinc04ff472016-06-23 10:29:30 -070028# Skia public API, generally provided by :skia.
29config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -070030 include_dirs = skia_public_includes
mtkleinc04ff472016-06-23 10:29:30 -070031 defines = [ "SKIA_DLL" ]
32}
33
34# Skia internal APIs, used by Skia itself and a few test tools.
35config("skia_private") {
36 visibility = [ ":*" ]
37
38 include_dirs = [
39 "include/private",
40 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -070041 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -070042 "src/config",
43 "src/core",
44 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -070045 "src/effects/gradients",
46 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -070047 "src/gpu",
48 "src/image",
49 "src/images",
50 "src/lazy",
51 "src/opts",
52 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -070053 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -070054 "src/ports",
55 "src/sfnt",
56 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -070057 "src/utils/win",
mtkleinc04ff472016-06-23 10:29:30 -070058 "third_party/etc1",
59 "third_party/ktx",
60 ]
mtklein150d1132016-08-01 06:56:40 -070061
62 defines = [
mtklein9be68662016-08-01 08:37:48 -070063 "SK_GAMMA_APPLY_TO_A8",
64
mtklein150d1132016-08-01 06:56:40 -070065 "SK_HAS_GIF_LIBRARY",
66 "SK_HAS_JPEG_LIBRARY",
67 "SK_HAS_PNG_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
anmittala7eaf2e2016-08-17 13:57:26 -0700147source_set("opts_none") {
148 configs += skia_library_configs
149 sources = opts_gypi.none_sources
150}
151
mtklein422310d2016-08-16 18:28:43 -0700152is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700153
mtklein422310d2016-08-16 18:28:43 -0700154if (is_x86) {
155 source_set("opts_sse2") {
156 configs += skia_library_configs
157 sources = opts_gypi.sse2_sources
158 cflags = [ "-msse2" ]
159 }
mtkleinc04ff472016-06-23 10:29:30 -0700160
mtklein422310d2016-08-16 18:28:43 -0700161 source_set("opts_ssse3") {
162 configs += skia_library_configs
163 sources = opts_gypi.ssse3_sources
164 cflags = [ "-mssse3" ]
165 }
mtkleinc04ff472016-06-23 10:29:30 -0700166
mtklein422310d2016-08-16 18:28:43 -0700167 source_set("opts_sse41") {
168 configs += skia_library_configs
169 sources = opts_gypi.sse41_sources
170 cflags = [ "-msse4.1" ]
171 }
mtkleinc04ff472016-06-23 10:29:30 -0700172
mtklein422310d2016-08-16 18:28:43 -0700173 source_set("opts_sse42") {
174 configs += skia_library_configs
175 sources = opts_gypi.sse42_sources
176 cflags = [ "-msse4.2" ]
177 }
mtklein4e976072016-08-08 09:06:27 -0700178
mtklein422310d2016-08-16 18:28:43 -0700179 source_set("opts_avx") {
180 configs += skia_library_configs
181 sources = opts_gypi.avx_sources
182 cflags = [ "-mavx" ]
183 }
mtkleinc04ff472016-06-23 10:29:30 -0700184}
185
mtkleineb3c4252016-08-23 07:38:09 -0700186if (skia_use_libwebp) {
187 config("webp_config") {
188 defines = [ "SK_HAS_WEBP_LIBRARY" ]
189 }
190 source_set("webp") {
191 configs += skia_library_configs
192 all_dependent_configs = [ ":webp_config" ]
193 deps = [
194 "//third_party/libwebp",
195 ]
196 sources = [
197 "src/codec/SkWebpAdapterCodec.cpp",
198 "src/codec/SkWebpCodec.cpp",
199 "src/images/SkWEBPImageEncoder.cpp",
200 ]
201 }
202} else {
203 source_set("webp") {
204 }
205}
206
mtkleinc04ff472016-06-23 10:29:30 -0700207component("skia") {
208 public_configs = [ ":skia_public" ]
209 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700210
211 deps = [
mtkleineb3c4252016-08-23 07:38:09 -0700212 ":webp",
mtklein25c81d42016-07-27 13:55:26 -0700213 "//third_party/expat",
214 "//third_party/giflib",
mtklein0a8efd72016-08-22 06:32:39 -0700215 "//third_party/libjpeg-turbo:libjpeg",
mtklein7d10b9f2016-07-27 11:17:18 -0700216 "//third_party/libpng",
halcanary19a97202016-08-03 15:08:04 -0700217 "//third_party/sfntly",
abarth6fc8ff02016-07-15 15:15:15 -0700218 "//third_party/zlib",
mtkleinc04ff472016-06-23 10:29:30 -0700219 ]
mtklein422310d2016-08-16 18:28:43 -0700220 if (is_x86) {
221 deps += [
222 ":opts_avx",
223 ":opts_sse2",
224 ":opts_sse41",
225 ":opts_sse42",
226 ":opts_ssse3",
227 ]
anmittala7eaf2e2016-08-17 13:57:26 -0700228 } else {
229 deps += [ ":opts_none" ]
mtklein422310d2016-08-16 18:28:43 -0700230 }
mtkleinc04ff472016-06-23 10:29:30 -0700231
mtklein7a1f45f2016-08-04 06:19:33 -0700232 if (!is_win) {
233 libs = [ "pthread" ]
234 }
mtkleinc04ff472016-06-23 10:29:30 -0700235
236 sources = []
237 sources += core_gypi.sources
238 sources += effects_gypi.sources
239 sources += gpu_gypi.skgpu_sources
mtkleinc04ff472016-06-23 10:29:30 -0700240 sources += pdf_gypi.sources
241 sources += utils_gypi.sources
242 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700243 "src/android/SkBitmapRegionCodec.cpp",
244 "src/android/SkBitmapRegionDecoder.cpp",
245 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700246 "src/codec/SkBmpCodec.cpp",
247 "src/codec/SkBmpMaskCodec.cpp",
248 "src/codec/SkBmpRLECodec.cpp",
249 "src/codec/SkBmpStandardCodec.cpp",
250 "src/codec/SkCodec.cpp",
251 "src/codec/SkCodecImageGenerator.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700252 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700253 "src/codec/SkIcoCodec.cpp",
254 "src/codec/SkJpegCodec.cpp",
255 "src/codec/SkJpegDecoderMgr.cpp",
256 "src/codec/SkJpegUtility.cpp",
257 "src/codec/SkMaskSwizzler.cpp",
258 "src/codec/SkMasks.cpp",
259 "src/codec/SkPngCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700260 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700261 "src/codec/SkSampler.cpp",
262 "src/codec/SkSwizzler.cpp",
263 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700264 "src/images/SkImageEncoder.cpp",
265 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700266 "src/images/SkJPEGImageEncoder.cpp",
267 "src/images/SkJPEGWriteUtility.cpp",
268 "src/images/SkKTXImageEncoder.cpp",
269 "src/images/SkPNGImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700270 "src/ports/SkDiscardableMemory_none.cpp",
271 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700272 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700273 "src/ports/SkMemory_malloc.cpp",
274 "src/ports/SkOSFile_stdio.cpp",
275 "src/sfnt/SkOTTable_name.cpp",
276 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700277 "src/svg/SkSVGCanvas.cpp",
278 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700279 "src/utils/mac/SkStream_mac.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700280 "src/xml/SkDOM.cpp",
281 "src/xml/SkXMLParser.cpp",
282 "src/xml/SkXMLWriter.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700283 "third_party/etc1/etc1.cpp",
284 "third_party/ktx/ktx.cpp",
285 ]
286
287 if (is_win) {
288 sources += [
289 "src/ports/SkDebug_win.cpp",
290 "src/ports/SkFontHost_win.cpp",
291 "src/ports/SkFontMgr_win_dw.cpp",
292 "src/ports/SkFontMgr_win_dw_factory.cpp",
293 "src/ports/SkImageEncoder_WIC.cpp",
294 "src/ports/SkImageGeneratorWIC.cpp",
295 "src/ports/SkOSFile_win.cpp",
296 "src/ports/SkScalerContext_win_dw.cpp",
297 "src/ports/SkTLS_win.cpp",
298 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700299 "src/xps/SkDocument_XPS.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700300 ]
mtklein7a1f45f2016-08-04 06:19:33 -0700301 sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700302 } else {
303 sources += [
304 "src/ports/SkDebug_stdio.cpp",
305 "src/ports/SkOSFile_posix.cpp",
306 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700307 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700308 ]
309 }
310
311 if (is_linux) {
312 deps += [
313 "third_party:fontconfig",
314 "third_party:freetype2",
mtkleinc04ff472016-06-23 10:29:30 -0700315 ]
316 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700317 "src/ports/SkFontConfigInterface_direct.cpp",
318 "src/ports/SkFontConfigInterface_direct_factory.cpp",
319 "src/ports/SkFontHost_FreeType.cpp",
320 "src/ports/SkFontHost_FreeType_common.cpp",
bungeman7d0e3bc2016-08-02 07:07:33 -0700321 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein7a34b1c2016-08-01 13:08:46 -0700322 "src/ports/SkFontMgr_fontconfig.cpp",
323 "src/ports/SkFontMgr_fontconfig_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700324 ]
325 }
326
327 if (is_mac) {
328 sources += [
329 "src/ports/SkFontHost_mac.cpp",
330 "src/ports/SkImageEncoder_CG.cpp",
331 "src/ports/SkImageGeneratorCG.cpp",
332 ]
333 libs += [ "ApplicationServices.framework" ]
334 }
abarth6fc8ff02016-07-15 15:15:15 -0700335
336 if (is_fuchsia) {
mtkleine817ddf2016-07-19 06:03:22 -0700337 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700338 }
mtkleinc04ff472016-06-23 10:29:30 -0700339}
340
mtkleinada5a442016-08-02 14:28:26 -0700341skia_h_headers = exec_script("gyp/find.py",
342 [ "*.h" ] + rebase_path(skia_public_includes),
343 "list lines",
344 []) -
345 [
346 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
347 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
348 rebase_path("include/gpu/vk/GrVkDefines.h"),
349 rebase_path("include/gpu/vk/GrVkInterface.h"),
350 rebase_path("include/gpu/vk/GrVkTypes.h"),
351 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
352 ]
353
mtklein1211e0c2016-07-26 13:55:45 -0700354action("skia.h") {
355 script = "gn/echo_headers.py"
356 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinada5a442016-08-02 14:28:26 -0700357 rebase_path(skia_h_headers, root_build_dir)
mtklein1211e0c2016-07-26 13:55:45 -0700358 outputs = [
359 "$target_gen_dir/skia.h",
360 ]
361}
362
363executable("fiddle") {
364 include_dirs = [ "$target_gen_dir" ]
mtklein7d10b9f2016-07-27 11:17:18 -0700365 libs = []
366 if (is_linux) {
367 libs += [ "OSMesa" ]
368 }
mtklein1211e0c2016-07-26 13:55:45 -0700369
mtkleinc04ff472016-06-23 10:29:30 -0700370 sources = [
mtklein1211e0c2016-07-26 13:55:45 -0700371 "tools/fiddle/draw.cpp",
372 "tools/fiddle/fiddle_main.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700373 ]
374 deps = [
375 ":skia",
mtklein1211e0c2016-07-26 13:55:45 -0700376 ":skia.h",
mtklein5dbd2742016-08-02 11:13:48 -0700377 ":tool_utils",
mtkleinc04ff472016-06-23 10:29:30 -0700378 ]
mtklein5dbd2742016-08-02 11:13:48 -0700379 testonly = true
mtkleinc04ff472016-06-23 10:29:30 -0700380}
mtklein25c81d42016-07-27 13:55:26 -0700381
382template("test_lib") {
383 config(target_name + "_config") {
384 include_dirs = invoker.public_include_dirs
385 }
386 source_set(target_name) {
387 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
388 public_configs = [
389 ":" + target_name + "_config",
390 ":skia_private",
391 ]
392
393 if (!defined(deps)) {
394 deps = []
395 }
396 deps += [ ":skia" ]
397 testonly = true
398 }
399}
400
401test_lib("gpu_tool_utils") {
402 public_include_dirs = [ "tools/gpu" ]
403 sources = [
404 "tools/gpu/GrContextFactory.cpp",
405 "tools/gpu/GrTest.cpp",
406 "tools/gpu/TestContext.cpp",
407 "tools/gpu/gl/GLTestContext.cpp",
408 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
409 "tools/gpu/gl/debug/GrBufferObj.cpp",
410 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
411 "tools/gpu/gl/debug/GrProgramObj.cpp",
412 "tools/gpu/gl/debug/GrShaderObj.cpp",
413 "tools/gpu/gl/debug/GrTextureObj.cpp",
414 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
415 "tools/gpu/gl/null/NullGLTestContext.cpp",
416 ]
417 libs = []
418
419 if (is_linux) {
mtklein5259da52016-08-03 08:28:20 -0700420 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700421 "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp",
422 "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp",
mtklein5259da52016-08-03 08:28:20 -0700423 ]
mtklein25c81d42016-07-27 13:55:26 -0700424 libs += [
425 "GL",
426 "GLU",
427 "X11",
428 ]
429 } else if (is_mac) {
mtklein5259da52016-08-03 08:28:20 -0700430 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700431 "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp",
432 "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp",
mtklein5259da52016-08-03 08:28:20 -0700433 ]
mtklein25c81d42016-07-27 13:55:26 -0700434 libs += [ "OpenGL.framework" ]
435 }
436}
437
438test_lib("flags") {
439 public_include_dirs = [ "tools/flags" ]
440 sources = [
441 "tools/flags/SkCommandLineFlags.cpp",
442 "tools/flags/SkCommonFlags.cpp",
443 "tools/flags/SkCommonFlagsConfig.cpp",
444 ]
445 deps = [
446 ":gpu_tool_utils",
447 ]
448}
449
450test_lib("tool_utils") {
451 public_include_dirs = [
452 "tools",
mtklein2f3416d2016-08-02 16:02:05 -0700453 "tools/debugger",
mtklein25c81d42016-07-27 13:55:26 -0700454 "tools/timer",
455 ]
456 sources = [
mtklein2b6870c2016-07-28 14:17:33 -0700457 "src/images/SkForceLinking.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700458 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtklein2b6870c2016-07-28 14:17:33 -0700459 "tools/CrashHandler.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700460 "tools/ProcStats.cpp",
461 "tools/Resources.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700462 "tools/ThermalManager.cpp",
mtklein2f3416d2016-08-02 16:02:05 -0700463 "tools/UrlDataManager.cpp",
464 "tools/debugger/SkDebugCanvas.cpp",
465 "tools/debugger/SkDrawCommand.cpp",
466 "tools/debugger/SkJsonWriteBuffer.cpp",
467 "tools/debugger/SkObjectParser.cpp",
468 "tools/debugger/SkOverdrawMode.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700469 "tools/picture_utils.cpp",
470 "tools/random_parse_path.cpp",
471 "tools/sk_tool_utils.cpp",
472 "tools/sk_tool_utils_font.cpp",
473 "tools/timer/Timer.cpp",
474 ]
475 deps = [
476 ":flags",
mtklein2f3416d2016-08-02 16:02:05 -0700477 "//third_party/libpng",
478 ]
479 public_deps = [
480 "//third_party/jsoncpp",
mtklein25c81d42016-07-27 13:55:26 -0700481 ]
482}
483
484gm_sources = exec_script("gyp/find.py",
485 [
mtklein25c81d42016-07-27 13:55:26 -0700486 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700487 rebase_path("gm"),
mtklein25c81d42016-07-27 13:55:26 -0700488 ],
489 "list lines",
490 [])
491test_lib("gm") {
492 public_include_dirs = [ "gm" ]
493 sources = gm_sources
494 deps = [
495 ":gpu_tool_utils",
496 ":skia",
497 ":tool_utils",
498 ]
499}
500
mtklein2f3416d2016-08-02 16:02:05 -0700501tests_sources = exec_script("gyp/find.py",
502 [
503 "*.c*",
504 rebase_path("tests"),
505 ],
506 "list lines",
507 [])
508
509test_lib("tests") {
510 public_include_dirs = [ "tests" ]
511 sources = tests_sources - [
512 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only
513 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtklein4db3b792016-08-03 14:18:22 -0700514 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work
515 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work
mtklein2f3416d2016-08-02 16:02:05 -0700516 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
517 rebase_path("tests/skia_test.cpp"), # alternate main
518 ]
519 deps = [
520 ":flags",
521 ":gpu_tool_utils",
522 ":skia",
523 ":tool_utils",
524 "//third_party/libpng",
525 "//third_party/zlib",
526 ]
527}
528
mtklein2b6870c2016-07-28 14:17:33 -0700529bench_sources = exec_script("gyp/find.py",
530 [
mtklein2b6870c2016-07-28 14:17:33 -0700531 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700532 rebase_path("bench"),
mtklein2b6870c2016-07-28 14:17:33 -0700533 ],
534 "list lines",
535 [])
mtklein25c81d42016-07-27 13:55:26 -0700536
mtklein2b6870c2016-07-28 14:17:33 -0700537test_lib("bench") {
538 public_include_dirs = [ "bench" ]
539 sources = bench_sources
540 sources -= [
541 rebase_path("bench/nanobench.cpp"),
542 rebase_path("bench/nanobenchAndroid.cpp"),
543 ]
544 deps = [
545 ":flags",
546 ":gm",
547 ":gpu_tool_utils",
548 ":skia",
549 ":tool_utils",
550 ]
551}
552
fmalitaa2b9fdf2016-08-03 19:53:36 -0700553test_lib("experimental_svg_model") {
554 public_include_dirs = [ "experimental/svg/model" ]
555 sources = [
556 "experimental/svg/model/SkSVGAttribute.cpp",
557 "experimental/svg/model/SkSVGAttributeParser.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700558 "experimental/svg/model/SkSVGCircle.cpp",
anmittala7eaf2e2016-08-17 13:57:26 -0700559 "experimental/svg/model/SkSVGContainer.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700560 "experimental/svg/model/SkSVGDOM.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700561 "experimental/svg/model/SkSVGEllipse.cpp",
fmalitad24ee142016-08-17 08:38:15 -0700562 "experimental/svg/model/SkSVGLine.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700563 "experimental/svg/model/SkSVGNode.cpp",
564 "experimental/svg/model/SkSVGPath.cpp",
fmalita5b31f322016-08-12 12:15:33 -0700565 "experimental/svg/model/SkSVGPoly.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700566 "experimental/svg/model/SkSVGRect.cpp",
567 "experimental/svg/model/SkSVGRenderContext.cpp",
568 "experimental/svg/model/SkSVGSVG.cpp",
569 "experimental/svg/model/SkSVGShape.cpp",
570 "experimental/svg/model/SkSVGTransformableNode.cpp",
571 "experimental/svg/model/SkSVGValue.cpp",
572 ]
573 deps = [
574 ":skia",
575 ]
576}
577
mtklein2b6870c2016-07-28 14:17:33 -0700578if (!is_component_build) { # Our test tools use many non-SK_API APIs...
579 executable("dm") {
580 sources = [
581 "dm/DM.cpp",
582 "dm/DMJsonWriter.cpp",
583 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700584 ]
585 include_dirs = [ "tests" ]
586 deps = [
fmalitaa2b9fdf2016-08-03 19:53:36 -0700587 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700588 ":flags",
589 ":gm",
590 ":gpu_tool_utils",
591 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700592 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700593 ":tool_utils",
594 "//third_party/jsoncpp",
595 "//third_party/libpng",
596 ]
597 testonly = true
598 }
599
600 executable("monobench") {
601 sources = [
602 "tools/monobench.cpp",
603 ]
604 deps = [
605 ":bench",
606 ":skia",
607 ]
608 testonly = true
609 }
610
611 executable("nanobench") {
612 sources = [
613 "bench/nanobench.cpp",
614 ]
615 deps = [
616 ":bench",
617 ":flags",
618 ":gm",
619 ":gpu_tool_utils",
620 ":skia",
621 ":tool_utils",
622 "//third_party/jsoncpp",
623 ]
624 testonly = true
625 }
halcanary19a97202016-08-03 15:08:04 -0700626
627 executable("sktexttopdf") {
628 sources = [
629 "tools/SkShaper_harfbuzz.cpp",
630 "tools/using_skia_and_harfbuzz.cpp",
631 ]
632 deps = [
633 ":skia",
634 "//third_party/harfbuzz",
635 ]
636 testonly = true
637 }
mtklein25c81d42016-07-27 13:55:26 -0700638}