blob: 531db879edb284ba675d47319d8114a21cbe28a7 [file] [log] [blame]
Sam Zackrissonb2e17652018-07-05 16:41:55 +02001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
Sam Zackrissonb2e17652018-07-05 16:41:55 +02009import("../../../webrtc.gni")
10
11rtc_source_set("block_mean_calculator") {
12 sources = [
13 "block_mean_calculator.cc",
14 "block_mean_calculator.h",
15 ]
16 deps = [
17 "../../../rtc_base:checks",
18 "../../../rtc_base:rtc_base_approved",
19 ]
20}
21
22rtc_source_set("legacy_delay_estimator") {
23 sources = [
24 "delay_estimator.cc",
25 "delay_estimator.h",
26 "delay_estimator_internal.h",
27 "delay_estimator_wrapper.cc",
28 "delay_estimator_wrapper.h",
29 ]
30 deps = [
Sam Zackrissonb2e17652018-07-05 16:41:55 +020031 "../../../rtc_base:checks",
32 ]
33}
34
35rtc_source_set("ooura_fft") {
36 sources = [
37 "ooura_fft.cc",
38 "ooura_fft.h",
39 "ooura_fft_tables_common.h",
40 ]
41 deps = [
Niels Möllera12c42a2018-07-25 16:05:48 +020042 "../../../rtc_base/system:arch",
Sam Zackrissonb2e17652018-07-05 16:41:55 +020043 "../../../system_wrappers:cpu_features_api",
44 ]
45 cflags = []
46
47 if (current_cpu == "x86" || current_cpu == "x64") {
48 sources += [
49 "ooura_fft_sse2.cc",
50 "ooura_fft_tables_neon_sse2.h",
51 ]
52 if (is_posix || is_fuchsia) {
53 cflags += [ "-msse2" ]
54 }
55 }
56
57 if (rtc_build_with_neon) {
58 sources += [
59 "ooura_fft_neon.cc",
60 "ooura_fft_tables_neon_sse2.h",
61 ]
62
63 deps += [ "../../../common_audio" ]
64
65 if (current_cpu != "arm64") {
66 # Enable compilation for the NEON instruction set. This is needed
67 # since //build/config/arm.gni only enables NEON for iOS, not Android.
68 # This provides the same functionality as webrtc/build/arm_neon.gypi.
69 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
70 cflags += [ "-mfpu=neon" ]
71 }
72
73 # Disable LTO on NEON targets due to compiler bug.
74 # TODO(fdegans): Enable this. See crbug.com/408997.
75 if (rtc_use_lto) {
76 cflags -= [
77 "-flto",
78 "-ffat-lto-objects",
79 ]
80 }
81 }
82
83 if (current_cpu == "mipsel" && mips_float_abi == "hard") {
84 sources += [ "ooura_fft_mips.cc" ]
85 }
86}
87
88if (rtc_include_tests) {
89 rtc_source_set("block_mean_calculator_unittest") {
90 testonly = true
91
92 sources = [
93 "block_mean_calculator_unittest.cc",
94 ]
95 deps = [
96 ":block_mean_calculator",
97 "../../../rtc_base:rtc_base_approved",
98 "../../../test:test_support",
99 "//testing/gtest",
100 ]
101 }
102
103 rtc_source_set("legacy_delay_estimator_unittest") {
104 testonly = true
105
106 sources = [
107 "delay_estimator_unittest.cc",
108 ]
109 deps = [
110 ":legacy_delay_estimator",
Sam Zackrissonb2e17652018-07-05 16:41:55 +0200111 "../../../rtc_base:rtc_base_approved",
112 "../../../test:test_support",
113 "//testing/gtest",
114 ]
115 }
116}