summaryrefslogtreecommitdiff
path: root/webrtc/common_audio/third_party/ooura/BUILD.gn
blob: 0cdf98e59190fcc463528fc79a6854bbef8e9c74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the ../../../LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS.  All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

import("../../../webrtc.gni")

rtc_library("fft_size_128") {
  sources = [
    "fft_size_128/ooura_fft.cc",
    "fft_size_128/ooura_fft.h",
    "fft_size_128/ooura_fft_tables_common.h",
  ]
  deps = [
    "../../../rtc_base/system:arch",
    "../../../system_wrappers",
  ]
  cflags = []

  if (current_cpu == "x86" || current_cpu == "x64") {
    sources += [
      "fft_size_128/ooura_fft_sse2.cc",
      "fft_size_128/ooura_fft_tables_neon_sse2.h",
    ]
    if (is_posix || is_fuchsia) {
      cflags += [ "-msse2" ]
    }
  }

  if (rtc_build_with_neon) {
    sources += [
      "fft_size_128/ooura_fft_neon.cc",
      "fft_size_128/ooura_fft_tables_neon_sse2.h",
    ]

    deps += [ "../../../common_audio" ]

    if (current_cpu != "arm64") {
      # Enable compilation for the NEON instruction set.
      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
      cflags += [ "-mfpu=neon" ]
    }
  }

  if (current_cpu == "mipsel" && mips_float_abi == "hard") {
    sources += [ "fft_size_128/ooura_fft_mips.cc" ]
  }
}

rtc_library("fft_size_256") {
  sources = [
    "fft_size_256/fft4g.cc",
    "fft_size_256/fft4g.h",
  ]
}