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") | 5 import("//build/config/arm.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | |
6 | 7 |
7 config("libwebp_config") { | 8 config("libwebp_config") { |
8 include_dirs = [ "." ] | 9 include_dirs = [ "." ] |
9 } | 10 } |
10 | 11 |
11 use_dsp_neon = | 12 use_dsp_neon = |
12 current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 && | 13 current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 && |
13 (arm_use_neon || arm_optionally_use_neon)) | 14 (arm_use_neon || arm_optionally_use_neon)) |
14 | 15 |
15 source_set("libwebp_dec") { | 16 source_set("libwebp_dec") { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 configs -= [ "//build/config/compiler:chromium_code" ] | 48 configs -= [ "//build/config/compiler:chromium_code" ] |
48 configs += [ "//build/config/compiler:no_chromium_code" ] | 49 configs += [ "//build/config/compiler:no_chromium_code" ] |
49 deps = [ | 50 deps = [ |
50 ":libwebp_utils", | 51 ":libwebp_utils", |
51 ] | 52 ] |
52 } | 53 } |
53 | 54 |
54 source_set("libwebp_dsp") { | 55 source_set("libwebp_dsp") { |
55 sources = [ | 56 sources = [ |
56 "dsp/alpha_processing.c", | 57 "dsp/alpha_processing.c", |
57 "dsp/alpha_processing_sse2.c", | 58 "dsp/alpha_processing_mips_dsp_r2.c", |
59 "dsp/argb.c", | |
60 "dsp/argb_mips_dsp_r2.c", | |
61 "dsp/cost.c", | |
62 "dsp/cost_mips32.c", | |
63 "dsp/cost_mips_dsp_r2.c", | |
58 "dsp/cpu.c", | 64 "dsp/cpu.c", |
59 "dsp/dec.c", | 65 "dsp/dec.c", |
60 "dsp/dec_clip_tables.c", | 66 "dsp/dec_clip_tables.c", |
61 "dsp/dec_mips32.c", | 67 "dsp/dec_mips32.c", |
62 "dsp/dec_sse2.c", | 68 "dsp/dec_mips_dsp_r2.c", |
63 "dsp/enc.c", | 69 "dsp/enc.c", |
64 "dsp/enc_avx2.c", | 70 "dsp/enc_avx2.c", |
65 "dsp/enc_mips32.c", | 71 "dsp/enc_mips32.c", |
66 "dsp/enc_sse2.c", | 72 "dsp/enc_mips_dsp_r2.c", |
73 "dsp/filters.c", | |
74 "dsp/filters_mips_dsp_r2.c", | |
67 "dsp/lossless.c", | 75 "dsp/lossless.c", |
68 "dsp/lossless_mips32.c", | 76 "dsp/lossless_enc.c", |
69 "dsp/lossless_sse2.c", | 77 "dsp/lossless_enc_mips32.c", |
78 "dsp/lossless_enc_mips_dsp_r2.c", | |
79 "dsp/lossless_mips_dsp_r2.c", | |
80 "dsp/rescaler.c", | |
81 "dsp/rescaler_mips32.c", | |
82 "dsp/rescaler_mips_dsp_r2.c", | |
70 "dsp/upsampling.c", | 83 "dsp/upsampling.c", |
71 "dsp/upsampling_sse2.c", | 84 "dsp/upsampling_mips_dsp_r2.c", |
72 "dsp/yuv.c", | 85 "dsp/yuv.c", |
73 "dsp/yuv_mips32.c", | 86 "dsp/yuv_mips32.c", |
74 "dsp/yuv_sse2.c", | 87 "dsp/yuv_mips_dsp_r2.c", |
75 ] | 88 ] |
76 configs -= [ "//build/config/compiler:chromium_code" ] | 89 configs -= [ "//build/config/compiler:chromium_code" ] |
77 configs += [ "//build/config/compiler:no_chromium_code" ] | 90 configs += [ "//build/config/compiler:no_chromium_code" ] |
78 | 91 |
79 all_dependent_configs = [ ":libwebp_config" ] | 92 all_dependent_configs = [ ":libwebp_config" ] |
80 deps = [ | 93 deps = [ |
94 ":libwebp_dsp_sse2", | |
95 ":libwebp_dsp_sse41", | |
81 ":libwebp_utils", | 96 ":libwebp_utils", |
82 ] | 97 ] |
83 if (is_android) { | 98 if (is_android) { |
84 deps += [ "//third_party/android_tools:cpu_features" ] | 99 deps += [ "//third_party/android_tools:cpu_features" ] |
85 | 100 |
86 configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] | 101 configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] |
87 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] | 102 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] |
88 } | 103 } |
104 if (current_cpu == "x86" || current_cpu == "x64") { | |
105 cflags = [ | |
106 "-DWEBP_HAVE_SSE2", | |
107 "-DWEBP_HAVE_SSE41", | |
Nico
2015/12/24 15:38:49
gn has a defines thing too: https://code.google.co
jzern
2015/12/24 17:39:22
Thanks. I didn't look around after I hit on some y
| |
108 ] | |
109 } | |
110 } | |
111 | |
112 source_set("libwebp_dsp_sse41") { | |
113 sources = [ | |
114 "dsp/alpha_processing_sse41.c", | |
115 "dsp/dec_sse41.c", | |
116 "dsp/enc_sse41.c", | |
117 "dsp/lossless_enc_sse41.c", | |
118 ] | |
119 configs -= [ "//build/config/compiler:chromium_code" ] | |
120 configs += [ "//build/config/compiler:no_chromium_code" ] | |
121 | |
122 all_dependent_configs = [ ":libwebp_config" ] | |
123 if (!is_msan) { | |
124 if ((current_cpu == "x86" || current_cpu == "x64") && | |
125 (!is_win || is_clang)) { | |
126 cflags = [ "-msse4.1" ] | |
127 } | |
128 } | |
129 } | |
130 | |
131 source_set("libwebp_dsp_sse2") { | |
132 sources = [ | |
133 "dsp/alpha_processing_sse2.c", | |
134 "dsp/argb_sse2.c", | |
135 "dsp/cost_sse2.c", | |
136 "dsp/dec_sse2.c", | |
137 "dsp/enc_sse2.c", | |
138 "dsp/filters_sse2.c", | |
139 "dsp/lossless_enc_sse2.c", | |
140 "dsp/lossless_sse2.c", | |
141 "dsp/rescaler_sse2.c", | |
142 "dsp/upsampling_sse2.c", | |
143 "dsp/yuv_sse2.c", | |
144 ] | |
145 configs -= [ "//build/config/compiler:chromium_code" ] | |
146 configs += [ "//build/config/compiler:no_chromium_code" ] | |
147 | |
148 all_dependent_configs = [ ":libwebp_config" ] | |
149 if (!is_msan) { | |
150 if ((current_cpu == "x86" || current_cpu == "x64") && | |
151 (!is_win || is_clang)) { | |
152 cflags = [ "-msse2" ] | |
Nico
2015/12/24 15:38:49
sse2 is required by chromium and passed by default
jzern
2015/12/24 17:39:22
true it was working before, I just thought I'd do
| |
153 } | |
154 } | |
89 } | 155 } |
90 | 156 |
91 if (use_dsp_neon) { | 157 if (use_dsp_neon) { |
92 source_set("libwebp_dsp_neon") { | 158 source_set("libwebp_dsp_neon") { |
93 sources = [ | 159 sources = [ |
94 "dsp/dec_neon.c", | 160 "dsp/dec_neon.c", |
95 "dsp/enc_neon.c", | 161 "dsp/enc_neon.c", |
162 "dsp/lossless_enc_neon.c", | |
96 "dsp/lossless_neon.c", | 163 "dsp/lossless_neon.c", |
164 "dsp/rescaler_neon.c", | |
97 "dsp/upsampling_neon.c", | 165 "dsp/upsampling_neon.c", |
98 ] | 166 ] |
99 | 167 |
100 include_dirs = [ "." ] | 168 include_dirs = [ "." ] |
101 | 169 |
102 if (current_cpu == "arm") { | 170 if (current_cpu == "arm") { |
103 # behavior similar to *.c.neon in an Android.mk | 171 # behavior similar to *.c.neon in an Android.mk |
104 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] | 172 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
105 cflags = [ "-mfpu=neon" ] | 173 cflags = [ "-mfpu=neon" ] |
106 } else if (current_cpu == "arm64") { | 174 } else if (current_cpu == "arm64") { |
107 # avoid an ICE with gcc-4.9: b/15574841 | 175 # avoid an ICE with gcc-4.9: b/15574841 |
108 cflags = [ "-frename-registers" ] | 176 cflags = [ "-frename-registers" ] |
109 } | 177 } |
110 | 178 |
111 if (is_android) { | 179 if (is_android) { |
112 configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] | 180 configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] |
113 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] | 181 configs += [ "//build/config/android:no_cygprofile_instrumentation" ] |
114 } | 182 } |
115 } | 183 } |
116 } # use_dsp_neon | 184 } # use_dsp_neon |
117 | 185 |
118 source_set("libwebp_enc") { | 186 source_set("libwebp_enc") { |
119 sources = [ | 187 sources = [ |
120 "enc/alpha.c", | 188 "enc/alpha.c", |
121 "enc/analysis.c", | 189 "enc/analysis.c", |
122 "enc/backward_references.c", | 190 "enc/backward_references.c", |
123 "enc/config.c", | 191 "enc/config.c", |
124 "enc/cost.c", | 192 "enc/cost.c", |
193 "enc/delta_palettization.c", | |
125 "enc/filter.c", | 194 "enc/filter.c", |
126 "enc/frame.c", | 195 "enc/frame.c", |
127 "enc/histogram.c", | 196 "enc/histogram.c", |
128 "enc/iterator.c", | 197 "enc/iterator.c", |
198 "enc/near_lossless.c", | |
129 "enc/picture.c", | 199 "enc/picture.c", |
130 "enc/picture_csp.c", | 200 "enc/picture_csp.c", |
131 "enc/picture_psnr.c", | 201 "enc/picture_psnr.c", |
132 "enc/picture_rescale.c", | 202 "enc/picture_rescale.c", |
133 "enc/picture_tools.c", | 203 "enc/picture_tools.c", |
134 "enc/quant.c", | 204 "enc/quant.c", |
135 "enc/syntax.c", | 205 "enc/syntax.c", |
136 "enc/token.c", | 206 "enc/token.c", |
137 "enc/tree.c", | 207 "enc/tree.c", |
138 "enc/vp8l.c", | 208 "enc/vp8l.c", |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 ":libwebp_demux", | 254 ":libwebp_demux", |
185 ":libwebp_dsp", | 255 ":libwebp_dsp", |
186 ":libwebp_enc", | 256 ":libwebp_enc", |
187 ":libwebp_utils", | 257 ":libwebp_utils", |
188 ] | 258 ] |
189 public_configs = [ ":libwebp_config" ] | 259 public_configs = [ ":libwebp_config" ] |
190 if (use_dsp_neon) { | 260 if (use_dsp_neon) { |
191 deps += [ ":libwebp_dsp_neon" ] | 261 deps += [ ":libwebp_dsp_neon" ] |
192 } | 262 } |
193 } | 263 } |
OLD | NEW |