BUILD.gn revision 0529e5d033099cbfc42635f6f6183833b09dff6e
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.
4
5config("libwebp_config") {
6  include_dirs = [ "." ]
7}
8
9source_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  ]
23  deps = [
24    ":libwebp_dsp",
25# TODO(GYP):
26#    ":libwebp_dsp_neon",
27    ":libwebp_utils",
28  ]
29  all_dependent_configs = [
30    ":libwebp_config"
31  ]
32}
33
34source_set("libwebp_demux") {
35  sources = [
36    "demux/demux.c",
37  ]
38  all_dependent_configs = [
39    ":libwebp_config"
40  ]
41}
42
43
44source_set("libwebp_dsp") {
45  sources = [
46    "dsp/cpu.c",
47    "dsp/dec.c",
48    "dsp/dec_sse2.c",
49    "dsp/enc.c",
50    "dsp/enc_sse2.c",
51    "dsp/lossless.c",
52    "dsp/upsampling.c",
53    "dsp/upsampling_sse2.c",
54    "dsp/yuv.c",
55  ]
56  all_dependent_configs = [
57    ":libwebp_config"
58  ]
59  deps = []
60  if (is_android) {
61    deps += [ "//third_party/android_tools:cpu_features" ]
62  }
63# TODO(GYP):
64#      'conditions': [
65#        ['order_profiling != 0', {
66#          'target_conditions' : [
67#            ['_toolset=="target"', {
68#              'cflags!': [ '-finstrument-functions' ],
69#            }],
70#          ],
71#        }],
72#      ],
73}
74
75# TODO(GYP):
76#    {
77#      'target_name': 'libwebp_dsp_neon',
78#      'conditions': [
79#        ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
80#          'type': 'static_library',
81#          'include_dirs': ['.'],
82#          'sources': [
83#            'dsp/dec_neon.c',
84#            'dsp/enc_neon.c',
85#            'dsp/upsampling_neon.c',
86#          ],
87#          # behavior similar to *.c.neon in an Android.mk
88#          'cflags!': [ '-mfpu=vfpv3-d16' ],
89#          'cflags': [ '-mfpu=neon' ],
90#        },{  # "target_arch != "arm" or arm_version < 7"
91#          'type': 'none',
92#        }],
93#        ['order_profiling != 0', {
94#          'target_conditions' : [
95#            ['_toolset=="target"', {
96#              'cflags!': [ '-finstrument-functions' ],
97#            }],
98#          ],
99#        }],
100#      ],
101#    },
102
103source_set("libwebp_enc") {
104  sources = [
105    "enc/alpha.c",
106    "enc/analysis.c",
107    "enc/backward_references.c",
108    "enc/config.c",
109    "enc/cost.c",
110    "enc/filter.c",
111    "enc/frame.c",
112    "enc/histogram.c",
113    "enc/iterator.c",
114    "enc/layer.c",
115    "enc/picture.c",
116    "enc/quant.c",
117    "enc/syntax.c",
118    "enc/token.c",
119    "enc/tree.c",
120    "enc/vp8l.c",
121    "enc/webpenc.c",
122  ]
123  all_dependent_configs = [
124    ":libwebp_config"
125  ]
126}
127
128source_set("libwebp_utils") {
129  sources = [
130    "utils/alpha_processing.c",
131    "utils/bit_reader.c",
132    "utils/bit_writer.c",
133    "utils/color_cache.c",
134    "utils/filters.c",
135    "utils/huffman.c",
136    "utils/huffman_encode.c",
137    "utils/quant_levels.c",
138    "utils/quant_levels_dec.c",
139    "utils/random.c",
140    "utils/rescaler.c",
141    "utils/thread.c",
142    "utils/utils.c",
143  ]
144  all_dependent_configs = [
145    ":libwebp_config"
146  ]
147}
148
149group("libwebp") {
150  deps = [
151    ":libwebp_dec",
152    ":libwebp_demux",
153    ":libwebp_dsp",
154# TODO(GYP):
155#    ":libwebp_dsp_neon",
156    ":libwebp_enc",
157    ":libwebp_utils",
158  ]
159  direct_dependent_configs = [
160    ":libwebp_config"
161  ]
162}
163