blob: 21dd51256216ddc421fea15483c222b871c99cee [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",
mtklein09e61f72016-08-23 13:35:28 -0700260 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700261 "src/images/SkImageEncoder.cpp",
262 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700263 "src/images/SkJPEGImageEncoder.cpp",
264 "src/images/SkJPEGWriteUtility.cpp",
265 "src/images/SkKTXImageEncoder.cpp",
266 "src/images/SkPNGImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700267 "src/ports/SkDiscardableMemory_none.cpp",
268 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700269 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700270 "src/ports/SkMemory_malloc.cpp",
271 "src/ports/SkOSFile_stdio.cpp",
272 "src/sfnt/SkOTTable_name.cpp",
273 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700274 "src/svg/SkSVGCanvas.cpp",
275 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700276 "src/utils/mac/SkStream_mac.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700277 "src/xml/SkDOM.cpp",
278 "src/xml/SkXMLParser.cpp",
279 "src/xml/SkXMLWriter.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700280 "third_party/etc1/etc1.cpp",
281 "third_party/ktx/ktx.cpp",
282 ]
mtklein09e61f72016-08-23 13:35:28 -0700283 sources -= [
284 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
285 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
286 ]
mtkleinc04ff472016-06-23 10:29:30 -0700287
288 if (is_win) {
289 sources += [
290 "src/ports/SkDebug_win.cpp",
291 "src/ports/SkFontHost_win.cpp",
292 "src/ports/SkFontMgr_win_dw.cpp",
293 "src/ports/SkFontMgr_win_dw_factory.cpp",
294 "src/ports/SkImageEncoder_WIC.cpp",
295 "src/ports/SkImageGeneratorWIC.cpp",
296 "src/ports/SkOSFile_win.cpp",
297 "src/ports/SkScalerContext_win_dw.cpp",
298 "src/ports/SkTLS_win.cpp",
299 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700300 "src/xps/SkDocument_XPS.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700301 ]
mtklein7a1f45f2016-08-04 06:19:33 -0700302 sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700303 } else {
304 sources += [
305 "src/ports/SkDebug_stdio.cpp",
306 "src/ports/SkOSFile_posix.cpp",
307 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700308 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700309 ]
310 }
311
312 if (is_linux) {
313 deps += [
314 "third_party:fontconfig",
315 "third_party:freetype2",
mtkleinc04ff472016-06-23 10:29:30 -0700316 ]
mtklein09e61f72016-08-23 13:35:28 -0700317 libs += [
318 "GL",
319 "GLU",
320 "X11",
321 ]
mtkleinc04ff472016-06-23 10:29:30 -0700322 sources += [
mtklein09e61f72016-08-23 13:35:28 -0700323 "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700324 "src/ports/SkFontConfigInterface_direct.cpp",
325 "src/ports/SkFontConfigInterface_direct_factory.cpp",
326 "src/ports/SkFontHost_FreeType.cpp",
327 "src/ports/SkFontHost_FreeType_common.cpp",
bungeman7d0e3bc2016-08-02 07:07:33 -0700328 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein7a34b1c2016-08-01 13:08:46 -0700329 "src/ports/SkFontMgr_fontconfig.cpp",
330 "src/ports/SkFontMgr_fontconfig_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700331 ]
332 }
333
334 if (is_mac) {
335 sources += [
mtklein09e61f72016-08-23 13:35:28 -0700336 "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700337 "src/ports/SkFontHost_mac.cpp",
338 "src/ports/SkImageEncoder_CG.cpp",
339 "src/ports/SkImageGeneratorCG.cpp",
340 ]
mtklein09e61f72016-08-23 13:35:28 -0700341 libs += [
342 "ApplicationServices.framework",
343 "OpenGL.framework",
344 ]
mtkleinc04ff472016-06-23 10:29:30 -0700345 }
abarth6fc8ff02016-07-15 15:15:15 -0700346
347 if (is_fuchsia) {
mtkleine817ddf2016-07-19 06:03:22 -0700348 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700349 }
mtkleinc04ff472016-06-23 10:29:30 -0700350}
351
mtkleinada5a442016-08-02 14:28:26 -0700352skia_h_headers = exec_script("gyp/find.py",
353 [ "*.h" ] + rebase_path(skia_public_includes),
354 "list lines",
355 []) -
356 [
357 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
358 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
359 rebase_path("include/gpu/vk/GrVkDefines.h"),
360 rebase_path("include/gpu/vk/GrVkInterface.h"),
361 rebase_path("include/gpu/vk/GrVkTypes.h"),
362 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
363 ]
364
mtklein1211e0c2016-07-26 13:55:45 -0700365action("skia.h") {
366 script = "gn/echo_headers.py"
367 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinada5a442016-08-02 14:28:26 -0700368 rebase_path(skia_h_headers, root_build_dir)
mtklein1211e0c2016-07-26 13:55:45 -0700369 outputs = [
370 "$target_gen_dir/skia.h",
371 ]
372}
373
374executable("fiddle") {
375 include_dirs = [ "$target_gen_dir" ]
mtklein7d10b9f2016-07-27 11:17:18 -0700376 libs = []
377 if (is_linux) {
378 libs += [ "OSMesa" ]
379 }
mtklein1211e0c2016-07-26 13:55:45 -0700380
mtkleinc04ff472016-06-23 10:29:30 -0700381 sources = [
mtklein1211e0c2016-07-26 13:55:45 -0700382 "tools/fiddle/draw.cpp",
383 "tools/fiddle/fiddle_main.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700384 ]
385 deps = [
386 ":skia",
mtklein1211e0c2016-07-26 13:55:45 -0700387 ":skia.h",
mtklein5dbd2742016-08-02 11:13:48 -0700388 ":tool_utils",
mtkleinc04ff472016-06-23 10:29:30 -0700389 ]
mtklein5dbd2742016-08-02 11:13:48 -0700390 testonly = true
mtkleinc04ff472016-06-23 10:29:30 -0700391}
mtklein25c81d42016-07-27 13:55:26 -0700392
393template("test_lib") {
394 config(target_name + "_config") {
395 include_dirs = invoker.public_include_dirs
396 }
397 source_set(target_name) {
398 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
399 public_configs = [
400 ":" + target_name + "_config",
401 ":skia_private",
402 ]
403
404 if (!defined(deps)) {
405 deps = []
406 }
407 deps += [ ":skia" ]
408 testonly = true
409 }
410}
411
412test_lib("gpu_tool_utils") {
413 public_include_dirs = [ "tools/gpu" ]
414 sources = [
415 "tools/gpu/GrContextFactory.cpp",
416 "tools/gpu/GrTest.cpp",
417 "tools/gpu/TestContext.cpp",
418 "tools/gpu/gl/GLTestContext.cpp",
419 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
420 "tools/gpu/gl/debug/GrBufferObj.cpp",
421 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
422 "tools/gpu/gl/debug/GrProgramObj.cpp",
423 "tools/gpu/gl/debug/GrShaderObj.cpp",
424 "tools/gpu/gl/debug/GrTextureObj.cpp",
425 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
426 "tools/gpu/gl/null/NullGLTestContext.cpp",
427 ]
428 libs = []
429
430 if (is_linux) {
mtklein09e61f72016-08-23 13:35:28 -0700431 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
mtklein25c81d42016-07-27 13:55:26 -0700432 } else if (is_mac) {
mtklein09e61f72016-08-23 13:35:28 -0700433 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
mtklein25c81d42016-07-27 13:55:26 -0700434 }
435}
436
437test_lib("flags") {
438 public_include_dirs = [ "tools/flags" ]
439 sources = [
440 "tools/flags/SkCommandLineFlags.cpp",
441 "tools/flags/SkCommonFlags.cpp",
442 "tools/flags/SkCommonFlagsConfig.cpp",
443 ]
444 deps = [
445 ":gpu_tool_utils",
446 ]
447}
448
449test_lib("tool_utils") {
450 public_include_dirs = [
451 "tools",
mtklein2f3416d2016-08-02 16:02:05 -0700452 "tools/debugger",
mtklein25c81d42016-07-27 13:55:26 -0700453 "tools/timer",
454 ]
455 sources = [
mtklein2b6870c2016-07-28 14:17:33 -0700456 "src/images/SkForceLinking.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700457 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtklein2b6870c2016-07-28 14:17:33 -0700458 "tools/CrashHandler.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700459 "tools/ProcStats.cpp",
460 "tools/Resources.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700461 "tools/ThermalManager.cpp",
mtklein2f3416d2016-08-02 16:02:05 -0700462 "tools/UrlDataManager.cpp",
463 "tools/debugger/SkDebugCanvas.cpp",
464 "tools/debugger/SkDrawCommand.cpp",
465 "tools/debugger/SkJsonWriteBuffer.cpp",
466 "tools/debugger/SkObjectParser.cpp",
467 "tools/debugger/SkOverdrawMode.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700468 "tools/picture_utils.cpp",
469 "tools/random_parse_path.cpp",
470 "tools/sk_tool_utils.cpp",
471 "tools/sk_tool_utils_font.cpp",
472 "tools/timer/Timer.cpp",
473 ]
474 deps = [
475 ":flags",
mtklein2f3416d2016-08-02 16:02:05 -0700476 "//third_party/libpng",
477 ]
478 public_deps = [
479 "//third_party/jsoncpp",
mtklein25c81d42016-07-27 13:55:26 -0700480 ]
481}
482
483gm_sources = exec_script("gyp/find.py",
484 [
mtklein25c81d42016-07-27 13:55:26 -0700485 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700486 rebase_path("gm"),
mtklein25c81d42016-07-27 13:55:26 -0700487 ],
488 "list lines",
489 [])
490test_lib("gm") {
491 public_include_dirs = [ "gm" ]
492 sources = gm_sources
493 deps = [
494 ":gpu_tool_utils",
495 ":skia",
496 ":tool_utils",
497 ]
498}
499
mtklein2f3416d2016-08-02 16:02:05 -0700500tests_sources = exec_script("gyp/find.py",
501 [
502 "*.c*",
503 rebase_path("tests"),
504 ],
505 "list lines",
506 [])
507
508test_lib("tests") {
509 public_include_dirs = [ "tests" ]
510 sources = tests_sources - [
511 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only
512 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtklein4db3b792016-08-03 14:18:22 -0700513 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work
514 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work
mtklein2f3416d2016-08-02 16:02:05 -0700515 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
516 rebase_path("tests/skia_test.cpp"), # alternate main
517 ]
518 deps = [
519 ":flags",
520 ":gpu_tool_utils",
521 ":skia",
522 ":tool_utils",
523 "//third_party/libpng",
524 "//third_party/zlib",
525 ]
526}
527
mtklein2b6870c2016-07-28 14:17:33 -0700528bench_sources = exec_script("gyp/find.py",
529 [
mtklein2b6870c2016-07-28 14:17:33 -0700530 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700531 rebase_path("bench"),
mtklein2b6870c2016-07-28 14:17:33 -0700532 ],
533 "list lines",
534 [])
mtklein25c81d42016-07-27 13:55:26 -0700535
mtklein2b6870c2016-07-28 14:17:33 -0700536test_lib("bench") {
537 public_include_dirs = [ "bench" ]
538 sources = bench_sources
539 sources -= [
540 rebase_path("bench/nanobench.cpp"),
541 rebase_path("bench/nanobenchAndroid.cpp"),
542 ]
543 deps = [
544 ":flags",
545 ":gm",
546 ":gpu_tool_utils",
547 ":skia",
548 ":tool_utils",
549 ]
550}
551
fmalitaa2b9fdf2016-08-03 19:53:36 -0700552test_lib("experimental_svg_model") {
553 public_include_dirs = [ "experimental/svg/model" ]
554 sources = [
555 "experimental/svg/model/SkSVGAttribute.cpp",
556 "experimental/svg/model/SkSVGAttributeParser.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700557 "experimental/svg/model/SkSVGCircle.cpp",
anmittala7eaf2e2016-08-17 13:57:26 -0700558 "experimental/svg/model/SkSVGContainer.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700559 "experimental/svg/model/SkSVGDOM.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700560 "experimental/svg/model/SkSVGEllipse.cpp",
fmalitad24ee142016-08-17 08:38:15 -0700561 "experimental/svg/model/SkSVGLine.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700562 "experimental/svg/model/SkSVGNode.cpp",
563 "experimental/svg/model/SkSVGPath.cpp",
fmalita5b31f322016-08-12 12:15:33 -0700564 "experimental/svg/model/SkSVGPoly.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700565 "experimental/svg/model/SkSVGRect.cpp",
566 "experimental/svg/model/SkSVGRenderContext.cpp",
567 "experimental/svg/model/SkSVGSVG.cpp",
568 "experimental/svg/model/SkSVGShape.cpp",
569 "experimental/svg/model/SkSVGTransformableNode.cpp",
570 "experimental/svg/model/SkSVGValue.cpp",
571 ]
572 deps = [
573 ":skia",
574 ]
575}
576
mtklein2b6870c2016-07-28 14:17:33 -0700577if (!is_component_build) { # Our test tools use many non-SK_API APIs...
578 executable("dm") {
579 sources = [
580 "dm/DM.cpp",
581 "dm/DMJsonWriter.cpp",
582 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700583 ]
584 include_dirs = [ "tests" ]
585 deps = [
fmalitaa2b9fdf2016-08-03 19:53:36 -0700586 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700587 ":flags",
588 ":gm",
589 ":gpu_tool_utils",
590 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700591 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700592 ":tool_utils",
593 "//third_party/jsoncpp",
594 "//third_party/libpng",
595 ]
596 testonly = true
597 }
598
599 executable("monobench") {
600 sources = [
601 "tools/monobench.cpp",
602 ]
603 deps = [
604 ":bench",
605 ":skia",
606 ]
607 testonly = true
608 }
609
610 executable("nanobench") {
611 sources = [
612 "bench/nanobench.cpp",
613 ]
614 deps = [
615 ":bench",
616 ":flags",
617 ":gm",
618 ":gpu_tool_utils",
619 ":skia",
620 ":tool_utils",
621 "//third_party/jsoncpp",
622 ]
623 testonly = true
624 }
halcanary19a97202016-08-03 15:08:04 -0700625
626 executable("sktexttopdf") {
627 sources = [
628 "tools/SkShaper_harfbuzz.cpp",
629 "tools/using_skia_and_harfbuzz.cpp",
630 ]
631 deps = [
632 ":skia",
633 "//third_party/harfbuzz",
634 ]
635 testonly = true
636 }
mtklein25c81d42016-07-27 13:55:26 -0700637}