blob: 692d0ba1be2c1d00f2de68689218ff55fe821399 [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\"",
mtklein150d1132016-08-01 06:56:40 -070071 ]
mtkleinee269f42016-08-04 09:52:11 -070072 if (is_linux) {
73 defines += [ "SK_SAMPLES_FOR_X" ]
74 }
mtkleinc04ff472016-06-23 10:29:30 -070075}
76
77# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
78config("skia_library") {
79 visibility = [ ":*" ]
mtkleinc04ff472016-06-23 10:29:30 -070080 defines = [ "SKIA_IMPLEMENTATION=1" ]
81}
82
83skia_library_configs = [
84 ":skia_public",
85 ":skia_private",
86 ":skia_library",
87]
88
mtklein7fbfbbe2016-07-21 12:25:45 -070089core_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -070090 [
91 rebase_path("gyp/core.gypi"),
92 "--replace=<(skia_include_path)=include",
93 "--replace=<(skia_src_path)=src",
94 ],
95 "scope",
96 [ "gyp/core.gypi" ])
97
mtklein7fbfbbe2016-07-21 12:25:45 -070098effects_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -070099 [
100 rebase_path("gyp/effects.gypi"),
101 "--replace=<(skia_include_path)=include",
102 "--replace=<(skia_src_path)=src",
103 ],
104 "scope",
105 [ "gyp/effects.gypi" ])
106
mtklein7fbfbbe2016-07-21 12:25:45 -0700107gpu_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700108 [
109 rebase_path("gyp/gpu.gypi"),
110 "--replace=<(skia_include_path)=include",
111 "--replace=<(skia_src_path)=src",
112 ],
113 "scope",
114 [ "gyp/gpu.gypi" ])
115
mtklein7fbfbbe2016-07-21 12:25:45 -0700116opts_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700117 [
118 rebase_path("gyp/opts.gypi"),
119 "--replace=<(skia_include_path)=include",
120 "--replace=<(skia_src_path)=src",
121 ],
122 "scope",
123 [ "gyp/opts.gypi" ])
124
mtklein7fbfbbe2016-07-21 12:25:45 -0700125pdf_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700126 [
127 rebase_path("gyp/pdf.gypi"),
128 "--replace=<(skia_include_path)=include",
129 "--replace=<(skia_src_path)=src",
130 ],
131 "scope",
132 [ "gyp/pdf.gypi" ])
133
mtklein7fbfbbe2016-07-21 12:25:45 -0700134utils_gypi = exec_script("gn/gypi_to_gn.py",
mtkleinc04ff472016-06-23 10:29:30 -0700135 [
136 rebase_path("gyp/utils.gypi"),
137 "--replace=<(skia_include_path)=include",
138 "--replace=<(skia_src_path)=src",
139 ],
140 "scope",
141 [ "gyp/utils.gypi" ])
142
anmittala7eaf2e2016-08-17 13:57:26 -0700143source_set("opts_none") {
144 configs += skia_library_configs
145 sources = opts_gypi.none_sources
146}
147
mtklein422310d2016-08-16 18:28:43 -0700148is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700149
mtklein422310d2016-08-16 18:28:43 -0700150if (is_x86) {
151 source_set("opts_sse2") {
152 configs += skia_library_configs
153 sources = opts_gypi.sse2_sources
154 cflags = [ "-msse2" ]
155 }
mtkleinc04ff472016-06-23 10:29:30 -0700156
mtklein422310d2016-08-16 18:28:43 -0700157 source_set("opts_ssse3") {
158 configs += skia_library_configs
159 sources = opts_gypi.ssse3_sources
160 cflags = [ "-mssse3" ]
161 }
mtkleinc04ff472016-06-23 10:29:30 -0700162
mtklein422310d2016-08-16 18:28:43 -0700163 source_set("opts_sse41") {
164 configs += skia_library_configs
165 sources = opts_gypi.sse41_sources
166 cflags = [ "-msse4.1" ]
167 }
mtkleinc04ff472016-06-23 10:29:30 -0700168
mtklein422310d2016-08-16 18:28:43 -0700169 source_set("opts_sse42") {
170 configs += skia_library_configs
171 sources = opts_gypi.sse42_sources
172 cflags = [ "-msse4.2" ]
173 }
mtklein4e976072016-08-08 09:06:27 -0700174
mtklein422310d2016-08-16 18:28:43 -0700175 source_set("opts_avx") {
176 configs += skia_library_configs
177 sources = opts_gypi.avx_sources
178 cflags = [ "-mavx" ]
179 }
mtkleinc04ff472016-06-23 10:29:30 -0700180}
181
mtkleineb3c4252016-08-23 07:38:09 -0700182if (skia_use_libwebp) {
183 config("webp_config") {
184 defines = [ "SK_HAS_WEBP_LIBRARY" ]
185 }
186 source_set("webp") {
187 configs += skia_library_configs
188 all_dependent_configs = [ ":webp_config" ]
189 deps = [
190 "//third_party/libwebp",
191 ]
192 sources = [
193 "src/codec/SkWebpAdapterCodec.cpp",
194 "src/codec/SkWebpCodec.cpp",
195 "src/images/SkWEBPImageEncoder.cpp",
196 ]
197 }
198} else {
199 source_set("webp") {
200 }
201}
202
mtkleinc04ff472016-06-23 10:29:30 -0700203component("skia") {
204 public_configs = [ ":skia_public" ]
205 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700206
207 deps = [
mtkleineb3c4252016-08-23 07:38:09 -0700208 ":webp",
mtklein25c81d42016-07-27 13:55:26 -0700209 "//third_party/expat",
210 "//third_party/giflib",
mtklein0a8efd72016-08-22 06:32:39 -0700211 "//third_party/libjpeg-turbo:libjpeg",
mtklein7d10b9f2016-07-27 11:17:18 -0700212 "//third_party/libpng",
halcanary19a97202016-08-03 15:08:04 -0700213 "//third_party/sfntly",
abarth6fc8ff02016-07-15 15:15:15 -0700214 "//third_party/zlib",
mtkleinc04ff472016-06-23 10:29:30 -0700215 ]
mtklein422310d2016-08-16 18:28:43 -0700216 if (is_x86) {
217 deps += [
218 ":opts_avx",
219 ":opts_sse2",
220 ":opts_sse41",
221 ":opts_sse42",
222 ":opts_ssse3",
223 ]
anmittala7eaf2e2016-08-17 13:57:26 -0700224 } else {
225 deps += [ ":opts_none" ]
mtklein422310d2016-08-16 18:28:43 -0700226 }
mtkleinc04ff472016-06-23 10:29:30 -0700227
mtklein7a1f45f2016-08-04 06:19:33 -0700228 if (!is_win) {
229 libs = [ "pthread" ]
230 }
mtkleinc04ff472016-06-23 10:29:30 -0700231
232 sources = []
233 sources += core_gypi.sources
234 sources += effects_gypi.sources
235 sources += gpu_gypi.skgpu_sources
mtkleinc04ff472016-06-23 10:29:30 -0700236 sources += pdf_gypi.sources
237 sources += utils_gypi.sources
238 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700239 "src/android/SkBitmapRegionCodec.cpp",
240 "src/android/SkBitmapRegionDecoder.cpp",
241 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700242 "src/codec/SkBmpCodec.cpp",
243 "src/codec/SkBmpMaskCodec.cpp",
244 "src/codec/SkBmpRLECodec.cpp",
245 "src/codec/SkBmpStandardCodec.cpp",
246 "src/codec/SkCodec.cpp",
247 "src/codec/SkCodecImageGenerator.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700248 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700249 "src/codec/SkIcoCodec.cpp",
250 "src/codec/SkJpegCodec.cpp",
251 "src/codec/SkJpegDecoderMgr.cpp",
252 "src/codec/SkJpegUtility.cpp",
253 "src/codec/SkMaskSwizzler.cpp",
254 "src/codec/SkMasks.cpp",
255 "src/codec/SkPngCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700256 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700257 "src/codec/SkSampler.cpp",
258 "src/codec/SkSwizzler.cpp",
259 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700260 "src/images/SkImageEncoder.cpp",
261 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700262 "src/images/SkJPEGImageEncoder.cpp",
263 "src/images/SkJPEGWriteUtility.cpp",
264 "src/images/SkKTXImageEncoder.cpp",
265 "src/images/SkPNGImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700266 "src/ports/SkDiscardableMemory_none.cpp",
267 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700268 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700269 "src/ports/SkMemory_malloc.cpp",
270 "src/ports/SkOSFile_stdio.cpp",
271 "src/sfnt/SkOTTable_name.cpp",
272 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700273 "src/svg/SkSVGCanvas.cpp",
274 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700275 "src/utils/mac/SkStream_mac.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700276 "src/xml/SkDOM.cpp",
277 "src/xml/SkXMLParser.cpp",
278 "src/xml/SkXMLWriter.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700279 "third_party/etc1/etc1.cpp",
280 "third_party/ktx/ktx.cpp",
281 ]
282
283 if (is_win) {
284 sources += [
285 "src/ports/SkDebug_win.cpp",
286 "src/ports/SkFontHost_win.cpp",
287 "src/ports/SkFontMgr_win_dw.cpp",
288 "src/ports/SkFontMgr_win_dw_factory.cpp",
289 "src/ports/SkImageEncoder_WIC.cpp",
290 "src/ports/SkImageGeneratorWIC.cpp",
291 "src/ports/SkOSFile_win.cpp",
292 "src/ports/SkScalerContext_win_dw.cpp",
293 "src/ports/SkTLS_win.cpp",
294 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700295 "src/xps/SkDocument_XPS.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700296 ]
mtklein7a1f45f2016-08-04 06:19:33 -0700297 sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700298 } else {
299 sources += [
300 "src/ports/SkDebug_stdio.cpp",
301 "src/ports/SkOSFile_posix.cpp",
302 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700303 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700304 ]
305 }
306
307 if (is_linux) {
308 deps += [
309 "third_party:fontconfig",
310 "third_party:freetype2",
mtkleinc04ff472016-06-23 10:29:30 -0700311 ]
312 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700313 "src/ports/SkFontConfigInterface_direct.cpp",
314 "src/ports/SkFontConfigInterface_direct_factory.cpp",
315 "src/ports/SkFontHost_FreeType.cpp",
316 "src/ports/SkFontHost_FreeType_common.cpp",
bungeman7d0e3bc2016-08-02 07:07:33 -0700317 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein7a34b1c2016-08-01 13:08:46 -0700318 "src/ports/SkFontMgr_fontconfig.cpp",
319 "src/ports/SkFontMgr_fontconfig_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700320 ]
321 }
322
323 if (is_mac) {
324 sources += [
325 "src/ports/SkFontHost_mac.cpp",
326 "src/ports/SkImageEncoder_CG.cpp",
327 "src/ports/SkImageGeneratorCG.cpp",
328 ]
329 libs += [ "ApplicationServices.framework" ]
330 }
abarth6fc8ff02016-07-15 15:15:15 -0700331
332 if (is_fuchsia) {
mtkleine817ddf2016-07-19 06:03:22 -0700333 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700334 }
mtkleinc04ff472016-06-23 10:29:30 -0700335}
336
mtkleinada5a442016-08-02 14:28:26 -0700337skia_h_headers = exec_script("gyp/find.py",
338 [ "*.h" ] + rebase_path(skia_public_includes),
339 "list lines",
340 []) -
341 [
342 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
343 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
344 rebase_path("include/gpu/vk/GrVkDefines.h"),
345 rebase_path("include/gpu/vk/GrVkInterface.h"),
346 rebase_path("include/gpu/vk/GrVkTypes.h"),
347 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
348 ]
349
mtklein1211e0c2016-07-26 13:55:45 -0700350action("skia.h") {
351 script = "gn/echo_headers.py"
352 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinada5a442016-08-02 14:28:26 -0700353 rebase_path(skia_h_headers, root_build_dir)
mtklein1211e0c2016-07-26 13:55:45 -0700354 outputs = [
355 "$target_gen_dir/skia.h",
356 ]
357}
358
359executable("fiddle") {
360 include_dirs = [ "$target_gen_dir" ]
mtklein7d10b9f2016-07-27 11:17:18 -0700361 libs = []
362 if (is_linux) {
363 libs += [ "OSMesa" ]
364 }
mtklein1211e0c2016-07-26 13:55:45 -0700365
mtkleinc04ff472016-06-23 10:29:30 -0700366 sources = [
mtklein1211e0c2016-07-26 13:55:45 -0700367 "tools/fiddle/draw.cpp",
368 "tools/fiddle/fiddle_main.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700369 ]
370 deps = [
371 ":skia",
mtklein1211e0c2016-07-26 13:55:45 -0700372 ":skia.h",
mtklein5dbd2742016-08-02 11:13:48 -0700373 ":tool_utils",
mtkleinc04ff472016-06-23 10:29:30 -0700374 ]
mtklein5dbd2742016-08-02 11:13:48 -0700375 testonly = true
mtkleinc04ff472016-06-23 10:29:30 -0700376}
mtklein25c81d42016-07-27 13:55:26 -0700377
378template("test_lib") {
379 config(target_name + "_config") {
380 include_dirs = invoker.public_include_dirs
381 }
382 source_set(target_name) {
383 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
384 public_configs = [
385 ":" + target_name + "_config",
386 ":skia_private",
387 ]
388
389 if (!defined(deps)) {
390 deps = []
391 }
392 deps += [ ":skia" ]
393 testonly = true
394 }
395}
396
397test_lib("gpu_tool_utils") {
398 public_include_dirs = [ "tools/gpu" ]
399 sources = [
400 "tools/gpu/GrContextFactory.cpp",
401 "tools/gpu/GrTest.cpp",
402 "tools/gpu/TestContext.cpp",
403 "tools/gpu/gl/GLTestContext.cpp",
404 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
405 "tools/gpu/gl/debug/GrBufferObj.cpp",
406 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
407 "tools/gpu/gl/debug/GrProgramObj.cpp",
408 "tools/gpu/gl/debug/GrShaderObj.cpp",
409 "tools/gpu/gl/debug/GrTextureObj.cpp",
410 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
411 "tools/gpu/gl/null/NullGLTestContext.cpp",
412 ]
413 libs = []
414
415 if (is_linux) {
mtklein5259da52016-08-03 08:28:20 -0700416 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700417 "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp",
418 "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp",
mtklein5259da52016-08-03 08:28:20 -0700419 ]
mtklein25c81d42016-07-27 13:55:26 -0700420 libs += [
421 "GL",
422 "GLU",
423 "X11",
424 ]
425 } else if (is_mac) {
mtklein5259da52016-08-03 08:28:20 -0700426 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700427 "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp",
428 "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp",
mtklein5259da52016-08-03 08:28:20 -0700429 ]
mtklein25c81d42016-07-27 13:55:26 -0700430 libs += [ "OpenGL.framework" ]
431 }
432}
433
434test_lib("flags") {
435 public_include_dirs = [ "tools/flags" ]
436 sources = [
437 "tools/flags/SkCommandLineFlags.cpp",
438 "tools/flags/SkCommonFlags.cpp",
439 "tools/flags/SkCommonFlagsConfig.cpp",
440 ]
441 deps = [
442 ":gpu_tool_utils",
443 ]
444}
445
446test_lib("tool_utils") {
447 public_include_dirs = [
448 "tools",
mtklein2f3416d2016-08-02 16:02:05 -0700449 "tools/debugger",
mtklein25c81d42016-07-27 13:55:26 -0700450 "tools/timer",
451 ]
452 sources = [
mtklein2b6870c2016-07-28 14:17:33 -0700453 "src/images/SkForceLinking.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700454 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtklein2b6870c2016-07-28 14:17:33 -0700455 "tools/CrashHandler.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700456 "tools/ProcStats.cpp",
457 "tools/Resources.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700458 "tools/ThermalManager.cpp",
mtklein2f3416d2016-08-02 16:02:05 -0700459 "tools/UrlDataManager.cpp",
460 "tools/debugger/SkDebugCanvas.cpp",
461 "tools/debugger/SkDrawCommand.cpp",
462 "tools/debugger/SkJsonWriteBuffer.cpp",
463 "tools/debugger/SkObjectParser.cpp",
464 "tools/debugger/SkOverdrawMode.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700465 "tools/picture_utils.cpp",
466 "tools/random_parse_path.cpp",
467 "tools/sk_tool_utils.cpp",
468 "tools/sk_tool_utils_font.cpp",
469 "tools/timer/Timer.cpp",
470 ]
471 deps = [
472 ":flags",
mtklein2f3416d2016-08-02 16:02:05 -0700473 "//third_party/libpng",
474 ]
475 public_deps = [
476 "//third_party/jsoncpp",
mtklein25c81d42016-07-27 13:55:26 -0700477 ]
478}
479
480gm_sources = exec_script("gyp/find.py",
481 [
mtklein25c81d42016-07-27 13:55:26 -0700482 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700483 rebase_path("gm"),
mtklein25c81d42016-07-27 13:55:26 -0700484 ],
485 "list lines",
486 [])
487test_lib("gm") {
488 public_include_dirs = [ "gm" ]
489 sources = gm_sources
490 deps = [
491 ":gpu_tool_utils",
492 ":skia",
493 ":tool_utils",
494 ]
495}
496
mtklein2f3416d2016-08-02 16:02:05 -0700497tests_sources = exec_script("gyp/find.py",
498 [
499 "*.c*",
500 rebase_path("tests"),
501 ],
502 "list lines",
503 [])
504
505test_lib("tests") {
506 public_include_dirs = [ "tests" ]
507 sources = tests_sources - [
508 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only
509 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtklein4db3b792016-08-03 14:18:22 -0700510 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work
511 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work
mtklein2f3416d2016-08-02 16:02:05 -0700512 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
513 rebase_path("tests/skia_test.cpp"), # alternate main
514 ]
515 deps = [
516 ":flags",
517 ":gpu_tool_utils",
518 ":skia",
519 ":tool_utils",
520 "//third_party/libpng",
521 "//third_party/zlib",
522 ]
523}
524
mtklein2b6870c2016-07-28 14:17:33 -0700525bench_sources = exec_script("gyp/find.py",
526 [
mtklein2b6870c2016-07-28 14:17:33 -0700527 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700528 rebase_path("bench"),
mtklein2b6870c2016-07-28 14:17:33 -0700529 ],
530 "list lines",
531 [])
mtklein25c81d42016-07-27 13:55:26 -0700532
mtklein2b6870c2016-07-28 14:17:33 -0700533test_lib("bench") {
534 public_include_dirs = [ "bench" ]
535 sources = bench_sources
536 sources -= [
537 rebase_path("bench/nanobench.cpp"),
538 rebase_path("bench/nanobenchAndroid.cpp"),
539 ]
540 deps = [
541 ":flags",
542 ":gm",
543 ":gpu_tool_utils",
544 ":skia",
545 ":tool_utils",
546 ]
547}
548
fmalitaa2b9fdf2016-08-03 19:53:36 -0700549test_lib("experimental_svg_model") {
550 public_include_dirs = [ "experimental/svg/model" ]
551 sources = [
552 "experimental/svg/model/SkSVGAttribute.cpp",
553 "experimental/svg/model/SkSVGAttributeParser.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700554 "experimental/svg/model/SkSVGCircle.cpp",
anmittala7eaf2e2016-08-17 13:57:26 -0700555 "experimental/svg/model/SkSVGContainer.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700556 "experimental/svg/model/SkSVGDOM.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700557 "experimental/svg/model/SkSVGEllipse.cpp",
fmalitad24ee142016-08-17 08:38:15 -0700558 "experimental/svg/model/SkSVGLine.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700559 "experimental/svg/model/SkSVGNode.cpp",
560 "experimental/svg/model/SkSVGPath.cpp",
fmalita5b31f322016-08-12 12:15:33 -0700561 "experimental/svg/model/SkSVGPoly.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700562 "experimental/svg/model/SkSVGRect.cpp",
563 "experimental/svg/model/SkSVGRenderContext.cpp",
564 "experimental/svg/model/SkSVGSVG.cpp",
565 "experimental/svg/model/SkSVGShape.cpp",
566 "experimental/svg/model/SkSVGTransformableNode.cpp",
567 "experimental/svg/model/SkSVGValue.cpp",
568 ]
569 deps = [
570 ":skia",
571 ]
572}
573
mtklein2b6870c2016-07-28 14:17:33 -0700574if (!is_component_build) { # Our test tools use many non-SK_API APIs...
575 executable("dm") {
576 sources = [
577 "dm/DM.cpp",
578 "dm/DMJsonWriter.cpp",
579 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700580 ]
581 include_dirs = [ "tests" ]
582 deps = [
fmalitaa2b9fdf2016-08-03 19:53:36 -0700583 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700584 ":flags",
585 ":gm",
586 ":gpu_tool_utils",
587 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700588 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700589 ":tool_utils",
590 "//third_party/jsoncpp",
591 "//third_party/libpng",
592 ]
593 testonly = true
594 }
595
596 executable("monobench") {
597 sources = [
598 "tools/monobench.cpp",
599 ]
600 deps = [
601 ":bench",
602 ":skia",
603 ]
604 testonly = true
605 }
606
607 executable("nanobench") {
608 sources = [
609 "bench/nanobench.cpp",
610 ]
611 deps = [
612 ":bench",
613 ":flags",
614 ":gm",
615 ":gpu_tool_utils",
616 ":skia",
617 ":tool_utils",
618 "//third_party/jsoncpp",
619 ]
620 testonly = true
621 }
halcanary19a97202016-08-03 15:08:04 -0700622
623 executable("sktexttopdf") {
624 sources = [
625 "tools/SkShaper_harfbuzz.cpp",
626 "tools/using_skia_and_harfbuzz.cpp",
627 ]
628 deps = [
629 ":skia",
630 "//third_party/harfbuzz",
631 ]
632 testonly = true
633 }
mtklein25c81d42016-07-27 13:55:26 -0700634}