blob: bea740b9d179fac0aa4146f0906b83c1892b5d74 [file] [log] [blame]
scroggo648ac532015-03-25 07:16:13 -07001# 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.
scroggo3e562272015-03-25 10:22:41 -07005# 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.
scroggo648ac532015-03-25 07:16:13 -07009
scroggof24f2242015-03-03 08:59:20 -080010# 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:*',
msarett8c8f22a2015-04-01 06:58:48 -070020 'giflib.gyp:giflib',
msarettb747b902015-11-06 11:15:49 -080021 'libjpeg-turbo-selector.gyp:libjpeg-turbo-selector',
22 'libpng.gyp:libpng',
scroggo6f5e6192015-06-18 12:53:43 -070023 'libwebp.gyp:libwebp',
scroggof24f2242015-03-03 08:59:20 -080024 ],
msarett39b2d5a2016-02-17 08:26:31 -080025 'cflags':[
26 # FIXME: This gets around a warning: "Argument might be clobbered by longjmp".
djsollenf9deeb62016-03-07 12:30:47 -080027 '-Wno-clobbered -Wno-error',
scroggo05245902015-03-25 11:11:52 -070028 ],
scroggof24f2242015-03-03 08:59:20 -080029 'include_dirs': [
30 '../include/codec',
mtkleincd1f2da2015-07-28 08:55:14 -070031 '../include/private',
scroggof24f2242015-03-03 08:59:20 -080032 '../src/codec',
msarett9bde9182015-03-25 05:27:48 -070033 '../src/core',
msaretta51e7782016-01-12 06:51:11 -080034 '../src/utils',
scroggof24f2242015-03-03 08:59:20 -080035 ],
36 'sources': [
msarett3d9d7a72015-10-21 10:27:10 -070037 '../src/codec/SkAndroidCodec.cpp',
msarettb46e5e22015-07-30 11:36:40 -070038 '../src/codec/SkBmpCodec.cpp',
msarett4ab9d5f2015-08-06 15:34:42 -070039 '../src/codec/SkBmpMaskCodec.cpp',
40 '../src/codec/SkBmpRLECodec.cpp',
41 '../src/codec/SkBmpStandardCodec.cpp',
scroggof24f2242015-03-03 08:59:20 -080042 '../src/codec/SkCodec.cpp',
msarett1a464672016-01-07 13:17:19 -080043 '../src/codec/SkGifCodec.cpp',
44 '../src/codec/SkIcoCodec.cpp',
msarette16b04a2015-04-15 07:32:19 -070045 '../src/codec/SkJpegCodec.cpp',
46 '../src/codec/SkJpegDecoderMgr.cpp',
msarettc1d03122016-03-25 08:58:55 -070047 '../src/codec/SkJpegUtility.cpp',
msarett74114382015-03-16 11:55:18 -070048 '../src/codec/SkMaskSwizzler.cpp',
49 '../src/codec/SkMasks.cpp',
msarettbe1d5552016-01-21 09:05:23 -080050 '../src/codec/SkPngCodec.cpp',
msarette6dd0042015-10-09 11:07:34 -070051 '../src/codec/SkSampler.cpp',
scroggoa3f792d2015-10-28 14:06:10 -070052 '../src/codec/SkSampledCodec.cpp',
scroggof24f2242015-03-03 08:59:20 -080053 '../src/codec/SkSwizzler.cpp',
msarett1a464672016-01-07 13:17:19 -080054 '../src/codec/SkWbmpCodec.cpp',
msarett3d9d7a72015-10-21 10:27:10 -070055 '../src/codec/SkWebpAdapterCodec.cpp',
scroggo6f5e6192015-06-18 12:53:43 -070056 '../src/codec/SkWebpCodec.cpp',
msarettedd2dcf2016-01-14 13:12:26 -080057
58 '../src/codec/SkCodecImageGenerator.cpp',
msarett8715d472016-02-17 10:02:29 -080059 '../src/ports/SkImageGenerator_skia.cpp',
scroggof24f2242015-03-03 08:59:20 -080060 ],
61 'direct_dependent_settings': {
62 'include_dirs': [
63 '../include/codec',
64 ],
65 },
msarettb747b902015-11-06 11:15:49 -080066 'defines': [
msarett39b2d5a2016-02-17 08:26:31 -080067 # 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
msarett285e7c62016-02-23 05:48:01 -080077 # appropriate version of libjpeg-turbo is present.
78 'TURBO_HAS_CROP',
msarettb747b902015-11-06 11:15:49 -080079 'TURBO_HAS_SKIP',
msarett70e418b2016-02-12 12:35:48 -080080 'TURBO_HAS_565',
msarettb747b902015-11-06 11:15:49 -080081 ],
yujieqin916de9f2016-01-25 08:26:16 -080082 'conditions': [
scroggo1497f9f2016-02-02 11:56:33 -080083 ['skia_codec_decodes_raw', {
yujieqin916de9f2016-01-25 08:26:16 -080084 '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
scroggo1497f9f2016-02-02 11:56:33 -080091 # controlled by skia_codec_decodes_raw flag.
yujieqin916de9f2016-01-25 08:26:16 -080092 '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 ],
yujieqin076d83d2016-01-27 08:25:53 -0800104 '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 },
yujieqin916de9f2016-01-25 08:26:16 -0800111 '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 ],
yujieqin916de9f2016-01-25 08:26:16 -0800125 },
yujieqin916de9f2016-01-25 08:26:16 -0800126 '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 ],
scroggof24f2242015-03-03 08:59:20 -0800139 },
140 ],
141}