Bob Badour | 051ef78 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 1 | package { |
| 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 |
| 9 | license { |
| 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 Hung | 77eb2bd | 2020-05-19 10:42:09 -0700 | [diff] [blame] | 20 | tidy_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 Hsieh | c8d81cf | 2021-02-21 18:14:04 -0800 | [diff] [blame] | 48 | // "modernize-use-auto", // found in StreamManager.h, debatable - auto can obscure type |
Andy Hung | 77eb2bd | 2020-05-19 10:42:09 -0700 | [diff] [blame] | 49 | "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 Hsieh | c8d81cf | 2021-02-21 18:14:04 -0800 | [diff] [blame] | 54 | // "modernize-use-nodiscard", // found in SteamManager.h |
Andy Hung | 77eb2bd | 2020-05-19 10:42:09 -0700 | [diff] [blame] | 55 | "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 Hsieh | c8d81cf | 2021-02-21 18:14:04 -0800 | [diff] [blame] | 61 | //"modernize-use-using", // found in SoundManager.h |
Andy Hung | 77eb2bd | 2020-05-19 10:42:09 -0700 | [diff] [blame] | 62 | "performance-*", |
| 63 | |
| 64 | // Remove some pedantic stylistic requirements. |
| 65 | "-google-readability-casting", // C++ casts not always necessary and may be verbose |
Philip P. Moltmann | fece243 | 2020-07-17 16:39:54 -0700 | [diff] [blame] | 66 | "-google-readability-todo", // do not require TODO(info) |
Andy Hung | 77eb2bd | 2020-05-19 10:42:09 -0700 | [diff] [blame] | 67 | "-google-build-using-namespace", // Reenable and fix later. |
Chih-Hung Hsieh | c8d81cf | 2021-02-21 18:14:04 -0800 | [diff] [blame] | 68 | |
| 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 Hung | 77eb2bd | 2020-05-19 10:42:09 -0700 | [diff] [blame] | 72 | ] |
| 73 | |
| 74 | cc_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. Moltmann | fece243 | 2020-07-17 16:39:54 -0700 | [diff] [blame] | 103 | "-format-style=file", |
Andy Hung | 77eb2bd | 2020-05-19 10:42:09 -0700 | [diff] [blame] | 104 | ], |
| 105 | } |
| 106 | |
Colin Cross | 98c127f | 2017-05-16 13:08:19 -0700 | [diff] [blame] | 107 | cc_library_shared { |
| 108 | name: "libsoundpool", |
Andy Hung | 77eb2bd | 2020-05-19 10:42:09 -0700 | [diff] [blame] | 109 | defaults: [ |
| 110 | "soundpool_flags_defaults", |
| 111 | ], |
Colin Cross | 98c127f | 2017-05-16 13:08:19 -0700 | [diff] [blame] | 112 | |
| 113 | srcs: [ |
| 114 | "android_media_SoundPool.cpp", |
Andy Hung | e7937b9 | 2019-08-28 21:02:23 -0700 | [diff] [blame] | 115 | "Sound.cpp", |
| 116 | "SoundDecoder.cpp", |
| 117 | "SoundManager.cpp", |
Colin Cross | 98c127f | 2017-05-16 13:08:19 -0700 | [diff] [blame] | 118 | "SoundPool.cpp", |
Andy Hung | e7937b9 | 2019-08-28 21:02:23 -0700 | [diff] [blame] | 119 | "Stream.cpp", |
| 120 | "StreamManager.cpp", |
Colin Cross | 98c127f | 2017-05-16 13:08:19 -0700 | [diff] [blame] | 121 | ], |
| 122 | |
Marco Nelissen | 8844f0f | 2019-10-21 14:52:58 -0700 | [diff] [blame] | 123 | header_libs: [ |
| 124 | "libmedia_headers", |
Marco Nelissen | 25f8348 | 2020-01-10 16:31:30 -0800 | [diff] [blame] | 125 | "libmediametrics_headers", |
Marco Nelissen | 8844f0f | 2019-10-21 14:52:58 -0700 | [diff] [blame] | 126 | ], |
| 127 | |
Colin Cross | 98c127f | 2017-05-16 13:08:19 -0700 | [diff] [blame] | 128 | shared_libs: [ |
Svet Ganov | 2eebf92 | 2021-05-20 15:09:08 +0000 | [diff] [blame] | 129 | "framework-permission-aidl-cpp", |
Andy Hung | e7937b9 | 2019-08-28 21:02:23 -0700 | [diff] [blame] | 130 | "libaudioutils", |
Colin Cross | 98c127f | 2017-05-16 13:08:19 -0700 | [diff] [blame] | 131 | "liblog", |
| 132 | "libcutils", |
| 133 | "libutils", |
| 134 | "libandroid_runtime", |
| 135 | "libnativehelper", |
| 136 | "libaudioclient", |
| 137 | "libmediandk", |
| 138 | "libbinder", |
Colin Cross | 98c127f | 2017-05-16 13:08:19 -0700 | [diff] [blame] | 139 | ], |
| 140 | |
| 141 | cflags: [ |
| 142 | "-Wall", |
| 143 | "-Werror", |
| 144 | "-Wno-error=deprecated-declarations", |
| 145 | "-Wunused", |
| 146 | "-Wunreachable-code", |
| 147 | ], |
| 148 | } |