blob: 8200ab55fa59605b3c11b19f57d59a95a2bb4a27 [file] [log] [blame]
Mikhail Naganov1209b482019-04-26 16:20:57 -07001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badour56786ac2021-02-25 15:24:36 -080015package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "frameworks_av_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["frameworks_av_license"],
22}
23
jiabin613e6ae2022-12-21 20:20:11 +000024tidy_errors = [
25 // https://clang.llvm.org/extra/clang-tidy/checks/list.html
26 // For many categories, the checks are too many to specify individually.
27 // Feel free to disable as needed - as warnings are generally ignored,
28 // we treat warnings as errors.
29 "android-*",
30 "bugprone-*",
31 "cert-*",
32 "clang-analyzer-security*",
33 "google-*",
34 "misc-*",
35 //"modernize-*", // explicitly list the modernize as they can be subjective.
36 "modernize-avoid-bind",
37 //"modernize-avoid-c-arrays", // std::array<> can be verbose
38 "modernize-concat-nested-namespaces",
39 //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent.
40 "modernize-deprecated-ios-base-aliases",
41 "modernize-loop-convert",
42 "modernize-make-shared",
43 "modernize-make-unique",
44 "modernize-pass-by-value",
45 "modernize-raw-string-literal",
46 "modernize-redundant-void-arg",
47 "modernize-replace-auto-ptr",
48 "modernize-replace-random-shuffle",
49 "modernize-return-braced-init-list",
50 "modernize-shrink-to-fit",
51 "modernize-unary-static-assert",
52 "modernize-use-auto",
53 "modernize-use-bool-literals",
54 "modernize-use-default-member-init",
55 "modernize-use-emplace",
56 "modernize-use-equals-default",
57 "modernize-use-equals-delete",
jiabin8ecf6332023-12-05 18:51:29 +000058 "modernize-use-nodiscard",
jiabin613e6ae2022-12-21 20:20:11 +000059 "modernize-use-noexcept",
60 "modernize-use-nullptr",
61 "modernize-use-override",
62 // "modernize-use-trailing-return-type", // not necessarily more readable
63 "modernize-use-transparent-functors",
64 "modernize-use-uncaught-exceptions",
65 "modernize-use-using",
66 "performance-*",
67
68 // Remove some pedantic stylistic requirements.
69 "-android-cloexec-dup", // found in AAudioServiceEndpointMMAP.cpp
70 "-bugprone-narrowing-conversions", // found in several interface from size_t to int32_t
71
jiabin613e6ae2022-12-21 20:20:11 +000072 "-google-build-using-namespace", // Reenable and fix later.
73 "-google-global-names-in-headers", // found in several files
Andy Hunga159e4b2024-03-15 11:48:57 -070074 "-google-readability-casting", // C++ casts not always necessary and may be verbose
75 "-google-readability-todo", // do not require TODO(info)
jiabin613e6ae2022-12-21 20:20:11 +000076
77 "-misc-non-private-member-variables-in-classes", // found in aidl generated files
78
79]
80
Devin Moore55a2fc92023-05-11 23:48:00 +000081cc_defaults {
82 name: "libaaudioservice_dependencies",
jiabin613e6ae2022-12-21 20:20:11 +000083
Devin Moore55a2fc92023-05-11 23:48:00 +000084 shared_libs: [
Andy Hunga159e4b2024-03-15 11:48:57 -070085 "aaudio-aidl-cpp",
86 "com.android.media.aaudio-aconfig-cc",
Kiyoung Kimac6572a2024-08-12 13:52:07 +090087 "com.android.media.aaudio-aconfig-cc",
Andy Hunga159e4b2024-03-15 11:48:57 -070088 "framework-permission-aidl-cpp",
Devin Moore55a2fc92023-05-11 23:48:00 +000089 "libaaudio_internal",
90 "libaudioclient",
Andy Hunga159e4b2024-03-15 11:48:57 -070091 "libaudioclient_aidl_conversion",
Robert Wuaeb1d002024-10-30 23:19:44 +000092 "libaudiofoundation",
Devin Moore55a2fc92023-05-11 23:48:00 +000093 "libaudioutils",
Devin Moore55a2fc92023-05-11 23:48:00 +000094 "libbase",
95 "libbinder",
96 "libcutils",
97 "liblog",
Andy Hunga159e4b2024-03-15 11:48:57 -070098 "libmedia_helper",
99 "libmediametrics",
100 "libmediautils",
Devin Moore55a2fc92023-05-11 23:48:00 +0000101 "libutils",
Devin Moore55a2fc92023-05-11 23:48:00 +0000102 "packagemanager_aidl-cpp",
103 ],
104
105 static_libs: [
106 "libaudioflinger",
Andy Hunga159e4b2024-03-15 11:48:57 -0700107 ],
Devin Moore55a2fc92023-05-11 23:48:00 +0000108}
109
110cc_library_static {
Mikhail Naganov1209b482019-04-26 16:20:57 -0700111
112 name: "libaaudioservice",
113
Lorena Torres-Huerta03112f62022-08-12 23:08:12 +0000114 defaults: [
115 "latest_android_media_audio_common_types_cpp_shared",
Andy Hunga159e4b2024-03-15 11:48:57 -0700116 "libaaudioservice_dependencies",
Lorena Torres-Huerta03112f62022-08-12 23:08:12 +0000117 ],
118
Mikhail Naganov1209b482019-04-26 16:20:57 -0700119 srcs: [
120 "AAudioClientTracker.cpp",
jiabin2a594622021-10-14 00:32:25 +0000121 "AAudioCommandQueue.cpp",
Mikhail Naganov1209b482019-04-26 16:20:57 -0700122 "AAudioEndpointManager.cpp",
123 "AAudioMixer.cpp",
124 "AAudioService.cpp",
125 "AAudioServiceEndpoint.cpp",
126 "AAudioServiceEndpointCapture.cpp",
127 "AAudioServiceEndpointMMAP.cpp",
128 "AAudioServiceEndpointPlay.cpp",
129 "AAudioServiceEndpointShared.cpp",
130 "AAudioServiceStreamBase.cpp",
131 "AAudioServiceStreamMMAP.cpp",
132 "AAudioServiceStreamShared.cpp",
133 "AAudioStreamTracker.cpp",
134 "AAudioThread.cpp",
135 "SharedMemoryProxy.cpp",
jiabinfc791ee2023-02-15 19:43:40 +0000136 "SharedMemoryWrapper.cpp",
Mikhail Naganov1209b482019-04-26 16:20:57 -0700137 "SharedRingBuffer.cpp",
138 "TimestampScheduler.cpp",
139 ],
140
141 cflags: [
Mikhail Naganov1209b482019-04-26 16:20:57 -0700142 "-Wall",
143 "-Werror",
Andy Hunga159e4b2024-03-15 11:48:57 -0700144 "-Wno-unused-parameter",
145 "-Wthread-safety",
Mikhail Naganov1209b482019-04-26 16:20:57 -0700146 ],
147
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700148 export_shared_lib_headers: [
Svet Ganov33761132021-05-13 22:51:08 +0000149 "framework-permission-aidl-cpp",
Andy Hunga159e4b2024-03-15 11:48:57 -0700150 "libaaudio_internal",
Ytai Ben-Tsvi0412f732020-08-17 14:43:36 -0700151 ],
152
Marco Nelissena51151a2020-01-07 13:37:47 -0800153 header_libs: [
154 "libaudiohal_headers",
155 ],
156
157 include_dirs: [
Marco Nelissena51151a2020-01-07 13:37:47 -0800158 "frameworks/av/media/libnbaio/include",
Andy Hunga159e4b2024-03-15 11:48:57 -0700159 "frameworks/av/media/libnbaio/include_mono",
Marco Nelissena51151a2020-01-07 13:37:47 -0800160 ],
jiabin613e6ae2022-12-21 20:20:11 +0000161
Andy Hung4b64ee52024-07-31 17:07:24 -0700162 export_include_dirs: ["."],
163
jiabin613e6ae2022-12-21 20:20:11 +0000164 tidy: true,
165 tidy_checks: tidy_errors,
166 tidy_checks_as_errors: tidy_errors,
167 tidy_flags: [
168 "-format-style=file",
Andy Hunga159e4b2024-03-15 11:48:57 -0700169 ],
Mikhail Naganov1209b482019-04-26 16:20:57 -0700170}