Home | History | Annotate | Download | only in gyp
      1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 {
      6   'variables': {
      7     'skia_warnings_as_errors': 0,
      8     'conditions':[
      9       ['skia_android_framework == 1', {
     10         'use_system_libwebp': 1,
     11       }, {
     12         'use_system_libwebp%': 0,
     13       }],
     14     ],
     15   },
     16   'conditions': [
     17     ['use_system_libwebp==0', {
     18       'targets': [
     19         {
     20           'target_name': 'libwebp_dec',
     21           'type': 'static_library',
     22           'include_dirs': [
     23               '../third_party/externals/libwebp',
     24           ],
     25           'sources': [
     26             '../third_party/externals/libwebp/src/dec/alpha.c',
     27             '../third_party/externals/libwebp/src/dec/buffer.c',
     28             '../third_party/externals/libwebp/src/dec/frame.c',
     29             '../third_party/externals/libwebp/src/dec/idec.c',
     30             '../third_party/externals/libwebp/src/dec/io.c',
     31             '../third_party/externals/libwebp/src/dec/layer.c',
     32             '../third_party/externals/libwebp/src/dec/quant.c',
     33             '../third_party/externals/libwebp/src/dec/tree.c',
     34             '../third_party/externals/libwebp/src/dec/vp8.c',
     35             '../third_party/externals/libwebp/src/dec/vp8l.c',
     36             '../third_party/externals/libwebp/src/dec/webp.c',
     37           ],
     38           'cflags': [ '-w' ],
     39         },
     40         {
     41           'target_name': 'libwebp_demux',
     42           'type': 'static_library',
     43           'include_dirs': [
     44               '../third_party/externals/libwebp',
     45           ],
     46           'sources': [
     47             '../third_party/externals/libwebp/src/demux/demux.c',
     48           ],
     49           'cflags': [ '-w' ],
     50         },
     51         {
     52           'target_name': 'libwebp_dsp',
     53           'type': 'static_library',
     54           'include_dirs': [
     55               '../third_party/externals/libwebp',
     56           ],
     57           'sources': [
     58             '../third_party/externals/libwebp/src/dsp/cpu.c',
     59             '../third_party/externals/libwebp/src/dsp/dec.c',
     60             '../third_party/externals/libwebp/src/dsp/dec_sse2.c',
     61             '../third_party/externals/libwebp/src/dsp/enc.c',
     62             '../third_party/externals/libwebp/src/dsp/enc_sse2.c',
     63             '../third_party/externals/libwebp/src/dsp/lossless.c',
     64             '../third_party/externals/libwebp/src/dsp/upsampling.c',
     65             '../third_party/externals/libwebp/src/dsp/upsampling_sse2.c',
     66             '../third_party/externals/libwebp/src/dsp/yuv.c',
     67           ],
     68           'cflags': [ '-w' ],
     69           'conditions': [
     70             ['skia_os == "android"', {
     71               'dependencies' : [
     72                 'android_deps.gyp:cpu_features',
     73               ],
     74             }],
     75           ],
     76         },
     77         {
     78           'target_name': 'libwebp_dsp_neon',
     79           'conditions': [
     80             ['arm_version >= 7', {
     81               'type': 'static_library',
     82               'include_dirs': [
     83                   '../third_party/externals/libwebp',
     84               ],
     85               'sources': [
     86                 '../third_party/externals/libwebp/src/dsp/dec_neon.c',
     87                 '../third_party/externals/libwebp/src/dsp/enc_neon.c',
     88                 '../third_party/externals/libwebp/src/dsp/upsampling_neon.c',
     89               ],
     90               # behavior similar dsp_neon.c.neon in an Android.mk
     91               'cflags!': [
     92                 '-mfpu=vfpv3-d16',
     93               ],
     94               'cflags': [ '-mfpu=neon', '-w' ],
     95             },{  # !(arm_version >= 7)
     96               'type': 'none',
     97             }],
     98           ],
     99         },
    100         {
    101           'target_name': 'libwebp_enc',
    102           'type': 'static_library',
    103           'include_dirs': [
    104               '../third_party/externals/libwebp',
    105           ],
    106           'sources': [
    107             '../third_party/externals/libwebp/src/enc/alpha.c',
    108             '../third_party/externals/libwebp/src/enc/analysis.c',
    109             '../third_party/externals/libwebp/src/enc/backward_references.c',
    110             '../third_party/externals/libwebp/src/enc/config.c',
    111             '../third_party/externals/libwebp/src/enc/cost.c',
    112             '../third_party/externals/libwebp/src/enc/filter.c',
    113             '../third_party/externals/libwebp/src/enc/frame.c',
    114             '../third_party/externals/libwebp/src/enc/histogram.c',
    115             '../third_party/externals/libwebp/src/enc/iterator.c',
    116             '../third_party/externals/libwebp/src/enc/layer.c',
    117             '../third_party/externals/libwebp/src/enc/picture.c',
    118             '../third_party/externals/libwebp/src/enc/quant.c',
    119             '../third_party/externals/libwebp/src/enc/syntax.c',
    120             '../third_party/externals/libwebp/src/enc/token.c',
    121             '../third_party/externals/libwebp/src/enc/tree.c',
    122             '../third_party/externals/libwebp/src/enc/vp8l.c',
    123             '../third_party/externals/libwebp/src/enc/webpenc.c',
    124           ],
    125           'cflags': [ '-w' ],
    126         },
    127         {
    128           'target_name': 'libwebp_utils',
    129           'type': 'static_library',
    130           'include_dirs': [
    131               '../third_party/externals/libwebp',
    132           ],
    133           'sources': [
    134             '../third_party/externals/libwebp/src/utils/bit_reader.c',
    135             '../third_party/externals/libwebp/src/utils/bit_writer.c',
    136             '../third_party/externals/libwebp/src/utils/color_cache.c',
    137             '../third_party/externals/libwebp/src/utils/filters.c',
    138             '../third_party/externals/libwebp/src/utils/huffman.c',
    139             '../third_party/externals/libwebp/src/utils/huffman_encode.c',
    140             '../third_party/externals/libwebp/src/utils/quant_levels.c',
    141             '../third_party/externals/libwebp/src/utils/quant_levels_dec.c',
    142             '../third_party/externals/libwebp/src/utils/rescaler.c',
    143             '../third_party/externals/libwebp/src/utils/thread.c',
    144             '../third_party/externals/libwebp/src/utils/utils.c',
    145           ],
    146           'cflags': [ '-w' ],
    147         },
    148         {
    149           'target_name': 'libwebp',
    150           'type': 'none',
    151           'dependencies' : [
    152             'libwebp_dec',
    153             'libwebp_demux',
    154             'libwebp_dsp',
    155             'libwebp_dsp_neon',
    156             'libwebp_enc',
    157             'libwebp_utils',
    158           ],
    159           'direct_dependent_settings': {
    160             'include_dirs': [
    161               '../third_party/externals/libwebp/src',
    162             ],
    163             'cflags': [
    164               '-Wno-unused-function',  # In C++11 mode, we get this warning when including decode.h.
    165             ]
    166           },
    167           'conditions': [
    168             ['OS!="win"', {'product_name': 'webp'}],
    169           ],
    170         },
    171       ],
    172     }, {
    173       # use_system_libwep == 1
    174       'targets': [
    175         {
    176           'target_name': 'libwebp',
    177           'type': 'none',
    178           'conditions': [
    179             [ 'skia_android_framework', {
    180               'direct_dependent_settings': {
    181                 'libraries': [
    182                   'libwebp-decode.a',
    183                   'libwebp-encode.a',
    184                 ],
    185               'include_dirs': [
    186                 'external/webp/include',
    187               ],
    188               },
    189             }, { # skia_android_framework == 0
    190               'direct_dependent_settings': {
    191                 'defines': [
    192                   'ENABLE_WEBP',
    193                 ],
    194                 },
    195                 'link_settings': {
    196                   'libraries': [
    197                     '-lwebp',
    198                   ],
    199                 },
    200               },
    201             ],
    202           ],
    203         }
    204       ],
    205     }],
    206   ],
    207 }
    208