Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: third_party/opus/BUILD.gn

Issue 890473002: Add build targets for Opus tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a GN config for test programs. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/opus/opus.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/mips.gni") 6 import("//build/config/mips.gni")
7 7
8 # If fixed point implementation shall be used (otherwise float). 8 # If fixed point implementation shall be used (otherwise float).
9 # TODO(wtc): change "mipselx" to "mipsel" in this file when the compilation 9 # TODO(wtc): change "mipselx" to "mipsel" in this file when the compilation
10 # errors in the MIPS optimizations are fixed. 10 # errors in the MIPS optimizations are fixed.
11 use_opus_fixed_point = 11 use_opus_fixed_point =
12 cpu_arch == "arm" || cpu_arch == "arm64" || cpu_arch == "mipselx" 12 cpu_arch == "arm" || cpu_arch == "arm64" || cpu_arch == "mipselx"
13 13
14 # If ARM optimizations shall be used to accelerate performance. 14 # If ARM optimizations shall be used to accelerate performance.
15 use_opus_arm_optimization = cpu_arch == "arm" 15 use_opus_arm_optimization = cpu_arch == "arm"
16 16
17 # If MIPS optimizations shall be used to accelerate performance. 17 # If MIPS optimizations shall be used to accelerate performance.
18 use_opus_mips_optimization = cpu_arch == "mipselx" 18 use_opus_mips_optimization = cpu_arch == "mipselx"
19 19
20 # If OPUS Run Time CPU Detections (RTCD) shall be used. 20 # If OPUS Run Time CPU Detections (RTCD) shall be used.
21 # Based on the conditions in celt/arm/armcpu.c: 21 # Based on the conditions in celt/arm/armcpu.c:
22 # defined(_MSC_VER) || defined(__linux__). 22 # defined(_MSC_VER) || defined(__linux__).
23 use_opus_rtcd = cpu_arch == "arm" && (is_win || is_android || is_linux) 23 use_opus_rtcd = cpu_arch == "arm" && (is_win || is_android || is_linux)
24 24
25 config("opus_config") { 25 config("opus_config") {
26 include_dirs = [ "src/include" ] 26 include_dirs = [ "src/include" ]
27 } 27 }
28 28
29 config("opus_test_config") {
30 include_dirs = [
31 "src/celt",
32 "src/silk",
33 ]
34
35 if (is_win) {
36 defines = [ "inline=__inline" ]
37 }
38 if (is_android) {
39 libs = [ "log" ]
40 }
41 if (is_clang) {
42 cflags = [ "-Wno-absolute-value" ]
43 }
44 }
45
29 if (use_opus_rtcd) { 46 if (use_opus_rtcd) {
30 action("convert_rtcd_assembler") { 47 action("convert_rtcd_assembler") {
31 script = "convert_rtcd_assembler.py" 48 script = "convert_rtcd_assembler.py"
32 outputs = [ 49 outputs = [
33 "$target_gen_dir/celt_pitch_xcorr_arm_gnu.S", 50 "$target_gen_dir/celt_pitch_xcorr_arm_gnu.S",
34 ] 51 ]
35 args = [ 52 args = [
36 rebase_path("//third_party/opus/src/celt/arm/arm2gnu.pl", root_build_dir), 53 rebase_path("//third_party/opus/src/celt/arm/arm2gnu.pl", root_build_dir),
37 rebase_path("//third_party/opus/src/celt/arm/celt_pitch_xcorr_arm.s", 54 rebase_path("//third_party/opus/src/celt/arm/celt_pitch_xcorr_arm.s",
38 root_build_dir), 55 root_build_dir),
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 ] 183 ]
167 } 184 }
168 } 185 }
169 186
170 executable("opus_compare") { 187 executable("opus_compare") {
171 sources = [ 188 sources = [
172 "src/src/opus_compare.c", 189 "src/src/opus_compare.c",
173 ] 190 ]
174 191
175 configs -= [ "//build/config/compiler:chromium_code" ] 192 configs -= [ "//build/config/compiler:chromium_code" ]
176 configs += [ "//build/config/compiler:no_chromium_code" ] 193 configs += [
177 194 "//build/config/compiler:no_chromium_code",
178 include_dirs = [ 195 ":opus_test_config",
179 "src/celt",
180 "src/silk",
181 ] 196 ]
182 197
183 if (is_win) {
184 defines = [ "inline=__inline" ]
185 }
186 if (is_android) {
187 libs = [ "log" ]
188 }
189 if (is_clang) {
190 cflags = [ "-Wno-absolute-value" ]
191 }
192
193 deps = [ 198 deps = [
194 ":opus", 199 ":opus",
195 ] 200 ]
196 } 201 }
197 202
198 executable("opus_demo") { 203 executable("opus_demo") {
199 sources = [ 204 sources = [
200 "src/src/opus_demo.c", 205 "src/src/opus_demo.c",
201 ] 206 ]
202 207
203 configs -= [ "//build/config/compiler:chromium_code" ] 208 configs -= [ "//build/config/compiler:chromium_code" ]
204 configs += [ "//build/config/compiler:no_chromium_code" ] 209 configs += [
205 210 "//build/config/compiler:no_chromium_code",
206 include_dirs = [ 211 ":opus_test_config",
207 "src/celt",
208 "src/silk",
209 ] 212 ]
210 213
211 if (is_win) {
212 defines = [ "inline=__inline" ]
213 }
214 if (is_android) {
215 libs = [ "log" ]
216 }
217 if (is_clang) {
218 cflags = [ "-Wno-absolute-value" ]
219 }
220
221 deps = [ 214 deps = [
222 ":opus", 215 ":opus",
216 ]
217 }
218
219 executable("test_opus_api") {
brettw 2015/01/29 20:25:30 Can you do "test" instead of "executable"? You wil
wtc 2015/01/29 21:11:33 Done. I have two questions. 1. I didn't make this
brettw 2015/01/30 19:02:30 Right.
220 sources = [
221 "src/tests/test_opus_api.c",
222 ]
223
224 configs -= [ "//build/config/compiler:chromium_code" ]
225 configs += [
226 "//build/config/compiler:no_chromium_code",
227 ":opus_test_config",
228 ]
229
230 deps = [
231 ":opus",
232 ]
233 }
234
235 executable("test_opus_encode") {
236 sources = [
237 "src/tests/test_opus_encode.c",
238 ]
239
240 configs -= [ "//build/config/compiler:chromium_code" ]
241 configs += [
242 "//build/config/compiler:no_chromium_code",
243 ":opus_test_config",
244 ]
245
246 deps = [
247 ":opus",
248 ]
249 }
250
251 executable("test_opus_decode") {
252 sources = [
253 "src/tests/test_opus_decode.c",
254 ]
255
256 configs -= [ "//build/config/compiler:chromium_code" ]
257 configs += [
258 "//build/config/compiler:no_chromium_code",
259 ":opus_test_config",
260 ]
261
262 deps = [
263 ":opus",
264 ]
265 }
266
267 executable("test_opus_padding") {
268 sources = [
269 "src/tests/test_opus_padding.c",
270 ]
271
272 configs -= [ "//build/config/compiler:chromium_code" ]
273 configs += [
274 "//build/config/compiler:no_chromium_code",
275 ":opus_test_config",
276 ]
277
278 deps = [
279 ":opus",
223 ] 280 ]
224 } 281 }
OLDNEW
« no previous file with comments | « no previous file | third_party/opus/opus.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698