blob: 1c1cfec26e7a548f08832cd4c63312b7e195fd75 [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
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
186component("skia") {
187 public_configs = [ ":skia_public" ]
188 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700189
190 deps = [
mtklein25c81d42016-07-27 13:55:26 -0700191 "//third_party/expat",
192 "//third_party/giflib",
mtklein7d10b9f2016-07-27 11:17:18 -0700193 "//third_party/libjpeg_turbo",
194 "//third_party/libpng",
mtklein25c81d42016-07-27 13:55:26 -0700195 "//third_party/libwebp",
halcanary19a97202016-08-03 15:08:04 -0700196 "//third_party/sfntly",
abarth6fc8ff02016-07-15 15:15:15 -0700197 "//third_party/zlib",
mtkleinc04ff472016-06-23 10:29:30 -0700198 ]
mtklein422310d2016-08-16 18:28:43 -0700199 if (is_x86) {
200 deps += [
201 ":opts_avx",
202 ":opts_sse2",
203 ":opts_sse41",
204 ":opts_sse42",
205 ":opts_ssse3",
206 ]
anmittala7eaf2e2016-08-17 13:57:26 -0700207 } else {
208 deps += [ ":opts_none" ]
mtklein422310d2016-08-16 18:28:43 -0700209 }
mtkleinc04ff472016-06-23 10:29:30 -0700210
mtklein7a1f45f2016-08-04 06:19:33 -0700211 if (!is_win) {
212 libs = [ "pthread" ]
213 }
mtkleinc04ff472016-06-23 10:29:30 -0700214
215 sources = []
216 sources += core_gypi.sources
217 sources += effects_gypi.sources
218 sources += gpu_gypi.skgpu_sources
mtkleinc04ff472016-06-23 10:29:30 -0700219 sources += pdf_gypi.sources
220 sources += utils_gypi.sources
221 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700222 "src/android/SkBitmapRegionCodec.cpp",
223 "src/android/SkBitmapRegionDecoder.cpp",
224 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700225 "src/codec/SkBmpCodec.cpp",
226 "src/codec/SkBmpMaskCodec.cpp",
227 "src/codec/SkBmpRLECodec.cpp",
228 "src/codec/SkBmpStandardCodec.cpp",
229 "src/codec/SkCodec.cpp",
230 "src/codec/SkCodecImageGenerator.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700231 "src/codec/SkGifCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700232 "src/codec/SkIcoCodec.cpp",
233 "src/codec/SkJpegCodec.cpp",
234 "src/codec/SkJpegDecoderMgr.cpp",
235 "src/codec/SkJpegUtility.cpp",
236 "src/codec/SkMaskSwizzler.cpp",
237 "src/codec/SkMasks.cpp",
238 "src/codec/SkPngCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700239 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700240 "src/codec/SkSampler.cpp",
241 "src/codec/SkSwizzler.cpp",
242 "src/codec/SkWbmpCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700243 "src/codec/SkWebpAdapterCodec.cpp",
244 "src/codec/SkWebpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700245 "src/images/SkImageEncoder.cpp",
246 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700247 "src/images/SkJPEGImageEncoder.cpp",
248 "src/images/SkJPEGWriteUtility.cpp",
249 "src/images/SkKTXImageEncoder.cpp",
250 "src/images/SkPNGImageEncoder.cpp",
251 "src/images/SkWEBPImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700252 "src/ports/SkDiscardableMemory_none.cpp",
253 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700254 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700255 "src/ports/SkMemory_malloc.cpp",
256 "src/ports/SkOSFile_stdio.cpp",
257 "src/sfnt/SkOTTable_name.cpp",
258 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700259 "src/svg/SkSVGCanvas.cpp",
260 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700261 "src/utils/mac/SkStream_mac.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700262 "src/xml/SkDOM.cpp",
263 "src/xml/SkXMLParser.cpp",
264 "src/xml/SkXMLWriter.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700265 "third_party/etc1/etc1.cpp",
266 "third_party/ktx/ktx.cpp",
267 ]
268
269 if (is_win) {
270 sources += [
271 "src/ports/SkDebug_win.cpp",
272 "src/ports/SkFontHost_win.cpp",
273 "src/ports/SkFontMgr_win_dw.cpp",
274 "src/ports/SkFontMgr_win_dw_factory.cpp",
275 "src/ports/SkImageEncoder_WIC.cpp",
276 "src/ports/SkImageGeneratorWIC.cpp",
277 "src/ports/SkOSFile_win.cpp",
278 "src/ports/SkScalerContext_win_dw.cpp",
279 "src/ports/SkTLS_win.cpp",
280 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700281 "src/xps/SkDocument_XPS.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700282 ]
mtklein7a1f45f2016-08-04 06:19:33 -0700283 sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700284 } else {
285 sources += [
286 "src/ports/SkDebug_stdio.cpp",
287 "src/ports/SkOSFile_posix.cpp",
288 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700289 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700290 ]
291 }
292
293 if (is_linux) {
294 deps += [
295 "third_party:fontconfig",
296 "third_party:freetype2",
mtkleinc04ff472016-06-23 10:29:30 -0700297 ]
298 sources += [
mtkleinc04ff472016-06-23 10:29:30 -0700299 "src/ports/SkFontConfigInterface_direct.cpp",
300 "src/ports/SkFontConfigInterface_direct_factory.cpp",
301 "src/ports/SkFontHost_FreeType.cpp",
302 "src/ports/SkFontHost_FreeType_common.cpp",
bungeman7d0e3bc2016-08-02 07:07:33 -0700303 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein7a34b1c2016-08-01 13:08:46 -0700304 "src/ports/SkFontMgr_fontconfig.cpp",
305 "src/ports/SkFontMgr_fontconfig_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700306 ]
307 }
308
309 if (is_mac) {
310 sources += [
311 "src/ports/SkFontHost_mac.cpp",
312 "src/ports/SkImageEncoder_CG.cpp",
313 "src/ports/SkImageGeneratorCG.cpp",
314 ]
315 libs += [ "ApplicationServices.framework" ]
316 }
abarth6fc8ff02016-07-15 15:15:15 -0700317
318 if (is_fuchsia) {
mtkleine817ddf2016-07-19 06:03:22 -0700319 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700320 }
mtkleinc04ff472016-06-23 10:29:30 -0700321}
322
mtkleinada5a442016-08-02 14:28:26 -0700323skia_h_headers = exec_script("gyp/find.py",
324 [ "*.h" ] + rebase_path(skia_public_includes),
325 "list lines",
326 []) -
327 [
328 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
329 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
330 rebase_path("include/gpu/vk/GrVkDefines.h"),
331 rebase_path("include/gpu/vk/GrVkInterface.h"),
332 rebase_path("include/gpu/vk/GrVkTypes.h"),
333 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
334 ]
335
mtklein1211e0c2016-07-26 13:55:45 -0700336action("skia.h") {
337 script = "gn/echo_headers.py"
338 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinada5a442016-08-02 14:28:26 -0700339 rebase_path(skia_h_headers, root_build_dir)
mtklein1211e0c2016-07-26 13:55:45 -0700340 outputs = [
341 "$target_gen_dir/skia.h",
342 ]
343}
344
345executable("fiddle") {
346 include_dirs = [ "$target_gen_dir" ]
mtklein7d10b9f2016-07-27 11:17:18 -0700347 libs = []
348 if (is_linux) {
349 libs += [ "OSMesa" ]
350 }
mtklein1211e0c2016-07-26 13:55:45 -0700351
mtkleinc04ff472016-06-23 10:29:30 -0700352 sources = [
mtklein1211e0c2016-07-26 13:55:45 -0700353 "tools/fiddle/draw.cpp",
354 "tools/fiddle/fiddle_main.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700355 ]
356 deps = [
357 ":skia",
mtklein1211e0c2016-07-26 13:55:45 -0700358 ":skia.h",
mtklein5dbd2742016-08-02 11:13:48 -0700359 ":tool_utils",
mtkleinc04ff472016-06-23 10:29:30 -0700360 ]
mtklein5dbd2742016-08-02 11:13:48 -0700361 testonly = true
mtkleinc04ff472016-06-23 10:29:30 -0700362}
mtklein25c81d42016-07-27 13:55:26 -0700363
364template("test_lib") {
365 config(target_name + "_config") {
366 include_dirs = invoker.public_include_dirs
367 }
368 source_set(target_name) {
369 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
370 public_configs = [
371 ":" + target_name + "_config",
372 ":skia_private",
373 ]
374
375 if (!defined(deps)) {
376 deps = []
377 }
378 deps += [ ":skia" ]
379 testonly = true
380 }
381}
382
383test_lib("gpu_tool_utils") {
384 public_include_dirs = [ "tools/gpu" ]
385 sources = [
386 "tools/gpu/GrContextFactory.cpp",
387 "tools/gpu/GrTest.cpp",
388 "tools/gpu/TestContext.cpp",
389 "tools/gpu/gl/GLTestContext.cpp",
390 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
391 "tools/gpu/gl/debug/GrBufferObj.cpp",
392 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
393 "tools/gpu/gl/debug/GrProgramObj.cpp",
394 "tools/gpu/gl/debug/GrShaderObj.cpp",
395 "tools/gpu/gl/debug/GrTextureObj.cpp",
396 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
397 "tools/gpu/gl/null/NullGLTestContext.cpp",
398 ]
399 libs = []
400
401 if (is_linux) {
mtklein5259da52016-08-03 08:28:20 -0700402 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700403 "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp",
404 "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp",
mtklein5259da52016-08-03 08:28:20 -0700405 ]
mtklein25c81d42016-07-27 13:55:26 -0700406 libs += [
407 "GL",
408 "GLU",
409 "X11",
410 ]
411 } else if (is_mac) {
mtklein5259da52016-08-03 08:28:20 -0700412 sources += [
mtklein4db3b792016-08-03 14:18:22 -0700413 "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp",
414 "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp",
mtklein5259da52016-08-03 08:28:20 -0700415 ]
mtklein25c81d42016-07-27 13:55:26 -0700416 libs += [ "OpenGL.framework" ]
417 }
418}
419
420test_lib("flags") {
421 public_include_dirs = [ "tools/flags" ]
422 sources = [
423 "tools/flags/SkCommandLineFlags.cpp",
424 "tools/flags/SkCommonFlags.cpp",
425 "tools/flags/SkCommonFlagsConfig.cpp",
426 ]
427 deps = [
428 ":gpu_tool_utils",
429 ]
430}
431
432test_lib("tool_utils") {
433 public_include_dirs = [
434 "tools",
mtklein2f3416d2016-08-02 16:02:05 -0700435 "tools/debugger",
mtklein25c81d42016-07-27 13:55:26 -0700436 "tools/timer",
437 ]
438 sources = [
mtklein2b6870c2016-07-28 14:17:33 -0700439 "src/images/SkForceLinking.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700440 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtklein2b6870c2016-07-28 14:17:33 -0700441 "tools/CrashHandler.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700442 "tools/ProcStats.cpp",
443 "tools/Resources.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700444 "tools/ThermalManager.cpp",
mtklein2f3416d2016-08-02 16:02:05 -0700445 "tools/UrlDataManager.cpp",
446 "tools/debugger/SkDebugCanvas.cpp",
447 "tools/debugger/SkDrawCommand.cpp",
448 "tools/debugger/SkJsonWriteBuffer.cpp",
449 "tools/debugger/SkObjectParser.cpp",
450 "tools/debugger/SkOverdrawMode.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700451 "tools/picture_utils.cpp",
452 "tools/random_parse_path.cpp",
453 "tools/sk_tool_utils.cpp",
454 "tools/sk_tool_utils_font.cpp",
455 "tools/timer/Timer.cpp",
456 ]
457 deps = [
458 ":flags",
mtklein2f3416d2016-08-02 16:02:05 -0700459 "//third_party/libpng",
460 ]
461 public_deps = [
462 "//third_party/jsoncpp",
mtklein25c81d42016-07-27 13:55:26 -0700463 ]
464}
465
466gm_sources = exec_script("gyp/find.py",
467 [
mtklein25c81d42016-07-27 13:55:26 -0700468 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700469 rebase_path("gm"),
mtklein25c81d42016-07-27 13:55:26 -0700470 ],
471 "list lines",
472 [])
473test_lib("gm") {
474 public_include_dirs = [ "gm" ]
475 sources = gm_sources
476 deps = [
477 ":gpu_tool_utils",
478 ":skia",
479 ":tool_utils",
480 ]
481}
482
mtklein2f3416d2016-08-02 16:02:05 -0700483tests_sources = exec_script("gyp/find.py",
484 [
485 "*.c*",
486 rebase_path("tests"),
487 ],
488 "list lines",
489 [])
490
491test_lib("tests") {
492 public_include_dirs = [ "tests" ]
493 sources = tests_sources - [
494 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only
495 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtklein4db3b792016-08-03 14:18:22 -0700496 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work
497 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work
mtklein2f3416d2016-08-02 16:02:05 -0700498 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
499 rebase_path("tests/skia_test.cpp"), # alternate main
500 ]
501 deps = [
502 ":flags",
503 ":gpu_tool_utils",
504 ":skia",
505 ":tool_utils",
506 "//third_party/libpng",
507 "//third_party/zlib",
508 ]
509}
510
mtklein2b6870c2016-07-28 14:17:33 -0700511bench_sources = exec_script("gyp/find.py",
512 [
mtklein2b6870c2016-07-28 14:17:33 -0700513 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700514 rebase_path("bench"),
mtklein2b6870c2016-07-28 14:17:33 -0700515 ],
516 "list lines",
517 [])
mtklein25c81d42016-07-27 13:55:26 -0700518
mtklein2b6870c2016-07-28 14:17:33 -0700519test_lib("bench") {
520 public_include_dirs = [ "bench" ]
521 sources = bench_sources
522 sources -= [
523 rebase_path("bench/nanobench.cpp"),
524 rebase_path("bench/nanobenchAndroid.cpp"),
525 ]
526 deps = [
527 ":flags",
528 ":gm",
529 ":gpu_tool_utils",
530 ":skia",
531 ":tool_utils",
532 ]
533}
534
fmalitaa2b9fdf2016-08-03 19:53:36 -0700535test_lib("experimental_svg_model") {
536 public_include_dirs = [ "experimental/svg/model" ]
537 sources = [
538 "experimental/svg/model/SkSVGAttribute.cpp",
539 "experimental/svg/model/SkSVGAttributeParser.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700540 "experimental/svg/model/SkSVGCircle.cpp",
anmittala7eaf2e2016-08-17 13:57:26 -0700541 "experimental/svg/model/SkSVGContainer.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700542 "experimental/svg/model/SkSVGDOM.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700543 "experimental/svg/model/SkSVGEllipse.cpp",
fmalitad24ee142016-08-17 08:38:15 -0700544 "experimental/svg/model/SkSVGLine.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700545 "experimental/svg/model/SkSVGNode.cpp",
546 "experimental/svg/model/SkSVGPath.cpp",
fmalita5b31f322016-08-12 12:15:33 -0700547 "experimental/svg/model/SkSVGPoly.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700548 "experimental/svg/model/SkSVGRect.cpp",
549 "experimental/svg/model/SkSVGRenderContext.cpp",
550 "experimental/svg/model/SkSVGSVG.cpp",
551 "experimental/svg/model/SkSVGShape.cpp",
552 "experimental/svg/model/SkSVGTransformableNode.cpp",
553 "experimental/svg/model/SkSVGValue.cpp",
554 ]
555 deps = [
556 ":skia",
557 ]
558}
559
mtklein2b6870c2016-07-28 14:17:33 -0700560if (!is_component_build) { # Our test tools use many non-SK_API APIs...
561 executable("dm") {
562 sources = [
563 "dm/DM.cpp",
564 "dm/DMJsonWriter.cpp",
565 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700566 ]
567 include_dirs = [ "tests" ]
568 deps = [
fmalitaa2b9fdf2016-08-03 19:53:36 -0700569 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700570 ":flags",
571 ":gm",
572 ":gpu_tool_utils",
573 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700574 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700575 ":tool_utils",
576 "//third_party/jsoncpp",
577 "//third_party/libpng",
578 ]
579 testonly = true
580 }
581
582 executable("monobench") {
583 sources = [
584 "tools/monobench.cpp",
585 ]
586 deps = [
587 ":bench",
588 ":skia",
589 ]
590 testonly = true
591 }
592
593 executable("nanobench") {
594 sources = [
595 "bench/nanobench.cpp",
596 ]
597 deps = [
598 ":bench",
599 ":flags",
600 ":gm",
601 ":gpu_tool_utils",
602 ":skia",
603 ":tool_utils",
604 "//third_party/jsoncpp",
605 ]
606 testonly = true
607 }
halcanary19a97202016-08-03 15:08:04 -0700608
609 executable("sktexttopdf") {
610 sources = [
611 "tools/SkShaper_harfbuzz.cpp",
612 "tools/using_skia_and_harfbuzz.cpp",
613 ]
614 deps = [
615 ":skia",
616 "//third_party/harfbuzz",
617 ]
618 testonly = true
619 }
mtklein25c81d42016-07-27 13:55:26 -0700620}