blob: 08376baaa9af9fa2a6e0da8590f4d789c9e58c02 [file] [log] [blame]
Andy Hungb776e372023-05-24 11:53:47 -07001package {
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_base_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_av_services_audioflinger_license"],
8}
9
Andy Hungd6699ce2023-06-08 14:13:54 -070010audioflinger_utils_tidy_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 MediaMetricsService.h, debatable - auto can obscure type
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",
45 "modernize-use-noexcept",
46 "modernize-use-nullptr",
47 "modernize-use-override",
48 //"modernize-use-trailing-return-type", // not necessarily more readable
49 "modernize-use-transparent-functors",
50 "modernize-use-uncaught-exceptions",
51 "modernize-use-using",
52 "performance-*",
53
54 // Remove some pedantic stylistic requirements.
55 "-google-readability-casting", // C++ casts not always necessary and may be verbose
56 "-google-readability-todo", // do not require TODO(info)
57
58 "-bugprone-unhandled-self-assignment",
59 "-bugprone-suspicious-string-compare",
60 "-cert-oop54-cpp", // found in TransactionLog.h
61 "-bugprone-narrowing-conversions", // b/182410845
62
63 // TODO(b/275642749) Reenable these warnings
64 "-misc-non-private-member-variables-in-classes",
65]
66
67// Eventually use common tidy defaults
68cc_defaults {
69 name: "audioflinger_utils_flags_defaults",
70 // https://clang.llvm.org/docs/UsersManual.html#command-line-options
71 // https://clang.llvm.org/docs/DiagnosticsReference.html
Andy Hung510d1302023-06-12 16:56:30 -070072 cflags: audioflinger_base_cflags,
Andy Hungd6699ce2023-06-08 14:13:54 -070073 // https://clang.llvm.org/extra/clang-tidy/
74 tidy: true,
75 tidy_checks: audioflinger_utils_tidy_errors,
76 tidy_checks_as_errors: audioflinger_utils_tidy_errors,
77 tidy_flags: [
78 "-format-style=file",
79 ],
80}
81
Andy Hungb776e372023-05-24 11:53:47 -070082cc_library {
83 name: "libaudioflinger_utils",
84
85 defaults: [
Andy Hungd6699ce2023-06-08 14:13:54 -070086 "audioflinger_utils_flags_defaults",
Andy Hungb776e372023-05-24 11:53:47 -070087 ],
88
89 srcs: [
90 "AudioWatchdog.cpp",
91 "BufLog.cpp",
92 "NBAIO_Tee.cpp",
93 "TypedLogger.cpp",
94 ],
95
96 shared_libs: [
97 "libaudioutils",
98 "libbase",
99 "liblog",
100 "libnbaio",
101 "libnblog",
102 "libutils",
103 ],
104
105 static_libs: [
106 "libsndfile",
107 ],
108
109 include_dirs: [
110 "frameworks/av/services/audioflinger", // for configuration
111 ],
112}