blob: c5080a4aa3eb0a926b0b3b00d40d99204267afae [file] [log] [blame]
// Copyright (C) 2019 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "frameworks_av_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["frameworks_av_license"],
}
tidy_errors = [
// https://clang.llvm.org/extra/clang-tidy/checks/list.html
// For many categories, the checks are too many to specify individually.
// Feel free to disable as needed - as warnings are generally ignored,
// we treat warnings as errors.
"android-*",
"bugprone-*",
"cert-*",
"clang-analyzer-security*",
"google-*",
"misc-*",
//"modernize-*", // explicitly list the modernize as they can be subjective.
"modernize-avoid-bind",
//"modernize-avoid-c-arrays", // std::array<> can be verbose
"modernize-concat-nested-namespaces",
//"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent.
"modernize-deprecated-ios-base-aliases",
"modernize-loop-convert",
"modernize-make-shared",
"modernize-make-unique",
"modernize-pass-by-value",
"modernize-raw-string-literal",
"modernize-redundant-void-arg",
"modernize-replace-auto-ptr",
"modernize-replace-random-shuffle",
"modernize-return-braced-init-list",
"modernize-shrink-to-fit",
"modernize-unary-static-assert",
"modernize-use-auto",
"modernize-use-bool-literals",
"modernize-use-default-member-init",
"modernize-use-emplace",
"modernize-use-equals-default",
"modernize-use-equals-delete",
// "modernize-use-nodiscard", // Maybe add this in the future
"modernize-use-noexcept",
"modernize-use-nullptr",
"modernize-use-override",
// "modernize-use-trailing-return-type", // not necessarily more readable
"modernize-use-transparent-functors",
"modernize-use-uncaught-exceptions",
"modernize-use-using",
"performance-*",
// Remove some pedantic stylistic requirements.
"-android-cloexec-dup", // found in AAudioServiceEndpointMMAP.cpp
"-bugprone-narrowing-conversions", // found in several interface from size_t to int32_t
"-google-readability-casting", // C++ casts not always necessary and may be verbose
"-google-readability-todo", // do not require TODO(info)
"-google-build-using-namespace", // Reenable and fix later.
"-google-global-names-in-headers", // found in several files
"-misc-non-private-member-variables-in-classes", // found in aidl generated files
]
cc_library {
name: "libaaudioservice",
defaults: [
"latest_android_media_audio_common_types_cpp_shared",
],
srcs: [
"AAudioClientTracker.cpp",
"AAudioCommandQueue.cpp",
"AAudioEndpointManager.cpp",
"AAudioMixer.cpp",
"AAudioService.cpp",
"AAudioServiceEndpoint.cpp",
"AAudioServiceEndpointCapture.cpp",
"AAudioServiceEndpointMMAP.cpp",
"AAudioServiceEndpointPlay.cpp",
"AAudioServiceEndpointShared.cpp",
"AAudioServiceStreamBase.cpp",
"AAudioServiceStreamMMAP.cpp",
"AAudioServiceStreamShared.cpp",
"AAudioStreamTracker.cpp",
"AAudioThread.cpp",
"SharedMemoryProxy.cpp",
"SharedMemoryWrapper.cpp",
"SharedRingBuffer.cpp",
"TimestampScheduler.cpp",
],
cflags: [
"-Wthread-safety",
"-Wno-unused-parameter",
"-Wall",
"-Werror",
],
shared_libs: [
"libaaudio_internal",
"libaudioclient",
"libaudioflinger",
"libaudioutils",
"libmedia_helper",
"libmediametrics",
"libmediautils",
"libbase",
"libbinder",
"libcutils",
"liblog",
"libutils",
"aaudio-aidl-cpp",
"framework-permission-aidl-cpp",
"libaudioclient_aidl_conversion",
"packagemanager_aidl-cpp",
],
export_shared_lib_headers: [
"libaaudio_internal",
"framework-permission-aidl-cpp",
],
header_libs: [
"libaudiohal_headers",
],
include_dirs: [
"frameworks/av/media/libnbaio/include_mono",
"frameworks/av/media/libnbaio/include",
],
tidy: true,
tidy_checks: tidy_errors,
tidy_checks_as_errors: tidy_errors,
tidy_flags: [
"-format-style=file",
]
}