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 # Copyright 2015 Google Inc.
      6 #
      7 # Use of this source code is governed by a BSD-style license that can be
      8 # found in the LICENSE file.
      9 
     10 # GYP file for codec project.
     11 {
     12   'targets': [
     13     {
     14       'target_name': 'codec',
     15       'product_name': 'skia_codec',
     16       'type': 'static_library',
     17       'standalone_static_library': 1,
     18       'dependencies': [
     19         'core.gyp:*',
     20         'giflib.gyp:giflib',
     21         'libjpeg-turbo-selector.gyp:libjpeg-turbo-selector',
     22         'libpng.gyp:libpng',
     23         'libwebp.gyp:libwebp',
     24       ],
     25       'cflags':[   
     26         # FIXME: This gets around a warning: "Argument might be clobbered by longjmp". 
     27         '-Wno-clobbered -Wno-error',   
     28       ],
     29       'include_dirs': [
     30         '../include/codec',
     31         '../include/private',
     32         '../src/codec',
     33         '../src/core',
     34         '../src/utils',
     35       ],
     36       'sources': [
     37         '../src/codec/SkAndroidCodec.cpp',
     38         '../src/codec/SkBmpCodec.cpp',
     39         '../src/codec/SkBmpMaskCodec.cpp',
     40         '../src/codec/SkBmpRLECodec.cpp',
     41         '../src/codec/SkBmpStandardCodec.cpp',
     42         '../src/codec/SkCodec.cpp',
     43         '../src/codec/SkGifCodec.cpp',
     44         '../src/codec/SkIcoCodec.cpp',
     45         '../src/codec/SkJpegCodec.cpp',
     46         '../src/codec/SkJpegDecoderMgr.cpp',
     47         '../src/codec/SkJpegUtility_codec.cpp',
     48         '../src/codec/SkMaskSwizzler.cpp',
     49         '../src/codec/SkMasks.cpp',
     50         '../src/codec/SkPngCodec.cpp',
     51         '../src/codec/SkSampler.cpp',
     52         '../src/codec/SkSampledCodec.cpp',
     53         '../src/codec/SkSwizzler.cpp',
     54         '../src/codec/SkWbmpCodec.cpp',
     55         '../src/codec/SkWebpAdapterCodec.cpp',
     56         '../src/codec/SkWebpCodec.cpp',
     57 
     58         '../src/codec/SkCodecImageGenerator.cpp',
     59         '../src/ports/SkImageGenerator_skia.cpp',
     60       ],
     61       'direct_dependent_settings': {
     62         'include_dirs': [
     63           '../include/codec',
     64         ],
     65       },
     66       'defines': [
     67         # Turn on all of the codecs, since we know that we have all of the
     68         # necessary dependencies.  Clients that are missing some of the
     69         # required decoding libraries may choose to turn the codecs on or
     70         # off individually.
     71         'SK_CODEC_DECODES_GIF',
     72         'SK_CODEC_DECODES_JPEG',
     73         'SK_CODEC_DECODES_PNG',
     74         'SK_CODEC_DECODES_WEBP',
     75 
     76         # Turn on libjpeg-turbo optimizations since we know that the
     77         # appropriate version of libjpeg-turbo is present.
     78         'TURBO_HAS_CROP',
     79         'TURBO_HAS_SKIP',
     80         'TURBO_HAS_565',
     81       ],
     82       'conditions': [
     83         ['skia_codec_decodes_raw', {
     84           'dependencies': [
     85             'raw_codec',
     86           ],
     87         },],
     88       ],
     89     }, {
     90       # RAW codec needs exceptions. Due to that, it is a separate target. Its usage can be
     91       # controlled by skia_codec_decodes_raw flag.
     92       'target_name': 'raw_codec',
     93       'product_name': 'raw_codec',
     94       'type': 'static_library',
     95       'dependencies': [
     96         'core.gyp:*',
     97         'dng_sdk.gyp:dng_sdk-selector',
     98         'libjpeg-turbo-selector.gyp:libjpeg-turbo-selector',
     99         'piex.gyp:piex-selector',
    100       ],
    101       'cflags':[
    102         '-fexceptions',
    103       ],
    104       'msvs_settings': {
    105         'VCCLCompilerTool': {
    106           # Need this because we are handling exception in SkRawCodec, which will trigger warning
    107           # C4530. Add this flag as suggested by the compiler.
    108           'AdditionalOptions': ['/EHsc', ],
    109         },
    110       },
    111       'include_dirs': [
    112         '../include/codec',
    113         '../include/private',
    114         '../src/codec',
    115         '../src/core',
    116       ],
    117       'sources': [
    118         '../src/codec/SkRawAdapterCodec.cpp',
    119         '../src/codec/SkRawCodec.cpp',
    120       ],
    121       'direct_dependent_settings': {
    122         'include_dirs': [
    123           '../include/codec',
    124         ],
    125       },
    126       'conditions': [
    127         ['skia_arch_type == "x86" or skia_arch_type == "arm"', {
    128           'defines': [
    129             'qDNGBigEndian=0',
    130           ],
    131         }],
    132         ['skia_os == "ios" or skia_os == "mac"', {
    133           'xcode_settings': {
    134             'OTHER_CFLAGS': ['-fexceptions'],
    135             'OTHER_CPLUSPLUSFLAGS': ['-fexceptions'],
    136           },
    137         }],
    138         ['skia_os == "chromeos"', {
    139           'link_settings': {
    140             'libraries': ['-lrt', ],
    141           },
    142         }],
    143       ],
    144     },
    145   ],
    146 }
    147