Home | History | Annotate | Download | only in gyp
      1 # Copyright 2015 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     # GYP file to build various tools.
      6 #
      7 # To build on Linux:
      8 #  ./gyp_skia tools.gyp && make tools
      9 #
     10 {
     11   'includes': [
     12     'apptype_console.gypi',
     13   ],
     14   'targets': [
     15     {
     16       # Build all executable targets defined below.
     17       'target_name': 'tools',
     18       'type': 'none',
     19       'dependencies': [
     20         'chrome_fuzz',
     21         'dump_record',
     22         'get_images_from_skps',
     23         'gpuveto',
     24         'imgblur',
     25         'imgconv',
     26         'imgslice',
     27         'lua_app',
     28         'lua_pictures',
     29         'pinspect',
     30         'skdiff',
     31         'skhello',
     32         'skpinfo',
     33         'skpmaker',
     34         'test_image_decoder',
     35         'test_public_includes',
     36         'whitelist_typefaces',
     37       ],
     38       'conditions': [
     39         ['skia_shared_lib',
     40           {
     41             'dependencies': [
     42               'sklua', # This can only be built if skia is built as a shared library
     43             ],
     44           },
     45         ],
     46         [ 'skia_os == "android"',
     47           {
     48             'dependencies': [
     49                # Build this by default to catch compile errors more quickly, since
     50                # the only other time this code is exercised in the android framework
     51               'android_utils',
     52             ],
     53           },
     54         ],
     55       ],
     56     },
     57     {
     58       'target_name': 'android_utils',
     59       'type': 'static_library',
     60       'dependencies': [
     61         'core.gyp:core',
     62       ],
     63       'sources': [
     64         '../tools/android/SkAndroidSDKCanvas.h',
     65         '../tools/android/SkAndroidSDKCanvas.cpp',
     66       ],
     67       'direct_dependent_settings': {
     68         'include_dirs': [
     69           '../tools/android',
     70         ],
     71       },
     72     },
     73     {
     74         'target_name': 'dump_record',
     75         'type': 'executable',
     76         'sources': [
     77             '../tools/dump_record.cpp',
     78             '../tools/DumpRecord.cpp',
     79          ],
     80          'include_dirs': [
     81             '../include/private',
     82             '../src/core',
     83          ],
     84          'dependencies': [
     85             'flags.gyp:flags',
     86             'skia_lib.gyp:skia_lib',
     87          ],
     88     },
     89     {
     90       'target_name': 'chrome_fuzz',
     91       'type': 'executable',
     92       'sources': [
     93         '../tools/chrome_fuzz.cpp',
     94       ],
     95       'dependencies': [
     96         'skia_lib.gyp:skia_lib',
     97       ],
     98     },
     99     {
    100       'target_name': 'crash_handler',
    101         'type': 'static_library',
    102         'sources': [ '../tools/CrashHandler.cpp' ],
    103         'dependencies': [ 'skia_lib.gyp:skia_lib' ],
    104         'direct_dependent_settings': {
    105           'include_dirs': [ '../tools' ],
    106         },
    107         'conditions': [
    108           [ 'skia_is_bot', {
    109             'defines': [ 'SK_CRASH_HANDLER' ],
    110           }],
    111         ],
    112 
    113         'all_dependent_settings': {
    114           'msvs_settings': {
    115             'VCLinkerTool': {
    116               'AdditionalDependencies': [ 'Dbghelp.lib' ],
    117             }
    118           },
    119         }
    120     },
    121     {
    122       'target_name': 'resources',
    123       'type': 'static_library',
    124       'sources': [ '../tools/Resources.cpp' ],
    125       'dependencies': [
    126         'flags.gyp:flags',
    127         'skia_lib.gyp:skia_lib',
    128       ],
    129       'direct_dependent_settings': {
    130         'include_dirs': [ '../tools', ],
    131       },
    132     },
    133     {
    134       'target_name': 'sk_tool_utils',
    135       'type': 'static_library',
    136       'sources': [
    137         '../tools/sk_tool_utils.cpp',
    138         '../tools/sk_tool_utils_font.cpp',
    139         '../tools/random_parse_path.cpp',
    140       ],
    141       'include_dirs': [
    142         '../include/private',
    143         '../src/fonts',
    144         '../src/core',
    145       ],
    146       'dependencies': [
    147         'resources',
    148         'flags.gyp:flags',
    149         'skia_lib.gyp:skia_lib',
    150       ],
    151       'direct_dependent_settings': {
    152         'include_dirs': [ '../tools', ],
    153       },
    154     },
    155     {
    156       'target_name' : 'timer',
    157       'type': 'static_library',
    158       'sources': [ '../tools/timer/Timer.cpp' ],
    159       'direct_dependent_settings': {
    160         'include_dirs': ['../tools/timer'],
    161       },
    162       'dependencies': [ 'skia_lib.gyp:skia_lib' ],
    163     },
    164     {
    165       'target_name': 'skdiff',
    166       'type': 'executable',
    167       'sources': [
    168         '../tools/skdiff.cpp',
    169         '../tools/skdiff.h',
    170         '../tools/skdiff_html.cpp',
    171         '../tools/skdiff_html.h',
    172         '../tools/skdiff_main.cpp',
    173         '../tools/skdiff_utils.cpp',
    174         '../tools/skdiff_utils.h',
    175       ],
    176       'dependencies': [
    177         'skia_lib.gyp:skia_lib',
    178       ],
    179     },
    180     {
    181       'target_name': 'skpmaker',
    182       'type': 'executable',
    183       'sources': [
    184         '../tools/skpmaker.cpp',
    185       ],
    186       'include_dirs': [
    187         '../include/private',
    188         '../src/core',
    189       ],
    190       'dependencies': [
    191         'flags.gyp:flags',
    192         'skia_lib.gyp:skia_lib',
    193       ],
    194     },
    195     {
    196       'target_name': 'skimagediff',
    197       'type': 'executable',
    198       'sources': [
    199         '../tools/skdiff.cpp',
    200         '../tools/skdiff.h',
    201         '../tools/skdiff_html.cpp',
    202         '../tools/skdiff_html.h',
    203         '../tools/skdiff_image.cpp',
    204         '../tools/skdiff_utils.cpp',
    205         '../tools/skdiff_utils.h',
    206       ],
    207       'dependencies': [
    208         'skia_lib.gyp:skia_lib',
    209       ],
    210     },
    211     {
    212       'target_name': 'skhello',
    213       'type': 'executable',
    214       'dependencies': [
    215         'flags.gyp:flags',
    216         'pdf.gyp:pdf',
    217         'skia_lib.gyp:skia_lib',
    218       ],
    219       'sources': [
    220         '../tools/skhello.cpp',
    221       ],
    222     },
    223     {
    224       'target_name': 'skpinfo',
    225       'type': 'executable',
    226       'sources': [
    227         '../tools/skpinfo.cpp',
    228       ],
    229       'include_dirs': [
    230         '../include/private',
    231         '../src/core/',
    232       ],
    233       'dependencies': [
    234         'flags.gyp:flags',
    235         'skia_lib.gyp:skia_lib',
    236       ],
    237     },
    238     {
    239       'target_name': 'imgblur',
    240       'type': 'executable',
    241       'sources': [
    242         '../tools/imgblur.cpp',
    243       ],
    244       'include_dirs': [
    245         '../include/core',
    246       ],
    247       'dependencies': [
    248         'flags.gyp:flags',
    249         'flags.gyp:flags_common',
    250         'skia_lib.gyp:skia_lib',
    251         'tools.gyp:sk_tool_utils',
    252       ],
    253     },
    254     {
    255       'target_name': 'imgslice',
    256       'type': 'executable',
    257       'sources': [
    258         '../tools/imgslice.cpp',
    259       ],
    260       'include_dirs': [
    261         '../include/core',
    262       ],
    263       'dependencies': [
    264         'flags.gyp:flags',
    265         'skia_lib.gyp:skia_lib',
    266       ],
    267     },
    268     {
    269         'target_name': 'get_images_from_skps',
    270         'type': 'executable',
    271         'sources': [
    272             '../tools/get_images_from_skps.cpp',
    273          ],
    274          'dependencies': [
    275             'flags.gyp:flags',
    276             'skia_lib.gyp:skia_lib',
    277          ],
    278     },
    279     {
    280       'target_name': 'gpuveto',
    281       'type': 'executable',
    282       'sources': [
    283         '../tools/gpuveto.cpp',
    284       ],
    285       'include_dirs': [
    286         '../include/private',
    287         '../src/core/',
    288         '../src/images',
    289       ],
    290       'dependencies': [
    291         'flags.gyp:flags',
    292         'skia_lib.gyp:skia_lib',
    293       ],
    294     },
    295     {
    296       'target_name': 'lua_app',
    297       'type': 'executable',
    298       'sources': [
    299         '../tools/lua/lua_app.cpp',
    300         '../src/utils/SkLua.cpp',
    301       ],
    302       'include_dirs': [
    303         '../include/private',
    304         # Lua exposes GrReduceClip which in turn requires src/core for SkTLList
    305         '../src/gpu/',
    306         '../src/core/',
    307       ],
    308       'dependencies': [
    309         'effects.gyp:effects',
    310         'images.gyp:images',
    311         'lua.gyp:lua',
    312         'pdf.gyp:pdf',
    313         'ports.gyp:ports',
    314         'skia_lib.gyp:skia_lib',
    315       ],
    316     },
    317     {
    318       'target_name': 'lua_pictures',
    319       'type': 'executable',
    320       'sources': [
    321         '../tools/lua/lua_pictures.cpp',
    322         '../src/utils/SkLuaCanvas.cpp',
    323         '../src/utils/SkLua.cpp',
    324       ],
    325       'include_dirs': [
    326         '../include/private',
    327         # Lua exposes GrReduceClip which in turn requires src/core for SkTLList
    328         '../src/gpu/',
    329         '../src/core/',
    330       ],
    331       'dependencies': [
    332         'effects.gyp:effects',
    333         'flags.gyp:flags',
    334         'images.gyp:images',
    335         'lua.gyp:lua',
    336         'tools.gyp:picture_utils',
    337         'pdf.gyp:pdf',
    338         'ports.gyp:ports',
    339         'skia_lib.gyp:skia_lib',
    340       ],
    341     },
    342     {
    343       'target_name': 'picture_utils',
    344       'type': 'static_library',
    345       'sources': [
    346         '../tools/picture_utils.cpp',
    347         '../tools/picture_utils.h',
    348       ],
    349       'dependencies': [
    350         'skia_lib.gyp:skia_lib',
    351       ],
    352       'direct_dependent_settings': {
    353         'include_dirs': [
    354           '../tools/',
    355         ],
    356       },
    357     },
    358     {
    359       'target_name': 'pinspect',
    360       'type': 'executable',
    361       'sources': [
    362         '../tools/pinspect.cpp',
    363       ],
    364       'dependencies': [
    365         'flags.gyp:flags',
    366         'skia_lib.gyp:skia_lib',
    367       ],
    368     },
    369     {
    370       'target_name': 'imgconv',
    371       'type': 'executable',
    372       'sources': [
    373         '../tools/imgconv.cpp',
    374       ],
    375       'dependencies': [
    376         'flags.gyp:flags',
    377         'skia_lib.gyp:skia_lib',
    378       ],
    379     },
    380     {
    381       'target_name': 'test_image_decoder',
    382       'type': 'executable',
    383       'sources': [
    384         '../tools/test_image_decoder.cpp',
    385       ],
    386       'dependencies': [
    387         'skia_lib.gyp:skia_lib',
    388       ],
    389     },
    390     {
    391       'target_name': 'proc_stats',
    392       'type': 'static_library',
    393       'sources': [
    394         '../tools/ProcStats.h',
    395         '../tools/ProcStats.cpp',
    396       ],
    397       'direct_dependent_settings': {
    398         'include_dirs': [ '../tools', ],
    399       },
    400     },
    401     {
    402       'target_name': 'url_data_manager',
    403       'type': 'static_library',
    404       'sources': [
    405         '../tools/UrlDataManager.h',
    406         '../tools/UrlDataManager.cpp',
    407       ],
    408       'dependencies': [
    409         'skia_lib.gyp:skia_lib',
    410       ],
    411       'include_dirs': [
    412          '../include/private',
    413          '../src/core',
    414       ],
    415       'direct_dependent_settings': {
    416         'include_dirs': [
    417           '../include/private',
    418           '../tools', 
    419         ],
    420       },
    421     },
    422     {
    423       'target_name': 'whitelist_typefaces',
    424       'type': 'executable',
    425       'sources': [
    426         '../tools/whitelist_typefaces.cpp',
    427       ],
    428       'dependencies': [
    429         'skia_lib.gyp:skia_lib',
    430       ],
    431     },
    432     {
    433       'target_name': 'thermal_manager',
    434       'type': 'static_library',
    435       'sources': [
    436         '../tools/ThermalManager.cpp',
    437       ],
    438       'dependencies': [
    439         'skia_lib.gyp:skia_lib',
    440       ],
    441       'direct_dependent_settings': {
    442         'include_dirs': [ '../tools', ],
    443       },
    444     },
    445     {
    446       'target_name': 'test_public_includes',
    447       'type': 'static_library',
    448       # Ensure that our public headers don't have unused params so that clients
    449       # (e.g. Android) that include us can build with these warnings enabled
    450       'cflags!': [ '-Wno-unused-parameter' ],
    451       'variables': {
    452         'includes_to_test': [
    453           '<(skia_include_path)/android',
    454           '<(skia_include_path)/animator',
    455           '<(skia_include_path)/c',
    456           '<(skia_include_path)/codec',
    457           '<(skia_include_path)/config',
    458           '<(skia_include_path)/core',
    459           '<(skia_include_path)/effects',
    460           '<(skia_include_path)/gpu',
    461           '<(skia_include_path)/images',
    462           '<(skia_include_path)/pathops',
    463           '<(skia_include_path)/ports',
    464           '<(skia_include_path)/svg/parser',
    465           '<(skia_include_path)/utils',
    466           '<(skia_include_path)/views',
    467           '<(skia_include_path)/xml',
    468         ],
    469         'paths_to_ignore': [
    470           '<(skia_include_path)/gpu/gl/GrGLConfig_chrome.h',
    471           '<(skia_include_path)/ports/SkFontMgr_fontconfig.h',
    472           '<(skia_include_path)/ports/SkTypeface_mac.h',
    473           '<(skia_include_path)/ports/SkTypeface_win.h',
    474           '<(skia_include_path)/utils/ios',
    475           '<(skia_include_path)/utils/mac',
    476           '<(skia_include_path)/utils/win',
    477           '<(skia_include_path)/utils/SkDebugUtils.h',
    478           '<(skia_include_path)/utils/SkJSONCPP.h',
    479           '<(skia_include_path)/views/animated',
    480           '<(skia_include_path)/views/SkOSWindow_Android.h',
    481           '<(skia_include_path)/views/SkOSWindow_iOS.h',
    482           '<(skia_include_path)/views/SkOSWindow_Mac.h',
    483           '<(skia_include_path)/views/SkOSWindow_SDL.h',
    484           '<(skia_include_path)/views/SkOSWindow_Unix.h',
    485           '<(skia_include_path)/views/SkOSWindow_Win.h',
    486           '<(skia_include_path)/views/SkWindow.h',
    487           '<(skia_include_path)/gpu/vk',
    488         ],
    489       },
    490       'include_dirs': [
    491         '<@(includes_to_test)',
    492       ],
    493       'sources': [
    494         # unused_param_test.cpp is generated by the action below.
    495         '<(INTERMEDIATE_DIR)/test_public_includes.cpp',
    496       ],
    497       'actions': [
    498         {
    499           'action_name': 'generate_includes_cpp',
    500           'inputs': [
    501             '../tools/generate_includes_cpp.py',
    502             '<@(includes_to_test)',
    503             # This causes the gyp generator on mac to fail
    504             #'<@(paths_to_ignore)',
    505           ],
    506           'outputs': [
    507             '<(INTERMEDIATE_DIR)/test_public_includes.cpp',
    508           ],
    509           'action': ['python', '../tools/generate_includes_cpp.py',
    510                                '--ignore', '<(paths_to_ignore)',
    511                                '<@(_outputs)', '<@(includes_to_test)'],
    512         },
    513       ],
    514     },
    515   ],
    516   'conditions': [
    517     ['skia_shared_lib',
    518       {
    519         'targets': [
    520           {
    521             'target_name': 'sklua',
    522             'product_name': 'skia',
    523             'product_prefix': '',
    524             'product_dir': '<(PRODUCT_DIR)/',
    525             'type': 'shared_library',
    526             'sources': [
    527               '../src/utils/SkLuaCanvas.cpp',
    528               '../src/utils/SkLua.cpp',
    529             ],
    530             'include_dirs': [
    531               '../include/private',
    532               # Lua exposes GrReduceClip which in turn requires src/core for SkTLList
    533               '../src/gpu/',
    534               '../src/core/',
    535               '../third_party/lua/src/',
    536             ],
    537             'dependencies': [
    538               'lua.gyp:lua',
    539               'pdf.gyp:pdf',
    540               'skia_lib.gyp:skia_lib',
    541             ],
    542             'conditions': [
    543               ['skia_os != "win"',
    544                 {
    545                   'ldflags': [
    546                     '-Wl,-rpath,\$$ORIGIN,--enable-new-dtags',
    547                   ],
    548                 },
    549               ],
    550             ],
    551           },
    552         ],
    553       },
    554     ],
    555     ['skia_win_debuggers_path and skia_os == "win"',
    556       {
    557         'targets': [
    558           {
    559             'target_name': 'win_dbghelp',
    560             'type': 'static_library',
    561             'defines': [
    562               'SK_CDB_PATH="<(skia_win_debuggers_path)"',
    563             ],
    564             'sources': [
    565               '../tools/win_dbghelp.h',
    566               '../tools/win_dbghelp.cpp',
    567             ],
    568           },
    569         ],
    570       },
    571     ],
    572     ['skia_os == "win"',
    573       {
    574         'targets': [
    575           {
    576             'target_name': 'win_lcid',
    577             'type': 'executable',
    578             'sources': [
    579               '../tools/win_lcid.cpp',
    580             ],
    581           },
    582         ],
    583       },
    584     ],
    585     ['skia_os == "mac"',
    586       {
    587         'targets': [
    588           {
    589             'target_name': 'create_test_font',
    590             'type': 'executable',
    591             'sources': [
    592               '../tools/create_test_font.cpp',
    593             ],
    594             'include_dirs': [
    595               '../include/private',
    596               '../src/core',
    597             ],
    598             'dependencies': [
    599               'flags.gyp:flags',
    600               'skia_lib.gyp:skia_lib',
    601               'resources',
    602             ],
    603           },
    604         ],
    605       },
    606     ],
    607   ],
    608 }
    609