blob: ee473f5deb15172a525bb4f4cd7fb5101f263a61 [file] [log] [blame]
Bob Badour051ef782021-02-12 17:07:05 -08001package {
2 default_applicable_licenses: [
3 "frameworks_base_media_jni_soundpool_license",
4 ],
5}
6
7// Added automatically by a large-scale-change
8// See: http://go/android-license-faq
9license {
10 name: "frameworks_base_media_jni_soundpool_license",
11 visibility: [":__subpackages__"],
12 license_kinds: [
13 "SPDX-license-identifier-Apache-2.0",
14 ],
15 license_text: [
16 "NOTICE",
17 ],
18}
19
Andy Hung77eb2bd2020-05-19 10:42:09 -070020tidy_errors = [
21 // https://clang.llvm.org/extra/clang-tidy/checks/list.html
22 // For many categories, the checks are too many to specify individually.
23 // Feel free to disable as needed - as warnings are generally ignored,
24 // we treat warnings as errors.
25 "android-*",
26 "bugprone-*",
27 "cert-*",
28 "clang-analyzer-security*",
29 "google-*",
30 "misc-*",
31 //"modernize-*", // explicitly list the modernize as they can be subjective.
32 "modernize-avoid-bind",
33 //"modernize-avoid-c-arrays", // std::array<> can be verbose
34 "modernize-concat-nested-namespaces",
35 //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent.
36 "modernize-deprecated-ios-base-aliases",
37 "modernize-loop-convert",
38 "modernize-make-shared",
39 "modernize-make-unique",
40 "modernize-pass-by-value",
41 "modernize-raw-string-literal",
42 "modernize-redundant-void-arg",
43 "modernize-replace-auto-ptr",
44 "modernize-replace-random-shuffle",
45 "modernize-return-braced-init-list",
46 "modernize-shrink-to-fit",
47 "modernize-unary-static-assert",
Chih-Hung Hsiehc8d81cf2021-02-21 18:14:04 -080048 // "modernize-use-auto", // found in StreamManager.h, debatable - auto can obscure type
Andy Hung77eb2bd2020-05-19 10:42:09 -070049 "modernize-use-bool-literals",
50 "modernize-use-default-member-init",
51 "modernize-use-emplace",
52 "modernize-use-equals-default",
53 "modernize-use-equals-delete",
Chih-Hung Hsiehc8d81cf2021-02-21 18:14:04 -080054 // "modernize-use-nodiscard", // found in SteamManager.h
Andy Hung77eb2bd2020-05-19 10:42:09 -070055 "modernize-use-noexcept",
56 "modernize-use-nullptr",
57 "modernize-use-override",
58 //"modernize-use-trailing-return-type", // not necessarily more readable
59 "modernize-use-transparent-functors",
60 "modernize-use-uncaught-exceptions",
Chih-Hung Hsiehc8d81cf2021-02-21 18:14:04 -080061 //"modernize-use-using", // found in SoundManager.h
Andy Hung77eb2bd2020-05-19 10:42:09 -070062 "performance-*",
63
64 // Remove some pedantic stylistic requirements.
65 "-google-readability-casting", // C++ casts not always necessary and may be verbose
Philip P. Moltmannfece2432020-07-17 16:39:54 -070066 "-google-readability-todo", // do not require TODO(info)
Andy Hung77eb2bd2020-05-19 10:42:09 -070067 "-google-build-using-namespace", // Reenable and fix later.
Chih-Hung Hsiehc8d81cf2021-02-21 18:14:04 -080068
69 "-google-explicit-constructor", // found in StreamManager.h
70 "-misc-non-private-member-variables-in-classes", // found in SoundManager.h
71 "-performance-unnecessary-value-param", // found in StreamManager.h
Andy Hung77eb2bd2020-05-19 10:42:09 -070072]
73
74cc_defaults {
75 name: "soundpool_flags_defaults",
76 // https://clang.llvm.org/docs/UsersManual.html#command-line-options
77 // https://clang.llvm.org/docs/DiagnosticsReference.html
78 cflags: [
79 "-Wall",
80 "-Wdeprecated",
81 "-Werror",
82 "-Werror=implicit-fallthrough",
83 "-Werror=sometimes-uninitialized",
84 //"-Werror=conditional-uninitialized",
85 "-Wextra",
86 "-Wredundant-decls",
87 "-Wshadow",
88 "-Wstrict-aliasing",
89 "-fstrict-aliasing",
90 "-Wthread-safety",
91 //"-Wthread-safety-negative", // experimental - looks broken in R.
92 "-Wunreachable-code",
93 "-Wunreachable-code-break",
94 "-Wunreachable-code-return",
95 "-Wunused",
96 "-Wused-but-marked-unused",
97 ],
98 // https://clang.llvm.org/extra/clang-tidy/
99 tidy: true,
100 tidy_checks: tidy_errors,
101 tidy_checks_as_errors: tidy_errors,
102 tidy_flags: [
Philip P. Moltmannfece2432020-07-17 16:39:54 -0700103 "-format-style=file",
Andy Hung77eb2bd2020-05-19 10:42:09 -0700104 ],
105}
106
Colin Cross98c127f2017-05-16 13:08:19 -0700107cc_library_shared {
108 name: "libsoundpool",
Andy Hung77eb2bd2020-05-19 10:42:09 -0700109 defaults: [
110 "soundpool_flags_defaults",
111 ],
Colin Cross98c127f2017-05-16 13:08:19 -0700112
113 srcs: [
114 "android_media_SoundPool.cpp",
Andy Hunge7937b92019-08-28 21:02:23 -0700115 "Sound.cpp",
116 "SoundDecoder.cpp",
117 "SoundManager.cpp",
Colin Cross98c127f2017-05-16 13:08:19 -0700118 "SoundPool.cpp",
Andy Hunge7937b92019-08-28 21:02:23 -0700119 "Stream.cpp",
120 "StreamManager.cpp",
Colin Cross98c127f2017-05-16 13:08:19 -0700121 ],
122
Marco Nelissen8844f0f2019-10-21 14:52:58 -0700123 header_libs: [
124 "libmedia_headers",
Marco Nelissen25f83482020-01-10 16:31:30 -0800125 "libmediametrics_headers",
Marco Nelissen8844f0f2019-10-21 14:52:58 -0700126 ],
127
Colin Cross98c127f2017-05-16 13:08:19 -0700128 shared_libs: [
Svet Ganov2eebf922021-05-20 15:09:08 +0000129 "framework-permission-aidl-cpp",
Andy Hunge7937b92019-08-28 21:02:23 -0700130 "libaudioutils",
Colin Cross98c127f2017-05-16 13:08:19 -0700131 "liblog",
132 "libcutils",
133 "libutils",
134 "libandroid_runtime",
135 "libnativehelper",
136 "libaudioclient",
137 "libmediandk",
138 "libbinder",
Colin Cross98c127f2017-05-16 13:08:19 -0700139 ],
140
141 cflags: [
142 "-Wall",
143 "-Werror",
144 "-Wno-error=deprecated-declarations",
145 "-Wunused",
146 "-Wunreachable-code",
147 ],
148}