aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp/codec.gyp
blob: 51ee97f750c50b560a5adda96fd0334985532a36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# GYP file for codec project.
{
  'targets': [
    {
      'target_name': 'codec',
      'product_name': 'skia_codec',
      'type': 'static_library',
      'standalone_static_library': 1,
      'dependencies': [
        'core.gyp:*',
        'libjpeg-turbo-selector.gyp:libjpeg-turbo-selector',
        'libpng.gyp:libpng',
        'libwebp.gyp:libwebp',
      ],
      'include_dirs': [
        '../include/codec',
        '../include/private',
        '../src/codec',
        '../src/core',
        '../src/utils',
        '../third_party/gif',
      ],
      'sources': [
        '../src/codec/SkAndroidCodec.cpp',
        '../src/codec/SkBmpCodec.cpp',
        '../src/codec/SkBmpMaskCodec.cpp',
        '../src/codec/SkBmpRLECodec.cpp',
        '../src/codec/SkBmpStandardCodec.cpp',
        '../src/codec/SkCodec.cpp',
        '../src/codec/SkGifCodec.cpp',
        '../src/codec/SkIcoCodec.cpp',
        '../src/codec/SkJpegCodec.cpp',
        '../src/codec/SkJpegDecoderMgr.cpp',
        '../src/codec/SkJpegUtility.cpp',
        '../src/codec/SkMaskSwizzler.cpp',
        '../src/codec/SkMasks.cpp',
        '../src/codec/SkPngCodec.cpp',
        '../src/codec/SkSampler.cpp',
        '../src/codec/SkSampledCodec.cpp',
        '../src/codec/SkStreamBuffer.cpp',
        '../src/codec/SkSwizzler.cpp',
        '../src/codec/SkWbmpCodec.cpp',
        '../src/codec/SkWebpAdapterCodec.cpp',
        '../src/codec/SkWebpCodec.cpp',

        '../src/codec/SkCodecImageGenerator.cpp',
        '../src/ports/SkImageGenerator_skia.cpp',

        '../third_party/gif/SkGifImageReader.cpp',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '../include/codec',
        ],
      },
      'conditions': [
        ['skia_codec_decodes_raw', {
          'dependencies': [
            'raw_codec',
          ],
        },],
      ],
    }, {
      # RAW codec needs exceptions. Due to that, it is a separate target. Its usage can be
      # controlled by skia_codec_decodes_raw flag.
      'target_name': 'raw_codec',
      'product_name': 'raw_codec',
      'type': 'static_library',
      'dependencies': [
        'core.gyp:*',
        'dng_sdk.gyp:dng_sdk-selector',
        'libjpeg-turbo-selector.gyp:libjpeg-turbo-selector',
        'piex.gyp:piex-selector',
      ],
      'cflags':[
        '-fexceptions',
      ],
      'msvs_settings': {
        'VCCLCompilerTool': {
          # Need this because we are handling exception in SkRawCodec, which will trigger warning
          # C4530. Add this flag as suggested by the compiler.
          'AdditionalOptions': ['/EHsc', ],
        },
      },
      'include_dirs': [
        '../include/codec',
        '../include/private',
        '../src/codec',
        '../src/core',
      ],
      'sources': [
        '../src/codec/SkRawAdapterCodec.cpp',
        '../src/codec/SkRawCodec.cpp',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '../include/codec',
        ],
      },
      'conditions': [
        ['skia_arch_type == "x86" or skia_arch_type == "arm"', {
          'defines': [
            'qDNGBigEndian=0',
          ],
        }],
        ['skia_os == "ios" or skia_os == "mac"', {
          'xcode_settings': {
            'OTHER_CFLAGS': ['-fexceptions'],
            'OTHER_CPLUSPLUSFLAGS': ['-fexceptions'],
          },
        }],
      ],
    },
  ],
}