blob: cdc1cb90eb75e318a89951e592ec947bef22a766 [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() {
mtklein457b42a2016-08-23 13:56:37 -07007 skia_use_giflib = !is_fuchsia
mtkleineb3c4252016-08-23 07:38:09 -07008 skia_use_libwebp = !is_fuchsia
mtkleinc04ff472016-06-23 10:29:30 -07009}
10
mtklein1211e0c2016-07-26 13:55:45 -070011skia_public_includes = [
mtklein25c81d42016-07-27 13:55:26 -070012 "include/android",
mtkleinfa84d942016-07-28 09:45:14 -070013 "include/c",
mtklein1211e0c2016-07-26 13:55:45 -070014 "include/codec",
15 "include/config",
16 "include/core",
17 "include/effects",
18 "include/gpu",
19 "include/gpu/gl",
20 "include/images",
21 "include/pathops",
22 "include/ports",
mtklein25c81d42016-07-27 13:55:26 -070023 "include/svg",
mtklein1211e0c2016-07-26 13:55:45 -070024 "include/utils",
25 "include/utils/mac",
mtklein25c81d42016-07-27 13:55:26 -070026 "include/xml",
mtklein1211e0c2016-07-26 13:55:45 -070027]
28
mtkleinc04ff472016-06-23 10:29:30 -070029# Skia public API, generally provided by :skia.
30config("skia_public") {
mtklein1211e0c2016-07-26 13:55:45 -070031 include_dirs = skia_public_includes
mtkleinc04ff472016-06-23 10:29:30 -070032 defines = [ "SKIA_DLL" ]
33}
34
35# Skia internal APIs, used by Skia itself and a few test tools.
36config("skia_private") {
37 visibility = [ ":*" ]
38
39 include_dirs = [
40 "include/private",
41 "src/c",
mtklein1211e0c2016-07-26 13:55:45 -070042 "src/codec",
mtkleinc04ff472016-06-23 10:29:30 -070043 "src/config",
44 "src/core",
45 "src/effects",
mtklein25c81d42016-07-27 13:55:26 -070046 "src/effects/gradients",
47 "src/fonts",
mtkleinc04ff472016-06-23 10:29:30 -070048 "src/gpu",
49 "src/image",
50 "src/images",
51 "src/lazy",
52 "src/opts",
53 "src/pathops",
mtklein2b6870c2016-07-28 14:17:33 -070054 "src/pdf",
mtkleinc04ff472016-06-23 10:29:30 -070055 "src/ports",
56 "src/sfnt",
57 "src/utils",
mtklein7a1f45f2016-08-04 06:19:33 -070058 "src/utils/win",
mtkleinc04ff472016-06-23 10:29:30 -070059 "third_party/etc1",
60 "third_party/ktx",
61 ]
mtklein150d1132016-08-01 06:56:40 -070062
63 defines = [
mtklein9be68662016-08-01 08:37:48 -070064 "SK_GAMMA_APPLY_TO_A8",
65
mtklein150d1132016-08-01 06:56:40 -070066 "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
mtklein457b42a2016-08-23 13:56:37 -0700182template("optional") {
183 if (invoker.enabled) {
184 config(target_name + "_public") {
185 defines = invoker.public_defines
186 }
187 source_set(target_name) {
188 forward_variables_from(invoker, "*", [ "public_defines" ])
189 all_dependent_configs = [ ":" + target_name + "_public" ]
190 }
191 } else {
192 # If not enabled, a phony empty target that swallows all otherwise unused variables.
193 source_set(target_name) {
194 forward_variables_from(invoker,
195 "*",
196 [
197 "public_defines",
198 "configs",
199 "deps",
200 "sources",
201 ])
202 }
mtkleineb3c4252016-08-23 07:38:09 -0700203 }
mtklein457b42a2016-08-23 13:56:37 -0700204}
205set_defaults("optional") {
206 configs = default_configs
207}
208
209optional("gif") {
210 enabled = skia_use_giflib
211 public_defines = [ "SK_HAS_GIF_LIBRARY" ]
212
213 configs += skia_library_configs
214 deps = [
215 "//third_party/giflib",
216 ]
217 sources = [
218 "src/codec/SkGifCodec.cpp",
219 ]
220}
221
222optional("webp") {
223 enabled = skia_use_libwebp
224 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
225
226 configs += skia_library_configs
227 deps = [
228 "//third_party/libwebp",
229 ]
230 sources = [
231 "src/codec/SkWebpAdapterCodec.cpp",
232 "src/codec/SkWebpCodec.cpp",
233 "src/images/SkWEBPImageEncoder.cpp",
234 ]
mtkleineb3c4252016-08-23 07:38:09 -0700235}
236
mtkleinc04ff472016-06-23 10:29:30 -0700237component("skia") {
238 public_configs = [ ":skia_public" ]
239 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -0700240
241 deps = [
mtklein457b42a2016-08-23 13:56:37 -0700242 ":gif",
mtkleineb3c4252016-08-23 07:38:09 -0700243 ":webp",
mtklein25c81d42016-07-27 13:55:26 -0700244 "//third_party/expat",
mtklein0a8efd72016-08-22 06:32:39 -0700245 "//third_party/libjpeg-turbo:libjpeg",
mtklein7d10b9f2016-07-27 11:17:18 -0700246 "//third_party/libpng",
halcanary19a97202016-08-03 15:08:04 -0700247 "//third_party/sfntly",
abarth6fc8ff02016-07-15 15:15:15 -0700248 "//third_party/zlib",
mtkleinc04ff472016-06-23 10:29:30 -0700249 ]
mtklein422310d2016-08-16 18:28:43 -0700250 if (is_x86) {
251 deps += [
252 ":opts_avx",
253 ":opts_sse2",
254 ":opts_sse41",
255 ":opts_sse42",
256 ":opts_ssse3",
257 ]
anmittala7eaf2e2016-08-17 13:57:26 -0700258 } else {
259 deps += [ ":opts_none" ]
mtklein422310d2016-08-16 18:28:43 -0700260 }
mtkleinc04ff472016-06-23 10:29:30 -0700261
mtklein7a1f45f2016-08-04 06:19:33 -0700262 if (!is_win) {
263 libs = [ "pthread" ]
264 }
mtkleinc04ff472016-06-23 10:29:30 -0700265
266 sources = []
267 sources += core_gypi.sources
268 sources += effects_gypi.sources
269 sources += gpu_gypi.skgpu_sources
mtkleinc04ff472016-06-23 10:29:30 -0700270 sources += pdf_gypi.sources
271 sources += utils_gypi.sources
272 sources += [
mtklein25c81d42016-07-27 13:55:26 -0700273 "src/android/SkBitmapRegionCodec.cpp",
274 "src/android/SkBitmapRegionDecoder.cpp",
275 "src/codec/SkAndroidCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700276 "src/codec/SkBmpCodec.cpp",
277 "src/codec/SkBmpMaskCodec.cpp",
278 "src/codec/SkBmpRLECodec.cpp",
279 "src/codec/SkBmpStandardCodec.cpp",
280 "src/codec/SkCodec.cpp",
281 "src/codec/SkCodecImageGenerator.cpp",
282 "src/codec/SkIcoCodec.cpp",
283 "src/codec/SkJpegCodec.cpp",
284 "src/codec/SkJpegDecoderMgr.cpp",
285 "src/codec/SkJpegUtility.cpp",
286 "src/codec/SkMaskSwizzler.cpp",
287 "src/codec/SkMasks.cpp",
288 "src/codec/SkPngCodec.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700289 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700290 "src/codec/SkSampler.cpp",
291 "src/codec/SkSwizzler.cpp",
292 "src/codec/SkWbmpCodec.cpp",
mtklein09e61f72016-08-23 13:35:28 -0700293 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700294 "src/images/SkImageEncoder.cpp",
295 "src/images/SkImageEncoder_Factory.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700296 "src/images/SkJPEGImageEncoder.cpp",
297 "src/images/SkJPEGWriteUtility.cpp",
298 "src/images/SkKTXImageEncoder.cpp",
299 "src/images/SkPNGImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700300 "src/ports/SkDiscardableMemory_none.cpp",
301 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -0700302 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700303 "src/ports/SkMemory_malloc.cpp",
304 "src/ports/SkOSFile_stdio.cpp",
305 "src/sfnt/SkOTTable_name.cpp",
306 "src/sfnt/SkOTUtils.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700307 "src/svg/SkSVGCanvas.cpp",
308 "src/svg/SkSVGDevice.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700309 "src/utils/mac/SkStream_mac.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700310 "src/xml/SkDOM.cpp",
311 "src/xml/SkXMLParser.cpp",
312 "src/xml/SkXMLWriter.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700313 "third_party/etc1/etc1.cpp",
314 "third_party/ktx/ktx.cpp",
315 ]
mtklein09e61f72016-08-23 13:35:28 -0700316 sources -= [
317 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
318 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
319 ]
mtkleinc04ff472016-06-23 10:29:30 -0700320
321 if (is_win) {
322 sources += [
323 "src/ports/SkDebug_win.cpp",
324 "src/ports/SkFontHost_win.cpp",
325 "src/ports/SkFontMgr_win_dw.cpp",
326 "src/ports/SkFontMgr_win_dw_factory.cpp",
327 "src/ports/SkImageEncoder_WIC.cpp",
328 "src/ports/SkImageGeneratorWIC.cpp",
329 "src/ports/SkOSFile_win.cpp",
330 "src/ports/SkScalerContext_win_dw.cpp",
331 "src/ports/SkTLS_win.cpp",
332 "src/ports/SkTypeface_win_dw.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700333 "src/xps/SkDocument_XPS.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700334 ]
mtklein7a1f45f2016-08-04 06:19:33 -0700335 sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ]
mtkleinc04ff472016-06-23 10:29:30 -0700336 } else {
337 sources += [
338 "src/ports/SkDebug_stdio.cpp",
339 "src/ports/SkOSFile_posix.cpp",
340 "src/ports/SkTLS_pthread.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700341 "src/xps/SkDocument_XPS_None.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700342 ]
343 }
344
345 if (is_linux) {
346 deps += [
347 "third_party:fontconfig",
348 "third_party:freetype2",
mtkleinc04ff472016-06-23 10:29:30 -0700349 ]
mtklein09e61f72016-08-23 13:35:28 -0700350 libs += [
351 "GL",
352 "GLU",
353 "X11",
354 ]
mtkleinc04ff472016-06-23 10:29:30 -0700355 sources += [
mtklein09e61f72016-08-23 13:35:28 -0700356 "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700357 "src/ports/SkFontConfigInterface_direct.cpp",
358 "src/ports/SkFontConfigInterface_direct_factory.cpp",
359 "src/ports/SkFontHost_FreeType.cpp",
360 "src/ports/SkFontHost_FreeType_common.cpp",
bungeman7d0e3bc2016-08-02 07:07:33 -0700361 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein7a34b1c2016-08-01 13:08:46 -0700362 "src/ports/SkFontMgr_fontconfig.cpp",
363 "src/ports/SkFontMgr_fontconfig_factory.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700364 ]
365 }
366
367 if (is_mac) {
368 sources += [
mtklein09e61f72016-08-23 13:35:28 -0700369 "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700370 "src/ports/SkFontHost_mac.cpp",
371 "src/ports/SkImageEncoder_CG.cpp",
372 "src/ports/SkImageGeneratorCG.cpp",
373 ]
mtklein09e61f72016-08-23 13:35:28 -0700374 libs += [
375 "ApplicationServices.framework",
376 "OpenGL.framework",
377 ]
mtkleinc04ff472016-06-23 10:29:30 -0700378 }
abarth6fc8ff02016-07-15 15:15:15 -0700379
380 if (is_fuchsia) {
mtkleine817ddf2016-07-19 06:03:22 -0700381 sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -0700382 }
mtkleinc04ff472016-06-23 10:29:30 -0700383}
384
mtkleinada5a442016-08-02 14:28:26 -0700385skia_h_headers = exec_script("gyp/find.py",
386 [ "*.h" ] + rebase_path(skia_public_includes),
387 "list lines",
388 []) -
389 [
390 rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
391 rebase_path("include/gpu/vk/GrVkBackendContext.h"),
392 rebase_path("include/gpu/vk/GrVkDefines.h"),
393 rebase_path("include/gpu/vk/GrVkInterface.h"),
394 rebase_path("include/gpu/vk/GrVkTypes.h"),
395 rebase_path("include/ports/SkFontMgr_fontconfig.h"),
396 ]
397
mtklein1211e0c2016-07-26 13:55:45 -0700398action("skia.h") {
399 script = "gn/echo_headers.py"
400 args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
mtkleinada5a442016-08-02 14:28:26 -0700401 rebase_path(skia_h_headers, root_build_dir)
mtklein1211e0c2016-07-26 13:55:45 -0700402 outputs = [
403 "$target_gen_dir/skia.h",
404 ]
405}
406
407executable("fiddle") {
408 include_dirs = [ "$target_gen_dir" ]
mtklein7d10b9f2016-07-27 11:17:18 -0700409 libs = []
410 if (is_linux) {
411 libs += [ "OSMesa" ]
412 }
mtklein1211e0c2016-07-26 13:55:45 -0700413
mtkleinc04ff472016-06-23 10:29:30 -0700414 sources = [
mtklein1211e0c2016-07-26 13:55:45 -0700415 "tools/fiddle/draw.cpp",
416 "tools/fiddle/fiddle_main.cpp",
mtkleinc04ff472016-06-23 10:29:30 -0700417 ]
418 deps = [
419 ":skia",
mtklein1211e0c2016-07-26 13:55:45 -0700420 ":skia.h",
mtklein5dbd2742016-08-02 11:13:48 -0700421 ":tool_utils",
mtkleinc04ff472016-06-23 10:29:30 -0700422 ]
mtklein5dbd2742016-08-02 11:13:48 -0700423 testonly = true
mtkleinc04ff472016-06-23 10:29:30 -0700424}
mtklein25c81d42016-07-27 13:55:26 -0700425
426template("test_lib") {
427 config(target_name + "_config") {
428 include_dirs = invoker.public_include_dirs
429 }
430 source_set(target_name) {
431 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
432 public_configs = [
433 ":" + target_name + "_config",
434 ":skia_private",
435 ]
436
437 if (!defined(deps)) {
438 deps = []
439 }
440 deps += [ ":skia" ]
441 testonly = true
442 }
443}
444
445test_lib("gpu_tool_utils") {
446 public_include_dirs = [ "tools/gpu" ]
447 sources = [
448 "tools/gpu/GrContextFactory.cpp",
449 "tools/gpu/GrTest.cpp",
450 "tools/gpu/TestContext.cpp",
451 "tools/gpu/gl/GLTestContext.cpp",
452 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
453 "tools/gpu/gl/debug/GrBufferObj.cpp",
454 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
455 "tools/gpu/gl/debug/GrProgramObj.cpp",
456 "tools/gpu/gl/debug/GrShaderObj.cpp",
457 "tools/gpu/gl/debug/GrTextureObj.cpp",
458 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
459 "tools/gpu/gl/null/NullGLTestContext.cpp",
460 ]
461 libs = []
462
463 if (is_linux) {
mtklein09e61f72016-08-23 13:35:28 -0700464 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
mtklein25c81d42016-07-27 13:55:26 -0700465 } else if (is_mac) {
mtklein09e61f72016-08-23 13:35:28 -0700466 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
mtklein25c81d42016-07-27 13:55:26 -0700467 }
468}
469
470test_lib("flags") {
471 public_include_dirs = [ "tools/flags" ]
472 sources = [
473 "tools/flags/SkCommandLineFlags.cpp",
474 "tools/flags/SkCommonFlags.cpp",
475 "tools/flags/SkCommonFlagsConfig.cpp",
476 ]
477 deps = [
478 ":gpu_tool_utils",
479 ]
480}
481
482test_lib("tool_utils") {
483 public_include_dirs = [
484 "tools",
mtklein2f3416d2016-08-02 16:02:05 -0700485 "tools/debugger",
mtklein25c81d42016-07-27 13:55:26 -0700486 "tools/timer",
487 ]
488 sources = [
mtklein2b6870c2016-07-28 14:17:33 -0700489 "src/images/SkForceLinking.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700490 "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools?
mtklein2b6870c2016-07-28 14:17:33 -0700491 "tools/CrashHandler.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700492 "tools/ProcStats.cpp",
493 "tools/Resources.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700494 "tools/ThermalManager.cpp",
mtklein2f3416d2016-08-02 16:02:05 -0700495 "tools/UrlDataManager.cpp",
496 "tools/debugger/SkDebugCanvas.cpp",
497 "tools/debugger/SkDrawCommand.cpp",
498 "tools/debugger/SkJsonWriteBuffer.cpp",
499 "tools/debugger/SkObjectParser.cpp",
500 "tools/debugger/SkOverdrawMode.cpp",
mtklein25c81d42016-07-27 13:55:26 -0700501 "tools/picture_utils.cpp",
502 "tools/random_parse_path.cpp",
503 "tools/sk_tool_utils.cpp",
504 "tools/sk_tool_utils_font.cpp",
505 "tools/timer/Timer.cpp",
506 ]
507 deps = [
508 ":flags",
mtklein2f3416d2016-08-02 16:02:05 -0700509 "//third_party/libpng",
510 ]
511 public_deps = [
512 "//third_party/jsoncpp",
mtklein25c81d42016-07-27 13:55:26 -0700513 ]
514}
515
516gm_sources = exec_script("gyp/find.py",
517 [
mtklein25c81d42016-07-27 13:55:26 -0700518 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700519 rebase_path("gm"),
mtklein25c81d42016-07-27 13:55:26 -0700520 ],
521 "list lines",
522 [])
523test_lib("gm") {
524 public_include_dirs = [ "gm" ]
525 sources = gm_sources
526 deps = [
527 ":gpu_tool_utils",
528 ":skia",
529 ":tool_utils",
530 ]
531}
532
mtklein2f3416d2016-08-02 16:02:05 -0700533tests_sources = exec_script("gyp/find.py",
534 [
535 "*.c*",
536 rebase_path("tests"),
537 ],
538 "list lines",
539 [])
540
541test_lib("tests") {
542 public_include_dirs = [ "tests" ]
543 sources = tests_sources - [
544 rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only
545 rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main
mtklein4db3b792016-08-03 14:18:22 -0700546 rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work
547 rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work
mtklein2f3416d2016-08-02 16:02:05 -0700548 rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile
549 rebase_path("tests/skia_test.cpp"), # alternate main
550 ]
551 deps = [
552 ":flags",
553 ":gpu_tool_utils",
554 ":skia",
555 ":tool_utils",
556 "//third_party/libpng",
557 "//third_party/zlib",
558 ]
559}
560
mtklein2b6870c2016-07-28 14:17:33 -0700561bench_sources = exec_script("gyp/find.py",
562 [
mtklein2b6870c2016-07-28 14:17:33 -0700563 "*.c*",
mtkleinada5a442016-08-02 14:28:26 -0700564 rebase_path("bench"),
mtklein2b6870c2016-07-28 14:17:33 -0700565 ],
566 "list lines",
567 [])
mtklein25c81d42016-07-27 13:55:26 -0700568
mtklein2b6870c2016-07-28 14:17:33 -0700569test_lib("bench") {
570 public_include_dirs = [ "bench" ]
571 sources = bench_sources
572 sources -= [
573 rebase_path("bench/nanobench.cpp"),
574 rebase_path("bench/nanobenchAndroid.cpp"),
575 ]
576 deps = [
577 ":flags",
578 ":gm",
579 ":gpu_tool_utils",
580 ":skia",
581 ":tool_utils",
582 ]
583}
584
fmalitaa2b9fdf2016-08-03 19:53:36 -0700585test_lib("experimental_svg_model") {
586 public_include_dirs = [ "experimental/svg/model" ]
587 sources = [
588 "experimental/svg/model/SkSVGAttribute.cpp",
589 "experimental/svg/model/SkSVGAttributeParser.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700590 "experimental/svg/model/SkSVGCircle.cpp",
anmittala7eaf2e2016-08-17 13:57:26 -0700591 "experimental/svg/model/SkSVGContainer.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700592 "experimental/svg/model/SkSVGDOM.cpp",
fmalitadc4c2a92016-08-16 15:38:51 -0700593 "experimental/svg/model/SkSVGEllipse.cpp",
fmalitad24ee142016-08-17 08:38:15 -0700594 "experimental/svg/model/SkSVGLine.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700595 "experimental/svg/model/SkSVGNode.cpp",
596 "experimental/svg/model/SkSVGPath.cpp",
fmalita5b31f322016-08-12 12:15:33 -0700597 "experimental/svg/model/SkSVGPoly.cpp",
fmalitaa2b9fdf2016-08-03 19:53:36 -0700598 "experimental/svg/model/SkSVGRect.cpp",
599 "experimental/svg/model/SkSVGRenderContext.cpp",
600 "experimental/svg/model/SkSVGSVG.cpp",
601 "experimental/svg/model/SkSVGShape.cpp",
602 "experimental/svg/model/SkSVGTransformableNode.cpp",
603 "experimental/svg/model/SkSVGValue.cpp",
604 ]
605 deps = [
606 ":skia",
607 ]
608}
609
mtklein2b6870c2016-07-28 14:17:33 -0700610if (!is_component_build) { # Our test tools use many non-SK_API APIs...
611 executable("dm") {
612 sources = [
613 "dm/DM.cpp",
614 "dm/DMJsonWriter.cpp",
615 "dm/DMSrcSink.cpp",
mtklein2b6870c2016-07-28 14:17:33 -0700616 ]
617 include_dirs = [ "tests" ]
618 deps = [
fmalitaa2b9fdf2016-08-03 19:53:36 -0700619 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -0700620 ":flags",
621 ":gm",
622 ":gpu_tool_utils",
623 ":skia",
mtklein2f3416d2016-08-02 16:02:05 -0700624 ":tests",
mtklein2b6870c2016-07-28 14:17:33 -0700625 ":tool_utils",
626 "//third_party/jsoncpp",
627 "//third_party/libpng",
628 ]
629 testonly = true
630 }
631
632 executable("monobench") {
633 sources = [
634 "tools/monobench.cpp",
635 ]
636 deps = [
637 ":bench",
638 ":skia",
639 ]
640 testonly = true
641 }
642
643 executable("nanobench") {
644 sources = [
645 "bench/nanobench.cpp",
646 ]
647 deps = [
648 ":bench",
649 ":flags",
650 ":gm",
651 ":gpu_tool_utils",
652 ":skia",
653 ":tool_utils",
654 "//third_party/jsoncpp",
655 ]
656 testonly = true
657 }
halcanary19a97202016-08-03 15:08:04 -0700658
659 executable("sktexttopdf") {
660 sources = [
661 "tools/SkShaper_harfbuzz.cpp",
662 "tools/using_skia_and_harfbuzz.cpp",
663 ]
664 deps = [
665 ":skia",
666 "//third_party/harfbuzz",
667 ]
668 testonly = true
669 }
mtklein25c81d42016-07-27 13:55:26 -0700670}