blob: 2d04396b432766277df387443a3c61f041be33ae [file] [log] [blame]
// Copyright (C) 2009 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.
cc_defaults {
name: "libhwbinder_defaults",
export_include_dirs: ["include"],
sanitize: {
misc_undefined: ["integer"],
},
srcs: [
"Binder.cpp",
"BpHwBinder.cpp",
"BufferedTextOutput.cpp",
"Debug.cpp",
"IInterface.cpp",
"IPCThreadState.cpp",
"Parcel.cpp",
"ProcessState.cpp",
"Static.cpp",
"TextOutput.cpp",
],
product_variables: {
binder32bit: {
cflags: ["-DBINDER_IPC_32BIT=1"],
},
},
cflags: [
"-Wall",
"-Werror",
],
}
cc_defaults {
name: "libhwbinder-impl-shared-libs",
defaults: ["libhwbinder-impl-shared-libs-no-vndk-private"],
shared_libs: [
"libbinderthreadstate",
],
}
cc_defaults {
name: "libhwbinder-impl-shared-libs-no-vndk-private",
shared_libs: [
"libbase",
"liblog",
"libcutils",
"libutils",
],
export_shared_lib_headers: [
"libbase",
"libutils",
],
}
// WARNING: this should no longer be used
cc_library {
name: "libhwbinder",
vendor_available: true,
export_include_dirs: ["include"],
}
// Combined into libhidlbase for efficiency.
// Used as shared library to provide headers for libhidltransport-impl-internal.
cc_library_static {
name: "libhwbinder-impl-internal",
include_dirs: [
// TODO(b/135299443): allow this library to link against vndk-private libs
// and instead rely on the fact that users of this static library must be
// vndk (since they must use libbinderthreadstate).
"frameworks/native/libs/binderthreadstate/include/",
// TODO(b/31559095): get headers from bionic on host
"bionic/libc/kernel/android/uapi/",
"bionic/libc/kernel/uapi/",
],
defaults: [
"libhwbinder_defaults",
"libhwbinder-impl-shared-libs-no-vndk-private",
"hwbinder_pgo",
"hwbinder_lto",
],
host_supported: true,
recovery_available: true,
vendor_available: true,
}
// Only libhwbinder_benchmark needs to have pgo enabled. When all places
// support having PGO selectively enabled, all places can use libhwbinder.
//
// http://b/77320844
cc_library_static {
name: "libhwbinder_pgo-impl-internal",
defaults: [
"libhwbinder_defaults",
"libhwbinder-impl-shared-libs",
"hwbinder_benchmark_pgo",
"hwbinder_lto",
],
}
// Provide pgo property to build hwbinder with PGO
cc_defaults {
name: "hwbinder_pgo",
pgo: {
instrumentation: true,
profile_file: "hwbinder/hwbinder.profdata",
benchmarks: ["hwbinder"],
enable_profile_use: true,
},
}
cc_defaults {
name: "hwbinder_benchmark_pgo",
pgo: {
instrumentation: true,
profile_file: "hwbinder/hwbinder.profdata",
benchmarks: ["hwbinder_benchmark"],
enable_profile_use: true,
},
}
// Provide lto property to build hwbinder with LTO
cc_defaults {
name: "hwbinder_lto",
target: {
android: {
lto: {
thin: true,
},
},
},
}