blob: f462c50e5e8fae4d1146efdcf449fcb1a3a83a36 [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',
sglez@google.coma9b79362013-07-25 14:55:18 +000018 'lua_pictures',
commit-bot@chromium.org6645cde2013-07-19 18:54:04 +000019 'bbh_shootout',
mike@reedtribe.org73d9f1c2013-06-09 01:54:56 +000020 'lua_app',
edisonn@google.com8ba9a832013-01-18 18:06:22 +000021 'pinspect',
22 'render_pdfs',
23 'render_pictures',
epoger@google.comccdbd2c2011-06-02 14:38:23 +000024 'skdiff',
zachr@google.com5b3e2b92013-07-22 18:46:45 +000025 'skpdiff',
epoger@google.comccdbd2c2011-06-02 14:38:23 +000026 'skhello',
27 'skimage',
halcanary@google.comfed30372013-10-04 12:46:45 +000028 'test_image_decoder',
epoger@google.comccdbd2c2011-06-02 14:38:23 +000029 ],
zachr@google.com28c27c82013-06-20 17:15:05 +000030 'conditions': [
31 ['skia_shared_lib',
32 {
33 'dependencies': [
34 'sklua', # This can only be built if skia is built as a shared library
35 ],
36 },
37 ],
38 ],
epoger@google.comccdbd2c2011-06-02 14:38:23 +000039 },
40 {
41 'target_name': 'skdiff',
42 'type': 'executable',
43 'sources': [
bungeman@google.come3c8ddf2012-12-05 20:13:12 +000044 '../tools/skdiff.cpp',
45 '../tools/skdiff.h',
46 '../tools/skdiff_html.cpp',
47 '../tools/skdiff_html.h',
epoger@google.comccdbd2c2011-06-02 14:38:23 +000048 '../tools/skdiff_main.cpp',
bungeman@google.come3c8ddf2012-12-05 20:13:12 +000049 '../tools/skdiff_utils.cpp',
50 '../tools/skdiff_utils.h',
51 ],
52 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +000053 'skia_lib.gyp:skia_lib',
bungeman@google.come3c8ddf2012-12-05 20:13:12 +000054 ],
55 },
56 {
zachr@google.com5b3e2b92013-07-22 18:46:45 +000057 'target_name': 'skpdiff',
58 'type': 'executable',
59 'sources': [
60 '../tools/skpdiff/skpdiff_main.cpp',
61 '../tools/skpdiff/SkDiffContext.cpp',
62 '../tools/skpdiff/SkImageDiffer.cpp',
63 '../tools/skpdiff/SkPMetric.cpp',
64 '../tools/skpdiff/skpdiff_util.cpp',
65 '../tools/flags/SkCommandLineFlags.cpp',
66 ],
67 'include_dirs': [
djsollen@google.comefc51b72013-11-12 18:29:17 +000068 '../tools/flags',
69 '../src/core/', # needed for SkTLList.h
zachr@google.com5b3e2b92013-07-22 18:46:45 +000070 ],
71 'dependencies': [
72 'skia_lib.gyp:skia_lib',
73 ],
74 'cflags': [
75 '-O3',
76 ],
77 'conditions': [
78 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]', {
79 'link_settings': {
80 'libraries': [
81 '-lrt',
82 ],
83 },
84 }],
85 ['skia_opencl', {
86 'sources': [
87 '../tools/skpdiff/SkCLImageDiffer.cpp',
88 '../tools/skpdiff/SkDifferentPixelsMetric_opencl.cpp',
89 ],
90 'conditions': [
91 [ 'skia_os == "mac"', {
92 'link_settings': {
93 'libraries': [
94 '$(SDKROOT)/System/Library/Frameworks/OpenCL.framework',
95 ]
96 }
97 }, {
98 'link_settings': {
99 'libraries': [
100 '-lOpenCL',
101 ],
102 },
103 }],
104 ],
105 }, { # !skia_opencl
106 'sources': [
107 '../tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp',
108 ],
109 }],
110 ],
111 },
112 {
bungeman@google.come3c8ddf2012-12-05 20:13:12 +0000113 'target_name': 'skimagediff',
114 'type': 'executable',
115 'sources': [
116 '../tools/skdiff.cpp',
117 '../tools/skdiff.h',
118 '../tools/skdiff_html.cpp',
119 '../tools/skdiff_html.h',
120 '../tools/skdiff_image.cpp',
121 '../tools/skdiff_utils.cpp',
122 '../tools/skdiff_utils.h',
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000123 ],
124 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000125 'skia_lib.gyp:skia_lib',
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000126 ],
127 },
128 {
129 'target_name': 'skhello',
130 'type': 'executable',
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000131 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000132 'skia_lib.gyp:skia_lib',
borenet@google.combb522882013-06-17 15:39:43 +0000133 ],
134 'conditions': [
135 [ 'skia_os == "nacl"', {
136 'sources': [
137 '../platform_tools/nacl/src/nacl_hello.cpp',
138 ],
139 }, {
140 'sources': [
141 '../tools/skhello.cpp',
142 ],
143 'dependencies': [
144 'pdf.gyp:pdf',
145 'flags.gyp:flags',
146 ],
147 }],
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000148 ],
149 },
150 {
151 'target_name': 'skimage',
152 'type': 'executable',
153 'sources': [
154 '../tools/skimage_main.cpp',
155 ],
scroggo@google.com6843bdb2013-05-08 19:14:23 +0000156 'include_dirs': [
157 # For SkBitmapHasher.h
158 '../src/utils/',
159 ],
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000160 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000161 'skia_lib.gyp:skia_lib',
scroggo@google.comb41ff952013-04-11 15:53:35 +0000162 'flags.gyp:flags',
scroggo@google.com6843bdb2013-05-08 19:14:23 +0000163 'gm.gyp:gm_expectations',
scroggo@google.com6843bdb2013-05-08 19:14:23 +0000164 'jsoncpp.gyp:jsoncpp',
165 'utils.gyp:utils',
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000166 ],
167 },
zachr@google.com28c27c82013-06-20 17:15:05 +0000168
junov@chromium.org777442d2012-06-12 14:56:36 +0000169 {
mike@reedtribe.org73d9f1c2013-06-09 01:54:56 +0000170 'target_name': 'lua_app',
171 'type': 'executable',
172 'sources': [
173 '../tools/lua/lua_app.cpp',
174 '../src/utils/SkLua.cpp',
175 ],
176 'dependencies': [
177 'skia_lib.gyp:skia_lib',
178 'effects.gyp:effects',
179 'utils.gyp:utils',
180 'images.gyp:images',
181 'pdf.gyp:pdf',
182 'ports.gyp:ports',
183 'lua.gyp:lua',
184 ],
185 },
186 {
reed@google.comdff7e112013-05-15 19:34:20 +0000187 'target_name': 'lua_pictures',
188 'type': 'executable',
189 'sources': [
190 '../tools/lua/lua_pictures.cpp',
191 '../src/utils/SkLuaCanvas.cpp',
reed@google.com74ce6f02013-05-22 15:13:18 +0000192 '../src/utils/SkLua.cpp',
reed@google.comdff7e112013-05-15 19:34:20 +0000193 ],
194 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000195 'skia_lib.gyp:skia_lib',
reed@google.comdff7e112013-05-15 19:34:20 +0000196 'effects.gyp:effects',
197 'utils.gyp:utils',
198 'images.gyp:images',
199 'tools.gyp:picture_renderer',
200 'tools.gyp:picture_utils',
mike@reedtribe.orgfb858242013-06-08 16:39:44 +0000201 'pdf.gyp:pdf',
reed@google.comdff7e112013-05-15 19:34:20 +0000202 'ports.gyp:ports',
203 'flags.gyp:flags',
204 'lua.gyp:lua',
205 ],
206 },
207 {
junov@chromium.org777442d2012-06-12 14:56:36 +0000208 'target_name': 'render_pictures',
209 'type': 'executable',
210 'sources': [
211 '../tools/render_pictures_main.cpp',
keyar@chromium.orga2333d92012-07-16 17:29:16 +0000212 ],
213 'include_dirs': [
214 '../src/pipe/utils/',
junov@chromium.org777442d2012-06-12 14:56:36 +0000215 ],
216 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000217 'skia_lib.gyp:skia_lib',
keyar@chromium.org163b5672012-08-01 17:53:29 +0000218 'tools.gyp:picture_renderer',
twiz@google.coma31b8bb2012-06-22 18:24:56 +0000219 'tools.gyp:picture_utils',
scroggo@google.comd9ba9a02013-03-21 19:43:15 +0000220 'flags.gyp:flags',
twiz@google.coma31b8bb2012-06-22 18:24:56 +0000221 ],
222 },
223 {
reed@google.com006db0f2012-06-27 19:33:29 +0000224 'target_name': 'bench_pictures',
225 'type': 'executable',
226 'sources': [
scroggo@google.com9a412522012-09-07 15:21:18 +0000227 '../bench/SkBenchLogger.h',
228 '../bench/SkBenchLogger.cpp',
229 '../bench/TimerData.h',
230 '../bench/TimerData.cpp',
keyar@chromium.orgcf6c44c2012-07-09 19:37:40 +0000231 '../tools/bench_pictures_main.cpp',
scroggo@google.com9a412522012-09-07 15:21:18 +0000232 '../tools/PictureBenchmark.cpp',
reed@google.com006db0f2012-06-27 19:33:29 +0000233 ],
234 'include_dirs': [
235 '../bench',
scroggo@google.comcc690202013-03-04 19:56:21 +0000236 '../src/lazy/',
reed@google.com006db0f2012-06-27 19:33:29 +0000237 ],
238 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000239 'skia_lib.gyp:skia_lib',
reed@google.com006db0f2012-06-27 19:33:29 +0000240 'tools.gyp:picture_utils',
keyar@chromium.org163b5672012-08-01 17:53:29 +0000241 'tools.gyp:picture_renderer',
242 'bench.gyp:bench_timer',
scroggo@google.comd9ba9a02013-03-21 19:43:15 +0000243 'flags.gyp:flags',
scroggo@google.com9a412522012-09-07 15:21:18 +0000244 ],
keyar@chromium.org163b5672012-08-01 17:53:29 +0000245 },
246 {
borenet@google.comefb1d772012-10-10 19:45:51 +0000247 'target_name': 'picture_renderer',
248 'type': 'static_library',
249 'sources': [
commit-bot@chromium.org56799e22013-07-16 18:21:46 +0000250 '../tools/LazyDecodeBitmap.cpp',
scroggo@google.com4a26d9d2012-11-07 18:01:46 +0000251 '../tools/PictureRenderer.h',
keyar@chromium.org451bb9f2012-07-26 17:27:57 +0000252 '../tools/PictureRenderer.cpp',
scroggo@google.com161e1ba2013-03-04 16:41:06 +0000253 '../tools/PictureRenderingFlags.h',
254 '../tools/PictureRenderingFlags.cpp',
scroggo@google.com4a26d9d2012-11-07 18:01:46 +0000255 '../tools/CopyTilesRenderer.h',
256 '../tools/CopyTilesRenderer.cpp',
keyar@chromium.org451bb9f2012-07-26 17:27:57 +0000257 '../src/pipe/utils/SamplePipeControllers.h',
258 '../src/pipe/utils/SamplePipeControllers.cpp',
borenet@google.comefb1d772012-10-10 19:45:51 +0000259 ],
260 'include_dirs': [
junov@chromium.org9313ca42012-11-02 18:11:49 +0000261 '../src/core/',
borenet@google.comefb1d772012-10-10 19:45:51 +0000262 '../src/pipe/utils/',
263 '../src/utils/',
264 ],
265 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000266 'skia_lib.gyp:skia_lib',
keyar@chromium.org451bb9f2012-07-26 17:27:57 +0000267 'tools.gyp:picture_utils',
scroggo@google.com09fd4d22013-03-20 14:20:18 +0000268 'flags.gyp:flags',
borenet@google.comefb1d772012-10-10 19:45:51 +0000269 ],
robertphillips@google.comfe1b5362013-02-07 19:45:46 +0000270 'conditions': [
271 ['skia_gpu == 1',
272 {
273 'include_dirs' : [
274 '../src/gpu',
275 ],
276 },
277 ],
278 ],
keyar@chromium.org451bb9f2012-07-26 17:27:57 +0000279 },
280 {
edisonn@google.comc319abe2012-11-01 19:52:38 +0000281 'target_name': 'render_pdfs',
282 'type': 'executable',
283 'sources': [
284 '../tools/render_pdfs_main.cpp',
285 '../tools/PdfRenderer.cpp',
286 '../tools/PdfRenderer.h',
287 ],
288 'include_dirs': [
289 '../src/pipe/utils/',
290 '../src/utils/',
291 ],
292 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000293 'skia_lib.gyp:skia_lib',
edisonn@google.comc319abe2012-11-01 19:52:38 +0000294 'pdf.gyp:pdf',
edisonn@google.comc319abe2012-11-01 19:52:38 +0000295 'tools.gyp:picture_utils',
296 ],
edisonn@google.com184487c2013-03-08 18:00:16 +0000297 'conditions': [
borenet@google.com2d137b62013-03-08 23:13:33 +0000298 ['skia_win_debuggers_path and skia_os == "win"',
edisonn@google.com184487c2013-03-08 18:00:16 +0000299 {
300 'dependencies': [
301 'tools.gyp:win_dbghelp',
302 ],
303 },
304 ],
305 # VS static libraries don't have a linker option. We must set a global
306 # project linker option, or add it to each executable.
307 ['skia_win_debuggers_path and skia_os == "win" and '
borenet@google.com2d137b62013-03-08 23:13:33 +0000308 'skia_arch_width == 64',
edisonn@google.com184487c2013-03-08 18:00:16 +0000309 {
310 'msvs_settings': {
311 'VCLinkerTool': {
312 'AdditionalDependencies': [
313 '<(skia_win_debuggers_path)/x64/DbgHelp.lib',
314 ],
315 },
316 },
317 },
318 ],
319 ['skia_win_debuggers_path and skia_os == "win" and '
borenet@google.com2d137b62013-03-08 23:13:33 +0000320 'skia_arch_width == 32',
edisonn@google.com184487c2013-03-08 18:00:16 +0000321 {
322 'msvs_settings': {
323 'VCLinkerTool': {
324 'AdditionalDependencies': [
325 '<(skia_win_debuggers_path)/DbgHelp.lib',
326 ],
327 },
328 },
329 },
330 ],
331 ],
edisonn@google.comc319abe2012-11-01 19:52:38 +0000332 },
333 {
twiz@google.coma31b8bb2012-06-22 18:24:56 +0000334 'target_name': 'picture_utils',
335 'type': 'static_library',
336 'sources': [
337 '../tools/picture_utils.cpp',
borenet@google.come21795e2012-09-14 14:34:28 +0000338 '../tools/picture_utils.h',
twiz@google.coma31b8bb2012-06-22 18:24:56 +0000339 ],
340 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000341 'skia_lib.gyp:skia_lib',
junov@chromium.org777442d2012-06-12 14:56:36 +0000342 ],
reed@google.come52d2912013-05-15 20:01:07 +0000343 'direct_dependent_settings': {
344 'include_dirs': [
reed@google.com9bf99c32013-05-15 20:07:22 +0000345 '../tools/',
reed@google.come52d2912013-05-15 20:01:07 +0000346 ],
347 },
junov@chromium.org777442d2012-06-12 14:56:36 +0000348 },
reed@google.com1bdf7fe2012-06-14 18:58:40 +0000349 {
350 'target_name': 'pinspect',
351 'type': 'executable',
352 'sources': [
353 '../tools/pinspect.cpp',
354 ],
355 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000356 'skia_lib.gyp:skia_lib',
commit-bot@chromium.org826ec812013-06-12 18:28:36 +0000357 'tools.gyp:picture_renderer',
commit-bot@chromium.org56799e22013-07-16 18:21:46 +0000358 'flags.gyp:flags',
reed@google.com1bdf7fe2012-06-14 18:58:40 +0000359 ],
360 },
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000361 {
commit-bot@chromium.org6645cde2013-07-19 18:54:04 +0000362 'target_name': 'bbh_shootout',
363 'type': 'executable',
364 'include_dirs': [
365 '../bench',
366 '../tools/'
367 ],
368 'sources': [
369 '../tools/bbh_shootout.cpp',
370
371 # Bench code:
372 '../bench/TimerData.h',
373 '../bench/TimerData.cpp',
374 ],
375 'dependencies': [
376 'skia_lib.gyp:skia_lib',
377 'bench.gyp:bench_timer',
378 'tools.gyp:picture_utils',
379 'tools.gyp:picture_renderer',
380 'flags.gyp:flags',
381 ],
382 },
383 {
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000384 'target_name': 'filter',
385 'type': 'executable',
386 'include_dirs' : [
387 '../src/core',
fmalita@google.com4df16732013-06-13 21:25:45 +0000388 '../src/utils/debugger',
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000389 ],
390 'sources': [
391 '../tools/filtermain.cpp',
robertphillips@google.comd3d377f2012-12-07 20:56:13 +0000392 '../tools/path_utils.h',
robertphillips@google.com3b0a9fe2013-01-31 15:56:22 +0000393 '../tools/path_utils.cpp',
fmalita@google.com86681b32013-06-13 20:59:14 +0000394 '../src/utils/debugger/SkDrawCommand.h',
395 '../src/utils/debugger/SkDrawCommand.cpp',
396 '../src/utils/debugger/SkDebugCanvas.h',
397 '../src/utils/debugger/SkDebugCanvas.cpp',
398 '../src/utils/debugger/SkObjectParser.h',
399 '../src/utils/debugger/SkObjectParser.cpp',
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000400 ],
401 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +0000402 'skia_lib.gyp:skia_lib',
djsollen@google.coma09e8832012-11-13 18:50:33 +0000403 'tools.gyp:picture_utils',
robertphillips@google.comc7e4a5a2012-10-04 13:00:33 +0000404 ],
405 },
halcanary@google.comfed30372013-10-04 12:46:45 +0000406 {
407 'target_name': 'test_image_decoder',
408 'type': 'executable',
409 'sources': [
410 '../tools/test_image_decoder.cpp',
411 ],
412 'dependencies': [
413 'skia_lib.gyp:skia_lib',
414 ],
415 },
edisonn@google.com8819d1a2013-03-08 18:43:35 +0000416 ],
417 'conditions': [
zachr@google.com28c27c82013-06-20 17:15:05 +0000418 ['skia_shared_lib',
419 {
420 'targets': [
421 {
422 'target_name': 'sklua',
423 'product_name': 'skia',
424 'product_prefix': '',
425 'product_dir': '<(PRODUCT_DIR)/',
426 'type': 'shared_library',
427 'sources': [
428 '../src/utils/SkLuaCanvas.cpp',
429 '../src/utils/SkLua.cpp',
430 ],
431 'include_dirs': [
432 '../third_party/lua/src/',
433 ],
434 'dependencies': [
435 'lua.gyp:lua',
436 'pdf.gyp:pdf',
437 'skia_lib.gyp:skia_lib',
438 ],
439 'conditions': [
440 ['skia_os != "win"',
441 {
442 'ldflags': [
443 '-Wl,-rpath,\$$ORIGIN,--enable-new-dtags',
444 ],
445 },
446 ],
447 ],
448 },
449 ],
450 },
451 ],
borenet@google.com2d137b62013-03-08 23:13:33 +0000452 ['skia_win_debuggers_path and skia_os == "win"',
edisonn@google.com8819d1a2013-03-08 18:43:35 +0000453 {
454 'targets': [
455 {
456 'target_name': 'win_dbghelp',
457 'type': 'static_library',
458 'defines': [
459 'SK_CDB_PATH="<(skia_win_debuggers_path)"',
460 ],
461 'sources': [
462 '../tools/win_dbghelp.h',
463 '../tools/win_dbghelp.cpp',
464 ],
465 },
466 ],
467 },
468 ],
bungeman@google.com07a69f82013-04-02 14:12:38 +0000469 ['skia_os == "win"',
470 {
471 'targets': [
472 {
473 'target_name': 'win_lcid',
474 'type': 'executable',
475 'sources': [
476 '../tools/win_lcid.cpp',
477 ],
478 },
479 ],
480 },
481 ],
epoger@google.comccdbd2c2011-06-02 14:38:23 +0000482 ],
483}
484
485# Local Variables:
486# tab-width:2
487# indent-tabs-mode:nil
488# End:
489# vim: set expandtab tabstop=2 shiftwidth=2: