blob: 1f43ca1c5892f0246750d64f8f8de0d62d922165 [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
mtklein422310d2016-08-16 18:28:43 -0700147is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700148
mtklein422310d2016-08-16 18:28:43 -0700149if (is_x86) {
150 source_set("opts_sse2") {
151 configs += skia_library_configs
152 sources = opts_gypi.sse2_sources
153 cflags = [ "-msse2" ]
154 }
mtkleinc04ff472016-06-23 10:29:30 -0700155
mtklein422310d2016-08-16 18:28:43 -0700156 source_set("opts_ssse3") {
157 configs += skia_library_configs
158 sources = opts_gypi.ssse3_sources
159 cflags = [ "-mssse3" ]
160 }
mtkleinc04ff472016-06-23 10:29:30 -0700161
mtklein422310d2016-08-16 18:28:43 -0700162 source_set("opts_sse41") {
163 configs += skia_library_configs
164 sources = opts_gypi.sse41_sources
165 cflags = [ "-msse4.1" ]
166 }
mtkleinc04ff472016-06-23 10:29:30 -0700167
mtklein422310d2016-08-16 18:28:43 -0700168 source_set("opts_sse42") {
169 configs += skia_library_configs
170 sources = opts_gypi.sse42_sources
171 cflags = [ "-msse4.2" ]
172 }
mtklein4e976072016-08-08 09:06:27 -0700173
mtklein422310d2016-08-16 18:28:43 -0700174 source_set("opts_avx") {
175 configs += skia_library_configs
176 sources = opts_gypi.avx_sources
177 cflags = [ "-mavx" ]
178 }
mtkleinc04ff472016-06-23 10:29:30 -0700179}
180
181component("skia") {
182 public_configs = [ ":skia_public" ]
183 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700184
185 deps = [
mtklein25c81d42016-07-27 13:55:26 -0700186 "//third_party/expat",
187 "//third_party/giflib",
mtklein7d10b9f2016-07-27 11:17:18 -0700188 "//third_party/libjpeg_turbo",
189 "//third_party/libpng",
mtklein25c81d42016-07-27 13:55:26 -0700190 "//third_party/libwebp",
halcanary19a97202016-08-03 15:08:04 -0700191 "//third_party/sfntly",
abarth6fc8ff02016-07-15 15:15:15 -0700192 "//third_party/zlib",
mtkleinc04ff472016-06-23 10:29:30 -0700193 ]
mtklein422310d2016-08-16 18:28:43 -0700194 if (is_x86) {
195 deps += [
196 ":opts_avx",
197 ":opts_sse2",
198 ":opts_sse41",
199 ":opts_sse42",
200 ":opts_ssse3",
201 ]
202 }
mtkleinc04ff472016-06-23 10:29:30 -0700203
mtklein7a1f45f2016-08-04 06:19:33 -0700204 if (!is_win) {
205 libs = [ "pthread" ]
206 }
mtkleinc04ff472016-06-23 10:29:30 -0700207
208 sources = []
209 sources += core_gypi.sources
210 sources += effects_gypi.sources
211 sources += gpu_gypi.skgpu_sources
mtkleinc04ff472016-06-23 10:29:30 -0700212 sources += pdf_gypi.sources
213 sources += utils_gypi.sources
214 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700215 "src/android/SkBitmapRegionCodec.cpp",
216 "src/android/SkBitmapRegionDecoder.cpp",
217 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700218 "src/codec/SkBmpCodec.cpp",
219 "src/codec/SkBmpMaskCodec.cpp",
220 "src/codec/SkBmpRLECodec.cpp",
221 "src/codec/SkBmpStandardCodec.cpp",
222 "src/codec/SkCodec.cpp",
223 "src/codec/SkCodecImageGenerator.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700224 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700225 "src/codec/SkIcoCodec.cpp",
226 "src/codec/SkJpegCodec.cpp",
227 "src/codec/SkJpegDecoderMgr.cpp",
228 "src/codec/SkJpegUtility.cpp",
229 "src/codec/SkMaskSwizzler.cpp",
230 "src/codec/SkMasks.cpp",
231 "src/codec/SkPngCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700232 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700233 "src/codec/SkSampler.cpp",
234 "src/codec/SkSwizzler.cpp",
235 "src/codec/SkWbmpCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700236 "src/codec/SkWebpAdapterCodec.cpp",
237 "src/codec/SkWebpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700238 "src/images/SkImageEncoder.cpp",
239 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700240 "src/images/SkJPEGImageEncoder.cpp",
241 "src/images/SkJPEGWriteUtility.cpp",
242 "src/images/SkKTXImageEncoder.cpp",
243 "src/images/SkPNGImageEncoder.cpp",
244 "src/images/SkWEBPImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700245 "src/ports/SkDiscardableMemory_none.cpp",
246 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700247 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700248 "src/ports/SkMemory_malloc.cpp",
249 "src/ports/SkOSFile_stdio.cpp",
250 "src/sfnt/SkOTTable_name.cpp",
251 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700252 "src/svg/SkSVGCanvas.cpp",
253 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700254 "src/utils/mac/SkStream_mac.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700255 "src/xml/SkDOM.cpp",
256 "src/xml/SkXMLParser.cpp",
257 "src/xml/SkXMLWriter.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700258 "third_party/etc1/etc1.cpp",
259 "third_party/ktx/ktx.cpp",
260 ]
261
262 if (is_win) {
263 sources += [
264 "src/ports/SkDebug_win.cpp",
265 "src/ports/SkFontHost_win.cpp",
266 "src/ports/SkFontMgr_win_dw.cpp",
267 "src/ports/SkFontMgr_win_dw_factory.cpp",
268 "src/ports/SkImageEncoder_WIC.cpp",
269 "src/ports/SkImageGeneratorWIC.cpp",
270 "src/ports/SkOSFile_win.cpp",
271 "src/ports/SkScalerContext_win_dw.cpp",
272 "src/ports/SkTLS_win.cpp",
273 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700274 "src/xps/SkDocument_XPS.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700275 ]
mtklein7a1f45f2016-08-04 06:19:33 -0700276 sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700277 } else {
278 sources += [
279 "src/ports/SkDebug_stdio.cpp",
280 "src/ports/SkOSFile_posix.cpp",
281 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700282 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700283 ]
284 }
285
286 if (is_linux) {
287 deps += [
288 "third_party:fontconfig",
289 "third_party:freetype2",
mtkleinc04ff472016-06-23 10:29:30 -0700290 ]
291 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700292 "src/ports/SkFontConfigInterface_direct.cpp",
293 "src/ports/SkFontConfigInterface_direct_factory.cpp",
294 "src/ports/SkFontHost_FreeType.cpp",
295 "src/ports/SkFontHost_FreeType_common.cpp",
bungeman7d0e3bc2016-08-02 07:07:33 -0700296 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein7a34b1c2016-08-01 13:08:46 -0700297 "src/ports/SkFontMgr_fontconfig.cpp",
298 "src/ports/SkFontMgr_fontconfig_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700299 ]
300 }
301
302 if (is_mac) {
303 sources += [
304 "src/ports/SkFontHost_mac.cpp",
305 "src/ports/SkImageEncoder_CG.cpp",
306 "src/ports/SkImageGeneratorCG.cpp",
307 ]
308 libs += [ "ApplicationServices.framework" ]
309 }
abarth6fc8ff02016-07-15 15:15:15 -0700310
311 if (is_fuchsia) {
mtkleine817ddf2016-07-19 06:03:22 -0700312 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700313 }
mtkleinc04ff472016-06-23 10:29:30 -0700314}
315
mtkleinada5a442016-08-02 14:28:26 -0700316skia_h_headers = exec_script("gyp/find.py",
317 [ "*.h" ] + rebase_path(skia_public_includes),
318 "list lines",
319 []) -
320 [
321 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
322 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
323 rebase_path("include/gpu/vk/GrVkDefines.h"),
324 rebase_path("include/gpu/vk/GrVkInterface.h"),
325 rebase_path("include/gpu/vk/GrVkTypes.h"),
326 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
327 ]
328
mtklein1211e0c2016-07-26 13:55:45 -0700329action("skia.h") {
330 script = "gn/echo_headers.py"
331 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinada5a442016-08-02 14:28:26 -0700332 rebase_path(skia_h_headers, root_build_dir)
mtklein1211e0c2016-07-26 13:55:45 -0700333 outputs = [
334 "$target_gen_dir/skia.h",
335 ]
336}
337
338executable("fiddle") {
339 include_dirs = [ "$target_gen_dir" ]
mtklein7d10b9f2016-07-27 11:17:18 -0700340 libs = []
341 if (is_linux) {
342 libs += [ "OSMesa" ]
343 }
mtklein1211e0c2016-07-26 13:55:45 -0700344
mtkleinc04ff472016-06-23 10:29:30 -0700345 sources = [
mtklein1211e0c2016-07-26 13:55:45 -0700346 "tools/fiddle/draw.cpp",
347 "tools/fiddle/fiddle_main.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700348 ]
349 deps = [
350 ":skia",
mtklein1211e0c2016-07-26 13:55:45 -0700351 ":skia.h",
mtklein5dbd2742016-08-02 11:13:48 -0700352 ":tool_utils",
mtkleinc04ff472016-06-23 10:29:30 -0700353 ]
mtklein5dbd2742016-08-02 11:13:48 -0700354 testonly = true
mtkleinc04ff472016-06-23 10:29:30 -0700355}
mtklein25c81d42016-07-27 13:55:26 -0700356
357template("test_lib") {
358 config(target_name + "_config") {
359 include_dirs = invoker.public_include_dirs
360 }
361 source_set(target_name) {
362 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
363 public_configs = [
364 ":" + target_name + "_config",
365 ":skia_private",
366 ]
367
368 if (!defined(deps)) {
369 deps = []
370 }
371 deps += [ ":skia" ]
372 testonly = true
373 }
374}
375
376test_lib("gpu_tool_utils") {
377 public_include_dirs = [ "tools/gpu" ]
378 sources = [
379 "tools/gpu/GrContextFactory.cpp",
380 "tools/gpu/GrTest.cpp",
381 "tools/gpu/TestContext.cpp",
382 "tools/gpu/gl/GLTestContext.cpp",
383 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
384 "tools/gpu/gl/debug/GrBufferObj.cpp",
385 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
386 "tools/gpu/gl/debug/GrProgramObj.cpp",
387 "tools/gpu/gl/debug/GrShaderObj.cpp",
388 "tools/gpu/gl/debug/GrTextureObj.cpp",
389 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
390 "tools/gpu/gl/null/NullGLTestContext.cpp",
391 ]
392 libs = []
393
394 if (is_linux) {
mtklein5259da52016-08-03 08:28:20 -0700395 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700396 "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp",
397 "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp",
mtklein5259da52016-08-03 08:28:20 -0700398 ]
mtklein25c81d42016-07-27 13:55:26 -0700399 libs += [
400 "GL",
401 "GLU",
402 "X11",
403 ]
404 } else if (is_mac) {
mtklein5259da52016-08-03 08:28:20 -0700405 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700406 "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp",
407 "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp",
mtklein5259da52016-08-03 08:28:20 -0700408 ]
mtklein25c81d42016-07-27 13:55:26 -0700409 libs += [ "OpenGL.framework" ]
410 }
411}
412
413test_lib("flags") {
414 public_include_dirs = [ "tools/flags" ]
415 sources = [
416 "tools/flags/SkCommandLineFlags.cpp",
417 "tools/flags/SkCommonFlags.cpp",
418 "tools/flags/SkCommonFlagsConfig.cpp",
419 ]
420 deps = [
421 ":gpu_tool_utils",
422 ]
423}
424
425test_lib("tool_utils") {
426 public_include_dirs = [
427 "tools",
mtklein2f3416d2016-08-02 16:02:05 -0700428 "tools/debugger",
mtklein25c81d42016-07-27 13:55:26 -0700429 "tools/timer",
430 ]
431 sources = [
mtklein2b6870c2016-07-28 14:17:33 -0700432 "src/images/SkForceLinking.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700433 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtklein2b6870c2016-07-28 14:17:33 -0700434 "tools/CrashHandler.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700435 "tools/ProcStats.cpp",
436 "tools/Resources.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700437 "tools/ThermalManager.cpp",
mtklein2f3416d2016-08-02 16:02:05 -0700438 "tools/UrlDataManager.cpp",
439 "tools/debugger/SkDebugCanvas.cpp",
440 "tools/debugger/SkDrawCommand.cpp",
441 "tools/debugger/SkJsonWriteBuffer.cpp",
442 "tools/debugger/SkObjectParser.cpp",
443 "tools/debugger/SkOverdrawMode.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700444 "tools/picture_utils.cpp",
445 "tools/random_parse_path.cpp",
446 "tools/sk_tool_utils.cpp",
447 "tools/sk_tool_utils_font.cpp",
448 "tools/timer/Timer.cpp",
449 ]
450 deps = [
451 ":flags",
mtklein2f3416d2016-08-02 16:02:05 -0700452 "//third_party/libpng",
453 ]
454 public_deps = [
455 "//third_party/jsoncpp",
mtklein25c81d42016-07-27 13:55:26 -0700456 ]
457}
458
459gm_sources = exec_script("gyp/find.py",
460 [
mtklein25c81d42016-07-27 13:55:26 -0700461 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700462 rebase_path("gm"),
mtklein25c81d42016-07-27 13:55:26 -0700463 ],
464 "list lines",
465 [])
466test_lib("gm") {
467 public_include_dirs = [ "gm" ]
468 sources = gm_sources
469 deps = [
470 ":gpu_tool_utils",
471 ":skia",
472 ":tool_utils",
473 ]
474}
475
mtklein2f3416d2016-08-02 16:02:05 -0700476tests_sources = exec_script("gyp/find.py",
477 [
478 "*.c*",
479 rebase_path("tests"),
480 ],
481 "list lines",
482 [])
483
484test_lib("tests") {
485 public_include_dirs = [ "tests" ]
486 sources = tests_sources - [
487 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only
488 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtklein4db3b792016-08-03 14:18:22 -0700489 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work
490 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work
mtklein2f3416d2016-08-02 16:02:05 -0700491 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
492 rebase_path("tests/skia_test.cpp"), # alternate main
493 ]
494 deps = [
495 ":flags",
496 ":gpu_tool_utils",
497 ":skia",
498 ":tool_utils",
499 "//third_party/libpng",
500 "//third_party/zlib",
501 ]
502}
503
mtklein2b6870c2016-07-28 14:17:33 -0700504bench_sources = exec_script("gyp/find.py",
505 [
mtklein2b6870c2016-07-28 14:17:33 -0700506 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700507 rebase_path("bench"),
mtklein2b6870c2016-07-28 14:17:33 -0700508 ],
509 "list lines",
510 [])
mtklein25c81d42016-07-27 13:55:26 -0700511
mtklein2b6870c2016-07-28 14:17:33 -0700512test_lib("bench") {
513 public_include_dirs = [ "bench" ]
514 sources = bench_sources
515 sources -= [
516 rebase_path("bench/nanobench.cpp"),
517 rebase_path("bench/nanobenchAndroid.cpp"),
518 ]
519 deps = [
520 ":flags",
521 ":gm",
522 ":gpu_tool_utils",
523 ":skia",
524 ":tool_utils",
525 ]
526}
527
fmalitaa2b9fdf2016-08-03 19:53:36 -0700528test_lib("experimental_svg_model") {
529 public_include_dirs = [ "experimental/svg/model" ]
530 sources = [
531 "experimental/svg/model/SkSVGAttribute.cpp",
532 "experimental/svg/model/SkSVGAttributeParser.cpp",
533 "experimental/svg/model/SkSVGContainer.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700534 "experimental/svg/model/SkSVGCircle.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700535 "experimental/svg/model/SkSVGDOM.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700536 "experimental/svg/model/SkSVGEllipse.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700537 "experimental/svg/model/SkSVGNode.cpp",
538 "experimental/svg/model/SkSVGPath.cpp",
fmalita5b31f322016-08-12 12:15:33 -0700539 "experimental/svg/model/SkSVGPoly.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700540 "experimental/svg/model/SkSVGRect.cpp",
541 "experimental/svg/model/SkSVGRenderContext.cpp",
542 "experimental/svg/model/SkSVGSVG.cpp",
543 "experimental/svg/model/SkSVGShape.cpp",
544 "experimental/svg/model/SkSVGTransformableNode.cpp",
545 "experimental/svg/model/SkSVGValue.cpp",
546 ]
547 deps = [
548 ":skia",
549 ]
550}
551
mtklein2b6870c2016-07-28 14:17:33 -0700552if (!is_component_build) { # Our test tools use many non-SK_API APIs...
553 executable("dm") {
554 sources = [
555 "dm/DM.cpp",
556 "dm/DMJsonWriter.cpp",
557 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700558 ]
559 include_dirs = [ "tests" ]
560 deps = [
fmalitaa2b9fdf2016-08-03 19:53:36 -0700561 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700562 ":flags",
563 ":gm",
564 ":gpu_tool_utils",
565 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700566 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700567 ":tool_utils",
568 "//third_party/jsoncpp",
569 "//third_party/libpng",
570 ]
571 testonly = true
572 }
573
574 executable("monobench") {
575 sources = [
576 "tools/monobench.cpp",
577 ]
578 deps = [
579 ":bench",
580 ":skia",
581 ]
582 testonly = true
583 }
584
585 executable("nanobench") {
586 sources = [
587 "bench/nanobench.cpp",
588 ]
589 deps = [
590 ":bench",
591 ":flags",
592 ":gm",
593 ":gpu_tool_utils",
594 ":skia",
595 ":tool_utils",
596 "//third_party/jsoncpp",
597 ]
598 testonly = true
599 }
halcanary19a97202016-08-03 15:08:04 -0700600
601 executable("sktexttopdf") {
602 sources = [
603 "tools/SkShaper_harfbuzz.cpp",
604 "tools/using_skia_and_harfbuzz.cpp",
605 ]
606 deps = [
607 ":skia",
608 "//third_party/harfbuzz",
609 ]
610 testonly = true
611 }
mtklein25c81d42016-07-27 13:55:26 -0700612}