blob: f460ee38ae02a240b783a945283a5fbbc4c04746 [file] [log] [blame]
epoger@google.comccdbd2c2011-06-02 14:38:23 +00001# GYP file to build various tools.
2#
3# To build on Linux:
4# ./gyp_skia tools.gyp && make tools
5#
epoger@google.comccdbd2c2011-06-02 14:38:23 +00006{
7 'includes': [
8 'apptype_console.gypi',
epoger@google.comccdbd2c2011-06-02 14:38:23 +00009 ],
10 'targets': [
11 {
12 # Build all executable targets defined below.
13 'target_name': 'tools',
14 'type': 'none',
15 'dependencies': [
edisonn@google.com8ba9a832013-01-18 18:06:22 +000016 'bench_pictures',
17 'filter',
commit-bot@chromium.org6645cde2013-07-19 18:54:04 +000018 'bbh_shootout',
mike@reedtribe.org73d9f1c2013-06-09 01:54:56 +000019 'lua_app',
edisonn@google.com8ba9a832013-01-18 18:06:22 +000020 'pinspect',
21 'render_pdfs',
22 'render_pictures',
epoger@google.comccdbd2c2011-06-02 14:38:23 +000023 'skdiff',
zachr@google.com5b3e2b92013-07-22 18:46:45 +000024 'skpdiff',
epoger@google.comccdbd2c2011-06-02 14:38:23 +000025 'skhello',
26 'skimage',
27 ],
zachr@google.com28c27c82013-06-20 17:15:05 +000028 'conditions': [
29 ['skia_shared_lib',
30 {
31 'dependencies': [
32 'sklua', # This can only be built if skia is built as a shared library
33 ],
34 },
35 ],
36 ],
epoger@google.comccdbd2c2011-06-02 14:38:23 +000037 },
38 {
39 'target_name': 'skdiff',
40 'type': 'executable',
41 'sources': [
bungeman@google.come3c8ddf2012-12-05 20:13:12 +000042 '../tools/skdiff.cpp',
43 '../tools/skdiff.h',
44 '../tools/skdiff_html.cpp',
45 '../tools/skdiff_html.h',
epoger@google.comccdbd2c2011-06-02 14:38:23 +000046 '../tools/skdiff_main.cpp',
bungeman@google.come3c8ddf2012-12-05 20:13:12 +000047 '../tools/skdiff_utils.cpp',
48 '../tools/skdiff_utils.h',
49 ],
50 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +000051 'skia_lib.gyp:skia_lib',
bungeman@google.come3c8ddf2012-12-05 20:13:12 +000052 ],
53 },
54 {
zachr@google.com5b3e2b92013-07-22 18:46:45 +000055 'target_name': 'skpdiff',
56 'type': 'executable',
57 'sources': [
58 '../tools/skpdiff/skpdiff_main.cpp',
59 '../tools/skpdiff/SkDiffContext.cpp',
60 '../tools/skpdiff/SkImageDiffer.cpp',
61 '../tools/skpdiff/SkPMetric.cpp',
62 '../tools/skpdiff/skpdiff_util.cpp',
63 '../tools/flags/SkCommandLineFlags.cpp',
64 ],
65 'include_dirs': [
66 '../tools/flags'
67 ],
68 'dependencies': [
69 'skia_lib.gyp:skia_lib',
70 ],
71 'cflags': [
72 '-O3',
73 ],
74 'conditions': [
75 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', {
76 'link_settings': {
77 'libraries': [
78 '-lrt',
79 ],
80 },
81 }],
82 ['skia_opencl', {
83 'sources': [
84 '../tools/skpdiff/SkCLImageDiffer.cpp',
85 '../tools/skpdiff/SkDifferentPixelsMetric_opencl.cpp',
86 ],
87 'conditions': [
88 [ 'skia_os == "mac"', {
89 'link_settings': {
90 'libraries': [
91 '$(SDKROOT)/System/Library/Frameworks/OpenCL.framework',
92 ]
93 }
94 }, {
95 'link_settings': {
96 'libraries': [
97 '-lOpenCL',
98 ],
99 },
100 }],
101 ],
102 }, { # !skia_opencl
103 'sources': [
104 '../tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp',
105 ],
106 }],
107 ],
108 },
109 {
bungeman@google.come3c8ddf2012-12-05 20:13:12 +0000110 'target_name': 'skimagediff',
111 'type': 'executable',
112 'sources': [
113 '../tools/skdiff.cpp',
114 '../tools/skdiff.h',
115 '../tools/skdiff_html.cpp',
116 '../tools/skdiff_html.h',
117 '../tools/skdiff_image.cpp',
118 '../tools/skdiff_utils.cpp',
119 '../tools/skdiff_utils.h',
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000120 ],
121 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000122 'skia_lib.gyp:skia_lib',
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000123 ],
124 },
125 {
126 'target_name': 'skhello',
127 'type': 'executable',
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000128 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000129 'skia_lib.gyp:skia_lib',
borenet@google.combb522882013-06-17 15:39:43 +0000130 ],
131 'conditions': [
132 [ 'skia_os == "nacl"', {
133 'sources': [
134 '../platform_tools/nacl/src/nacl_hello.cpp',
135 ],
136 }, {
137 'sources': [
138 '../tools/skhello.cpp',
139 ],
140 'dependencies': [
141 'pdf.gyp:pdf',
142 'flags.gyp:flags',
143 ],
144 }],
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000145 ],
146 },
147 {
148 'target_name': 'skimage',
149 'type': 'executable',
150 'sources': [
151 '../tools/skimage_main.cpp',
152 ],
scroggo@google.com6843bdb2013-05-08 19:14:23 +0000153 'include_dirs': [
154 # For SkBitmapHasher.h
155 '../src/utils/',
156 ],
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000157 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000158 'skia_lib.gyp:skia_lib',
scroggo@google.comb41ff952013-04-11 15:53:35 +0000159 'flags.gyp:flags',
scroggo@google.com6843bdb2013-05-08 19:14:23 +0000160 'gm.gyp:gm_expectations',
scroggo@google.com6843bdb2013-05-08 19:14:23 +0000161 'jsoncpp.gyp:jsoncpp',
162 'utils.gyp:utils',
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000163 ],
164 },
zachr@google.com28c27c82013-06-20 17:15:05 +0000165
junov@chromium.org777442d2012-06-12 14:56:36 +0000166 {
mike@reedtribe.org73d9f1c2013-06-09 01:54:56 +0000167 'target_name': 'lua_app',
168 'type': 'executable',
169 'sources': [
170 '../tools/lua/lua_app.cpp',
171 '../src/utils/SkLua.cpp',
172 ],
173 'dependencies': [
174 'skia_lib.gyp:skia_lib',
175 'effects.gyp:effects',
176 'utils.gyp:utils',
177 'images.gyp:images',
178 'pdf.gyp:pdf',
179 'ports.gyp:ports',
180 'lua.gyp:lua',
181 ],
182 },
183 {
reed@google.comdff7e112013-05-15 19:34:20 +0000184 'target_name': 'lua_pictures',
185 'type': 'executable',
186 'sources': [
187 '../tools/lua/lua_pictures.cpp',
188 '../src/utils/SkLuaCanvas.cpp',
reed@google.com74ce6f02013-05-22 15:13:18 +0000189 '../src/utils/SkLua.cpp',
reed@google.comdff7e112013-05-15 19:34:20 +0000190 ],
191 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000192 'skia_lib.gyp:skia_lib',
reed@google.comdff7e112013-05-15 19:34:20 +0000193 'effects.gyp:effects',
194 'utils.gyp:utils',
195 'images.gyp:images',
196 'tools.gyp:picture_renderer',
197 'tools.gyp:picture_utils',
mike@reedtribe.orgfb858242013-06-08 16:39:44 +0000198 'pdf.gyp:pdf',
reed@google.comdff7e112013-05-15 19:34:20 +0000199 'ports.gyp:ports',
200 'flags.gyp:flags',
201 'lua.gyp:lua',
202 ],
203 },
204 {
junov@chromium.org777442d2012-06-12 14:56:36 +0000205 'target_name': 'render_pictures',
206 'type': 'executable',
207 'sources': [
208 '../tools/render_pictures_main.cpp',
keyar@chromium.orga2333d92012-07-16 17:29:16 +0000209 ],
210 'include_dirs': [
211 '../src/pipe/utils/',
junov@chromium.org777442d2012-06-12 14:56:36 +0000212 ],
213 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000214 'skia_lib.gyp:skia_lib',
keyar@chromium.org163b5672012-08-01 17:53:29 +0000215 'tools.gyp:picture_renderer',
twiz@google.coma31b8bb2012-06-22 18:24:56 +0000216 'tools.gyp:picture_utils',
scroggo@google.comd9ba9a02013-03-21 19:43:15 +0000217 'flags.gyp:flags',
twiz@google.coma31b8bb2012-06-22 18:24:56 +0000218 ],
219 },
220 {
reed@google.com006db0f2012-06-27 19:33:29 +0000221 'target_name': 'bench_pictures',
222 'type': 'executable',
223 'sources': [
scroggo@google.com9a412522012-09-07 15:21:18 +0000224 '../bench/SkBenchLogger.h',
225 '../bench/SkBenchLogger.cpp',
226 '../bench/TimerData.h',
227 '../bench/TimerData.cpp',
keyar@chromium.orgcf6c44c2012-07-09 19:37:40 +0000228 '../tools/bench_pictures_main.cpp',
scroggo@google.com9a412522012-09-07 15:21:18 +0000229 '../tools/PictureBenchmark.cpp',
reed@google.com006db0f2012-06-27 19:33:29 +0000230 ],
231 'include_dirs': [
232 '../bench',
scroggo@google.comcc690202013-03-04 19:56:21 +0000233 '../src/lazy/',
reed@google.com006db0f2012-06-27 19:33:29 +0000234 ],
235 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000236 'skia_lib.gyp:skia_lib',
reed@google.com006db0f2012-06-27 19:33:29 +0000237 'tools.gyp:picture_utils',
keyar@chromium.org163b5672012-08-01 17:53:29 +0000238 'tools.gyp:picture_renderer',
239 'bench.gyp:bench_timer',
scroggo@google.comd9ba9a02013-03-21 19:43:15 +0000240 'flags.gyp:flags',
scroggo@google.com9a412522012-09-07 15:21:18 +0000241 ],
keyar@chromium.org163b5672012-08-01 17:53:29 +0000242 },
243 {
borenet@google.comefb1d772012-10-10 19:45:51 +0000244 'target_name': 'picture_renderer',
245 'type': 'static_library',
246 'sources': [
commit-bot@chromium.org56799e22013-07-16 18:21:46 +0000247 '../tools/LazyDecodeBitmap.cpp',
scroggo@google.com4a26d9d2012-11-07 18:01:46 +0000248 '../tools/PictureRenderer.h',
keyar@chromium.org451bb9f2012-07-26 17:27:57 +0000249 '../tools/PictureRenderer.cpp',
scroggo@google.com161e1ba2013-03-04 16:41:06 +0000250 '../tools/PictureRenderingFlags.h',
251 '../tools/PictureRenderingFlags.cpp',
scroggo@google.com4a26d9d2012-11-07 18:01:46 +0000252 '../tools/CopyTilesRenderer.h',
253 '../tools/CopyTilesRenderer.cpp',
keyar@chromium.org451bb9f2012-07-26 17:27:57 +0000254 '../src/pipe/utils/SamplePipeControllers.h',
255 '../src/pipe/utils/SamplePipeControllers.cpp',
borenet@google.comefb1d772012-10-10 19:45:51 +0000256 ],
257 'include_dirs': [
junov@chromium.org9313ca42012-11-02 18:11:49 +0000258 '../src/core/',
borenet@google.comefb1d772012-10-10 19:45:51 +0000259 '../src/pipe/utils/',
260 '../src/utils/',
261 ],
262 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000263 'skia_lib.gyp:skia_lib',
keyar@chromium.org451bb9f2012-07-26 17:27:57 +0000264 'tools.gyp:picture_utils',
scroggo@google.com09fd4d22013-03-20 14:20:18 +0000265 'flags.gyp:flags',
borenet@google.comefb1d772012-10-10 19:45:51 +0000266 ],
robertphillips@google.comfe1b5362013-02-07 19:45:46 +0000267 'conditions': [
268 ['skia_gpu == 1',
269 {
270 'include_dirs' : [
271 '../src/gpu',
272 ],
273 },
274 ],
275 ],
keyar@chromium.org451bb9f2012-07-26 17:27:57 +0000276 },
277 {
edisonn@google.comc319abe2012-11-01 19:52:38 +0000278 'target_name': 'render_pdfs',
279 'type': 'executable',
280 'sources': [
281 '../tools/render_pdfs_main.cpp',
282 '../tools/PdfRenderer.cpp',
283 '../tools/PdfRenderer.h',
284 ],
285 'include_dirs': [
286 '../src/pipe/utils/',
287 '../src/utils/',
288 ],
289 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000290 'skia_lib.gyp:skia_lib',
edisonn@google.comc319abe2012-11-01 19:52:38 +0000291 'pdf.gyp:pdf',
edisonn@google.comc319abe2012-11-01 19:52:38 +0000292 'tools.gyp:picture_utils',
293 ],
edisonn@google.com184487c2013-03-08 18:00:16 +0000294 'conditions': [
borenet@google.com2d137b62013-03-08 23:13:33 +0000295 ['skia_win_debuggers_path and skia_os == "win"',
edisonn@google.com184487c2013-03-08 18:00:16 +0000296 {
297 'dependencies': [
298 'tools.gyp:win_dbghelp',
299 ],
300 },
301 ],
302 # VS static libraries don't have a linker option. We must set a global
303 # project linker option, or add it to each executable.
304 ['skia_win_debuggers_path and skia_os == "win" and '
borenet@google.com2d137b62013-03-08 23:13:33 +0000305 'skia_arch_width == 64',
edisonn@google.com184487c2013-03-08 18:00:16 +0000306 {
307 'msvs_settings': {
308 'VCLinkerTool': {
309 'AdditionalDependencies': [
310 '<(skia_win_debuggers_path)/x64/DbgHelp.lib',
311 ],
312 },
313 },
314 },
315 ],
316 ['skia_win_debuggers_path and skia_os == "win" and '
borenet@google.com2d137b62013-03-08 23:13:33 +0000317 'skia_arch_width == 32',
edisonn@google.com184487c2013-03-08 18:00:16 +0000318 {
319 'msvs_settings': {
320 'VCLinkerTool': {
321 'AdditionalDependencies': [
322 '<(skia_win_debuggers_path)/DbgHelp.lib',
323 ],
324 },
325 },
326 },
327 ],
328 ],
edisonn@google.comc319abe2012-11-01 19:52:38 +0000329 },
330 {
twiz@google.coma31b8bb2012-06-22 18:24:56 +0000331 'target_name': 'picture_utils',
332 'type': 'static_library',
333 'sources': [
334 '../tools/picture_utils.cpp',
borenet@google.come21795e2012-09-14 14:34:28 +0000335 '../tools/picture_utils.h',
twiz@google.coma31b8bb2012-06-22 18:24:56 +0000336 ],
337 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000338 'skia_lib.gyp:skia_lib',
junov@chromium.org777442d2012-06-12 14:56:36 +0000339 ],
reed@google.come52d2912013-05-15 20:01:07 +0000340 'direct_dependent_settings': {
341 'include_dirs': [
reed@google.com9bf99c32013-05-15 20:07:22 +0000342 '../tools/',
reed@google.come52d2912013-05-15 20:01:07 +0000343 ],
344 },
junov@chromium.org777442d2012-06-12 14:56:36 +0000345 },
reed@google.com1bdf7fe2012-06-14 18:58:40 +0000346 {
347 'target_name': 'pinspect',
348 'type': 'executable',
349 'sources': [
350 '../tools/pinspect.cpp',
351 ],
352 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000353 'skia_lib.gyp:skia_lib',
commit-bot@chromium.org826ec812013-06-12 18:28:36 +0000354 'tools.gyp:picture_renderer',
commit-bot@chromium.org56799e22013-07-16 18:21:46 +0000355 'flags.gyp:flags',
reed@google.com1bdf7fe2012-06-14 18:58:40 +0000356 ],
357 },
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000358 {
commit-bot@chromium.org6645cde2013-07-19 18:54:04 +0000359 'target_name': 'bbh_shootout',
360 'type': 'executable',
361 'include_dirs': [
362 '../bench',
363 '../tools/'
364 ],
365 'sources': [
366 '../tools/bbh_shootout.cpp',
367
368 # Bench code:
369 '../bench/TimerData.h',
370 '../bench/TimerData.cpp',
371 ],
372 'dependencies': [
373 'skia_lib.gyp:skia_lib',
374 'bench.gyp:bench_timer',
375 'tools.gyp:picture_utils',
376 'tools.gyp:picture_renderer',
377 'flags.gyp:flags',
378 ],
379 },
380 {
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000381 'target_name': 'filter',
382 'type': 'executable',
383 'include_dirs' : [
384 '../src/core',
fmalita@google.com4df16732013-06-13 21:25:45 +0000385 '../src/utils/debugger',
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000386 ],
387 'sources': [
388 '../tools/filtermain.cpp',
robertphillips@google.comd3d377f2012-12-07 20:56:13 +0000389 '../tools/path_utils.h',
robertphillips@google.com3b0a9fe2013-01-31 15:56:22 +0000390 '../tools/path_utils.cpp',
fmalita@google.com86681b32013-06-13 20:59:14 +0000391 '../src/utils/debugger/SkDrawCommand.h',
392 '../src/utils/debugger/SkDrawCommand.cpp',
393 '../src/utils/debugger/SkDebugCanvas.h',
394 '../src/utils/debugger/SkDebugCanvas.cpp',
395 '../src/utils/debugger/SkObjectParser.h',
396 '../src/utils/debugger/SkObjectParser.cpp',
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000397 ],
398 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000399 'skia_lib.gyp:skia_lib',
djsollen@google.coma09e8832012-11-13 18:50:33 +0000400 'tools.gyp:picture_utils',
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000401 ],
402 },
edisonn@google.com8819d1a2013-03-08 18:43:35 +0000403 ],
404 'conditions': [
zachr@google.com28c27c82013-06-20 17:15:05 +0000405 ['skia_shared_lib',
406 {
407 'targets': [
408 {
409 'target_name': 'sklua',
410 'product_name': 'skia',
411 'product_prefix': '',
412 'product_dir': '<(PRODUCT_DIR)/',
413 'type': 'shared_library',
414 'sources': [
415 '../src/utils/SkLuaCanvas.cpp',
416 '../src/utils/SkLua.cpp',
417 ],
418 'include_dirs': [
419 '../third_party/lua/src/',
420 ],
421 'dependencies': [
422 'lua.gyp:lua',
423 'pdf.gyp:pdf',
424 'skia_lib.gyp:skia_lib',
425 ],
426 'conditions': [
427 ['skia_os != "win"',
428 {
429 'ldflags': [
430 '-Wl,-rpath,\$$ORIGIN,--enable-new-dtags',
431 ],
432 },
433 ],
434 ],
435 },
436 ],
437 },
438 ],
borenet@google.com2d137b62013-03-08 23:13:33 +0000439 ['skia_win_debuggers_path and skia_os == "win"',
edisonn@google.com8819d1a2013-03-08 18:43:35 +0000440 {
441 'targets': [
442 {
443 'target_name': 'win_dbghelp',
444 'type': 'static_library',
445 'defines': [
446 'SK_CDB_PATH="<(skia_win_debuggers_path)"',
447 ],
448 'sources': [
449 '../tools/win_dbghelp.h',
450 '../tools/win_dbghelp.cpp',
451 ],
452 },
453 ],
454 },
455 ],
bungeman@google.com07a69f82013-04-02 14:12:38 +0000456 ['skia_os == "win"',
457 {
458 'targets': [
459 {
460 'target_name': 'win_lcid',
461 'type': 'executable',
462 'sources': [
463 '../tools/win_lcid.cpp',
464 ],
465 },
466 ],
467 },
468 ],
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000469 ],
470}
471
472# Local Variables:
473# tab-width:2
474# indent-tabs-mode:nil
475# End:
476# vim: set expandtab tabstop=2 shiftwidth=2: