Roll DEPS for libelf clang compilation fix.
[chromium-blink-merge.git] / third_party / libwebp / BUILD.gn
blob48e548ed698d3533685b7e8e8e50a144271f9e6b
1 # Copyright 2014 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.
5 config("libwebp_config") {
6   include_dirs = [ "." ]
9 source_set("libwebp_dec") {
10   sources = [
11     "dec/alpha.c",
12     "dec/buffer.c",
13     "dec/frame.c",
14     "dec/idec.c",
15     "dec/io.c",
16     "dec/layer.c",
17     "dec/quant.c",
18     "dec/tree.c",
19     "dec/vp8.c",
20     "dec/vp8l.c",
21     "dec/webp.c",
22   ]
24   configs -= [ "//build/config/compiler:chromium_code" ]
25   configs += [ "//build/config/compiler:no_chromium_code" ]
27   deps = [
28     ":libwebp_dsp",
29 # TODO(GYP):
30 #    ":libwebp_dsp_neon",
31     ":libwebp_utils",
32   ]
33   all_dependent_configs = [
34     ":libwebp_config"
35   ]
38 source_set("libwebp_demux") {
39   sources = [
40     "demux/demux.c",
41   ]
42   all_dependent_configs = [
43     ":libwebp_config"
44   ]
48 source_set("libwebp_dsp") {
49   sources = [
50     "dsp/cpu.c",
51     "dsp/dec.c",
52     "dsp/dec_sse2.c",
53     "dsp/enc.c",
54     "dsp/enc_sse2.c",
55     "dsp/lossless.c",
56     "dsp/upsampling.c",
57     "dsp/upsampling_sse2.c",
58     "dsp/yuv.c",
59   ]
60   configs -= [ "//build/config/compiler:chromium_code" ]
61   configs += [ "//build/config/compiler:no_chromium_code" ]
63   all_dependent_configs = [
64     ":libwebp_config"
65   ]
66   deps = []
67   if (is_android) {
68     deps += [ "//third_party/android_tools:cpu_features" ]
69   }
70 # TODO(GYP):
71 #      'conditions': [
72 #        ['order_profiling != 0', {
73 #          'target_conditions' : [
74 #            ['_toolset=="target"', {
75 #              'cflags!': [ '-finstrument-functions' ],
76 #            }],
77 #          ],
78 #        }],
79 #      ],
82 # TODO(GYP):
83 #    {
84 #      'target_name': 'libwebp_dsp_neon',
85 #      'conditions': [
86 #        ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
87 #          'type': 'static_library',
88 #          'include_dirs': ['.'],
89 #          'sources': [
90 #            'dsp/dec_neon.c',
91 #            'dsp/enc_neon.c',
92 #            'dsp/upsampling_neon.c',
93 #          ],
94 #          # behavior similar to *.c.neon in an Android.mk
95 #          'cflags!': [ '-mfpu=vfpv3-d16' ],
96 #          'cflags': [ '-mfpu=neon' ],
97 #        },{  # "target_arch != "arm" or arm_version < 7"
98 #          'type': 'none',
99 #        }],
100 #        ['order_profiling != 0', {
101 #          'target_conditions' : [
102 #            ['_toolset=="target"', {
103 #              'cflags!': [ '-finstrument-functions' ],
104 #            }],
105 #          ],
106 #        }],
107 #      ],
108 #    },
110 source_set("libwebp_enc") {
111   sources = [
112     "enc/alpha.c",
113     "enc/analysis.c",
114     "enc/backward_references.c",
115     "enc/config.c",
116     "enc/cost.c",
117     "enc/filter.c",
118     "enc/frame.c",
119     "enc/histogram.c",
120     "enc/iterator.c",
121     "enc/layer.c",
122     "enc/picture.c",
123     "enc/quant.c",
124     "enc/syntax.c",
125     "enc/token.c",
126     "enc/tree.c",
127     "enc/vp8l.c",
128     "enc/webpenc.c",
129   ]
130   configs -= [ "//build/config/compiler:chromium_code" ]
131   configs += [ "//build/config/compiler:no_chromium_code" ]
133   all_dependent_configs = [
134     ":libwebp_config"
135   ]
138 source_set("libwebp_utils") {
139   sources = [
140     "utils/alpha_processing.c",
141     "utils/bit_reader.c",
142     "utils/bit_writer.c",
143     "utils/color_cache.c",
144     "utils/filters.c",
145     "utils/huffman.c",
146     "utils/huffman_encode.c",
147     "utils/quant_levels.c",
148     "utils/quant_levels_dec.c",
149     "utils/random.c",
150     "utils/rescaler.c",
151     "utils/thread.c",
152     "utils/utils.c",
153   ]
154   configs -= [ "//build/config/compiler:chromium_code" ]
155   configs += [ "//build/config/compiler:no_chromium_code" ]
157   all_dependent_configs = [
158     ":libwebp_config"
159   ]
162 group("libwebp") {
163   deps = [
164     ":libwebp_dec",
165     ":libwebp_demux",
166     ":libwebp_dsp",
167 # TODO(GYP):
168 #    ":libwebp_dsp_neon",
169     ":libwebp_enc",
170     ":libwebp_utils",
171   ]
172   direct_dependent_configs = [
173     ":libwebp_config"
174   ]