OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 import("//build/config/arm.gni") |
| 6 |
5 config("libwebp_config") { | 7 config("libwebp_config") { |
6 include_dirs = [ "." ] | 8 include_dirs = [ "." ] |
7 } | 9 } |
8 | 10 |
| 11 use_dsp_neon = (cpu_arch == "arm64" || |
| 12 (cpu_arch == "arm" && arm_version >= 7 && |
| 13 (arm_use_neon || arm_optionally_use_neon))) |
| 14 |
9 source_set("libwebp_dec") { | 15 source_set("libwebp_dec") { |
10 sources = [ | 16 sources = [ |
11 "dec/alpha.c", | 17 "dec/alpha.c", |
12 "dec/buffer.c", | 18 "dec/buffer.c", |
13 "dec/frame.c", | 19 "dec/frame.c", |
14 "dec/idec.c", | 20 "dec/idec.c", |
15 "dec/io.c", | 21 "dec/io.c", |
16 "dec/quant.c", | 22 "dec/quant.c", |
17 "dec/tree.c", | 23 "dec/tree.c", |
18 "dec/vp8.c", | 24 "dec/vp8.c", |
19 "dec/vp8l.c", | 25 "dec/vp8l.c", |
20 "dec/webp.c", | 26 "dec/webp.c", |
21 ] | 27 ] |
22 | 28 |
23 configs -= [ "//build/config/compiler:chromium_code" ] | 29 configs -= [ "//build/config/compiler:chromium_code" ] |
24 configs += [ "//build/config/compiler:no_chromium_code" ] | 30 configs += [ "//build/config/compiler:no_chromium_code" ] |
25 | 31 |
26 deps = [ | 32 deps = [ |
27 ":libwebp_dsp", | 33 ":libwebp_dsp", |
28 # TODO(GYP): | |
29 # ":libwebp_dsp_neon", | |
30 ":libwebp_utils", | 34 ":libwebp_utils", |
31 ] | 35 ] |
32 all_dependent_configs = [ | 36 all_dependent_configs = [ |
33 ":libwebp_config" | 37 ":libwebp_config" |
34 ] | 38 ] |
| 39 if (use_dsp_neon) { |
| 40 deps += [ ":libwebp_dsp_neon"] |
| 41 } |
35 } | 42 } |
36 | 43 |
37 source_set("libwebp_demux") { | 44 source_set("libwebp_demux") { |
38 sources = [ | 45 sources = [ |
39 "demux/demux.c", | 46 "demux/demux.c", |
40 ] | 47 ] |
41 all_dependent_configs = [ | 48 all_dependent_configs = [ |
42 ":libwebp_config" | 49 ":libwebp_config" |
43 ] | 50 ] |
44 configs -= [ "//build/config/compiler:chromium_code" ] | 51 configs -= [ "//build/config/compiler:chromium_code" ] |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 # ['order_profiling != 0', { | 89 # ['order_profiling != 0', { |
83 # 'target_conditions' : [ | 90 # 'target_conditions' : [ |
84 # ['_toolset=="target"', { | 91 # ['_toolset=="target"', { |
85 # 'cflags!': [ '-finstrument-functions' ], | 92 # 'cflags!': [ '-finstrument-functions' ], |
86 # }], | 93 # }], |
87 # ], | 94 # ], |
88 # }], | 95 # }], |
89 # ], | 96 # ], |
90 } | 97 } |
91 | 98 |
| 99 if (use_dsp_neon) { |
| 100 |
| 101 source_set("libwebp_dsp_neon") { |
| 102 sources = [ |
| 103 "dsp/dec_neon.c", |
| 104 "dsp/enc_neon.c", |
| 105 "dsp/lossless_neon.c", |
| 106 "dsp/upsampling_neon.c", |
| 107 ] |
| 108 |
| 109 include_dirs = [ "." ] |
| 110 |
| 111 if (cpu_arch == "arm") { |
| 112 # behavior similar to *.c.neon in an Android.mk |
| 113 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
| 114 cflags = [ "-mfpu=neon" ] |
| 115 } else if (cpu_arch == "arm64") { |
| 116 # avoid an ICE with gcc-4.9: b/15574841 |
| 117 cflags = [ "-frename-registers" ] |
| 118 } |
| 119 |
92 # TODO(GYP): | 120 # TODO(GYP): |
93 # 'variables': { | |
94 # 'neon_sources': [ | |
95 # "dsp/dec_neon.c", | |
96 # "dsp/enc_neon.c", | |
97 # "dsp/lossless_neon.c", | |
98 # "dsp/upsampling_neon.c", | |
99 # ] | |
100 # }, | |
101 # { | |
102 # 'target_name': 'libwebp_dsp_neon', | |
103 # 'conditions': [ | |
104 # ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or arm_n
eon_optional == 1)', { | |
105 # 'type': 'static_library', | |
106 # 'include_dirs': ['.'], | |
107 # 'sources': [ | |
108 # '<@(neon_sources)' | |
109 # ], | |
110 # # behavior similar to *.c.neon in an Android.mk | |
111 # 'cflags!': [ '-mfpu=vfpv3-d16' ], | |
112 # 'cflags': [ '-mfpu=neon' ], | |
113 # },{ | |
114 # 'conditions': [ | |
115 # ['target_arch == "arm64"', { | |
116 # 'type': 'static_library', | |
117 # 'include_dirs': ['.'], | |
118 # 'sources': [ | |
119 # '<@(neon_sources)' | |
120 # ], | |
121 # # avoid an ICE with gcc-4.9: b/15574841 | |
122 # 'cflags': [ '-frename-registers' ], | |
123 # },{ # "target_arch != "arm|arm64" or arm_version < 7" | |
124 # 'type': 'none', | |
125 # }], | |
126 # ], | |
127 # }], | |
128 # ['order_profiling != 0', { | 121 # ['order_profiling != 0', { |
129 # 'target_conditions' : [ | 122 # 'target_conditions' : [ |
130 # ['_toolset=="target"', { | 123 # ['_toolset=="target"', { |
131 # 'cflags!': [ '-finstrument-functions' ], | 124 # 'cflags!': [ '-finstrument-functions' ], |
132 # }], | 125 # }], |
133 # ], | 126 # ], |
134 # }], | 127 # }], |
135 # ], | 128 # ], |
136 # } | 129 # } |
| 130 } |
| 131 |
| 132 } # use_dsp_neon |
137 | 133 |
138 source_set("libwebp_enc") { | 134 source_set("libwebp_enc") { |
139 sources = [ | 135 sources = [ |
140 "enc/alpha.c", | 136 "enc/alpha.c", |
141 "enc/analysis.c", | 137 "enc/analysis.c", |
142 "enc/backward_references.c", | 138 "enc/backward_references.c", |
143 "enc/config.c", | 139 "enc/config.c", |
144 "enc/cost.c", | 140 "enc/cost.c", |
145 "enc/filter.c", | 141 "enc/filter.c", |
146 "enc/frame.c", | 142 "enc/frame.c", |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 all_dependent_configs = [ | 183 all_dependent_configs = [ |
188 ":libwebp_config" | 184 ":libwebp_config" |
189 ] | 185 ] |
190 } | 186 } |
191 | 187 |
192 group("libwebp") { | 188 group("libwebp") { |
193 deps = [ | 189 deps = [ |
194 ":libwebp_dec", | 190 ":libwebp_dec", |
195 ":libwebp_demux", | 191 ":libwebp_demux", |
196 ":libwebp_dsp", | 192 ":libwebp_dsp", |
197 # TODO(GYP): | |
198 # ":libwebp_dsp_neon", | |
199 ":libwebp_enc", | 193 ":libwebp_enc", |
200 ":libwebp_utils", | 194 ":libwebp_utils", |
201 ] | 195 ] |
202 direct_dependent_configs = [ | 196 direct_dependent_configs = [ |
203 ":libwebp_config" | 197 ":libwebp_config" |
204 ] | 198 ] |
| 199 if (use_dsp_neon) { |
| 200 deps += [ ":libwebp_dsp_neon" ] |
| 201 } |
205 } | 202 } |
OLD | NEW |