blob: 7cadacdb2b64845139f656b200eb4fce7469b882 [file] [log] [blame]
Bob Badour56786ac2021-02-25 15:24:36 -08001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "frameworks_av_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_av_license"],
8}
9
jiabind5bd06a2021-04-27 22:04:08 +000010tidy_errors = [
11 // https://clang.llvm.org/extra/clang-tidy/checks/list.html
12 // For many categories, the checks are too many to specify individually.
13 // Feel free to disable as needed - as warnings are generally ignored,
14 // we treat warnings as errors.
15 "android-*",
16 "bugprone-*",
17 "cert-*",
18 "clang-analyzer-security*",
19 "google-*",
20 "misc-*",
21 //"modernize-*", // explicitly list the modernize as they can be subjective.
22 "modernize-avoid-bind",
23 //"modernize-avoid-c-arrays", // std::array<> can be verbose
24 "modernize-concat-nested-namespaces",
25 //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent.
26 "modernize-deprecated-ios-base-aliases",
27 "modernize-loop-convert",
28 "modernize-make-shared",
29 "modernize-make-unique",
30 "modernize-pass-by-value",
31 "modernize-raw-string-literal",
32 "modernize-redundant-void-arg",
33 "modernize-replace-auto-ptr",
34 "modernize-replace-random-shuffle",
35 "modernize-return-braced-init-list",
36 "modernize-shrink-to-fit",
37 "modernize-unary-static-assert",
38 // "modernize-use-auto", // found in AAudioAudio.cpp
39 "modernize-use-bool-literals",
40 "modernize-use-default-member-init",
41 "modernize-use-emplace",
42 "modernize-use-equals-default",
43 "modernize-use-equals-delete",
44 // "modernize-use-nodiscard", // found in aidl generated files
45 "modernize-use-noexcept",
46 "modernize-use-nullptr",
47 // "modernize-use-override", // found in aidl generated files
48 // "modernize-use-trailing-return-type", // not necessarily more readable
49 "modernize-use-transparent-functors",
50 "modernize-use-uncaught-exceptions",
51 // "modernize-use-using", // found typedef in several files
52 "performance-*",
53
54 // Remove some pedantic stylistic requirements.
55 "-android-cloexec-dup", // found in SharedMemoryParcelable.cpp
56 "-bugprone-macro-parentheses", // found in SharedMemoryParcelable.h
57 "-bugprone-narrowing-conversions", // found in several interface from size_t to int32_t
58
59 "-google-readability-casting", // C++ casts not always necessary and may be verbose
60 "-google-readability-todo", // do not require TODO(info)
61 "-google-build-using-namespace", // Reenable and fix later.
62 "-google-global-names-in-headers", // found in several files
63
64 "-misc-non-private-member-variables-in-classes", // found in aidl generated files
65
66 "-performance-no-int-to-ptr", // found in SharedMemoryParcelable.h
67]
68
Dan Willemsenb44c69e2017-10-23 17:15:03 -070069cc_library {
70 name: "libaaudio",
71
72 local_include_dirs: [
73 "binding",
74 "client",
75 "core",
76 "fifo",
Phil Burk64dce362018-03-28 15:30:39 -070077 "flowgraph",
Dan Willemsenb44c69e2017-10-23 17:15:03 -070078 "legacy",
79 "utility",
80 ],
Marco Nelissen6b285942019-10-21 14:52:30 -070081 header_libs: [
82 "libaaudio_headers",
83 ],
Dan Willemsenb44c69e2017-10-23 17:15:03 -070084 export_header_lib_headers: ["libaaudio_headers"],
dimitry8e8a9682019-06-04 15:14:02 +020085 version_script: "libaaudio.map.txt",
Dan Willemsenb44c69e2017-10-23 17:15:03 -070086
87 srcs: [
dimitryd81a84a2019-07-17 13:55:16 +020088 "core/AAudioAudio.cpp",
89 ],
90
91 cflags: [
Phil Burk0bd745e2020-10-17 18:20:01 +000092 "-Wthread-safety",
dimitryd81a84a2019-07-17 13:55:16 +020093 "-Wno-unused-parameter",
94 "-Wall",
95 "-Werror",
96
97 // By default, all symbols are hidden.
98 // "-fvisibility=hidden",
99 // AAUDIO_API is used to explicitly export a function or a variable as a visible symbol.
100 "-DAAUDIO_API=__attribute__((visibility(\"default\")))",
101 ],
102
103 shared_libs: [
104 "libaaudio_internal",
105 "libaudioclient",
106 "libaudioutils",
Phil Burka9876702020-04-20 18:16:15 -0700107 "libmedia_helper",
108 "libmediametrics",
109 "libmediautils",
dimitryd81a84a2019-07-17 13:55:16 +0200110 "liblog",
111 "libcutils",
112 "libutils",
113 "libbinder",
114 ],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700115
116 sanitize: {
117 integer_overflow: true,
118 misc_undefined: ["bounds"],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700119 },
120
Zach Johnson99c47ff2019-12-02 15:28:34 -0800121 stubs: {
122 symbol_file: "libaaudio.map.txt",
123 versions: ["28"],
124 },
jiabind5bd06a2021-04-27 22:04:08 +0000125
126 tidy: true,
127 tidy_checks: tidy_errors,
128 tidy_checks_as_errors: tidy_errors,
129 tidy_flags: [
130 "-format-style=file",
131 ]
dimitryd81a84a2019-07-17 13:55:16 +0200132}
133
134cc_library {
135 name: "libaaudio_internal",
136
137 local_include_dirs: [
138 "binding",
139 "client",
140 "core",
141 "fifo",
142 "legacy",
143 "utility",
144 ],
145
146 export_include_dirs: ["."],
Marco Nelissen6b285942019-10-21 14:52:30 -0700147 header_libs: [
148 "libaaudio_headers",
Cindy Zhou30ed5942019-10-30 13:24:37 -0700149 "libmedia_headers",
Marco Nelissen7c96ea72020-01-10 15:46:22 -0800150 "libmediametrics_headers",
Marco Nelissen6b285942019-10-21 14:52:30 -0700151 ],
dimitryd81a84a2019-07-17 13:55:16 +0200152 export_header_lib_headers: ["libaaudio_headers"],
153
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700154 export_shared_lib_headers: [
155 "media_permission-aidl-cpp",
156 ],
157
dimitryd81a84a2019-07-17 13:55:16 +0200158 shared_libs: [
159 "libaudioclient",
160 "libaudioutils",
Phil Burka9876702020-04-20 18:16:15 -0700161 "libmedia_helper",
162 "libmediametrics",
163 "libmediautils",
dimitryd81a84a2019-07-17 13:55:16 +0200164 "liblog",
165 "libcutils",
166 "libutils",
167 "libbinder",
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700168 "aaudio-aidl-cpp",
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700169 "media_permission-aidl-cpp",
170 "libaudioclient_aidl_conversion",
171 ],
172
173 static_libs: [
174 "media_permission-aidl-cpp",
dimitryd81a84a2019-07-17 13:55:16 +0200175 ],
176
177 cflags: [
178 "-Wno-unused-parameter",
179 "-Wall",
180 "-Werror",
181 ],
182
183 srcs: [
184 "core/AudioGlobal.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700185 "core/AudioStream.cpp",
186 "core/AudioStreamBuilder.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700187 "core/AAudioStreamParameters.cpp",
188 "legacy/AudioStreamLegacy.cpp",
189 "legacy/AudioStreamRecord.cpp",
190 "legacy/AudioStreamTrack.cpp",
191 "utility/AAudioUtilities.cpp",
192 "utility/FixedBlockAdapter.cpp",
193 "utility/FixedBlockReader.cpp",
194 "utility/FixedBlockWriter.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700195 "fifo/FifoBuffer.cpp",
196 "fifo/FifoControllerBase.cpp",
Phil Burk0127c1b2018-03-29 13:48:06 -0700197 "client/AAudioFlowGraph.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700198 "client/AudioEndpoint.cpp",
199 "client/AudioStreamInternal.cpp",
200 "client/AudioStreamInternalCapture.cpp",
201 "client/AudioStreamInternalPlay.cpp",
202 "client/IsochronousClockModel.cpp",
203 "binding/AudioEndpointParcelable.cpp",
Ytai Ben-Tsvi734e3502020-08-24 14:57:36 -0700204 "binding/AAudioBinderAdapter.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700205 "binding/AAudioBinderClient.cpp",
206 "binding/AAudioStreamRequest.cpp",
207 "binding/AAudioStreamConfiguration.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700208 "binding/RingBufferParcelable.cpp",
209 "binding/SharedMemoryParcelable.cpp",
210 "binding/SharedRegionParcelable.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700211 "flowgraph/AudioProcessorBase.cpp",
212 "flowgraph/ClipToRange.cpp",
213 "flowgraph/MonoToMultiConverter.cpp",
214 "flowgraph/RampLinear.cpp",
215 "flowgraph/SinkFloat.cpp",
216 "flowgraph/SinkI16.cpp",
217 "flowgraph/SinkI24.cpp",
Phil Burk04e805b2018-03-27 09:13:53 -0700218 "flowgraph/SinkI32.cpp",
Phil Burk64dce362018-03-28 15:30:39 -0700219 "flowgraph/SourceFloat.cpp",
220 "flowgraph/SourceI16.cpp",
221 "flowgraph/SourceI24.cpp",
Phil Burk04e805b2018-03-27 09:13:53 -0700222 "flowgraph/SourceI32.cpp",
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700223 ],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700224 sanitize: {
225 integer_overflow: true,
226 misc_undefined: ["bounds"],
Cindy Zhou30ed5942019-10-30 13:24:37 -0700227 },
jiabind5bd06a2021-04-27 22:04:08 +0000228
229 tidy: true,
230 tidy_checks: tidy_errors,
231 tidy_checks_as_errors: tidy_errors,
232 tidy_flags: [
233 "-format-style=file",
234 ]
Dan Willemsenb44c69e2017-10-23 17:15:03 -0700235}
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700236
237aidl_interface {
238 name: "aaudio-aidl",
239 unstable: true,
240 local_include_dir: "binding/aidl",
241 srcs: [
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700242 "binding/aidl/aaudio/Endpoint.aidl",
243 "binding/aidl/aaudio/RingBuffer.aidl",
244 "binding/aidl/aaudio/SharedRegion.aidl",
245 "binding/aidl/aaudio/StreamParameters.aidl",
246 "binding/aidl/aaudio/StreamRequest.aidl",
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700247 "binding/aidl/aaudio/IAAudioClient.aidl",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700248 "binding/aidl/aaudio/IAAudioService.aidl",
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700249 ],
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700250 imports: [
Ytai Ben-Tsvi71151352021-03-10 16:29:01 -0800251 "android.media.audio.common.types",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700252 "shared-file-region-aidl",
Philip P. Moltmannbda45752020-07-17 16:41:18 -0700253 "media_permission-aidl",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700254 ],
255 backend:
256 {
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700257 java: {
Ytai Ben-Tsvi71151352021-03-10 16:29:01 -0800258 sdk_version: "module_current",
Ytai Ben-Tsvic5f45872020-08-18 10:39:44 -0700259 },
260 },
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700261}