blob: 9d423422d95e509b9fa854b3261c0548009e2fa3 [file] [log] [blame]
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "system_bt_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["system_bt_license"],
}
bootstrap_go_package {
name: "soong-fluoride",
pkgPath: "android/soong/fluoride",
deps: [
"blueprint",
"blueprint-pathtools",
"soong",
"soong-android",
"soong-cc",
],
srcs: [
"fluoride.go",
],
pluginFor: ["soong_build"],
}
fluoride_defaults {
name: "libchrome_support_defaults",
shared_libs: ["libchrome"],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
],
target: {
darwin: {
enabled: false,
},
},
}
// Fuzzable defaults are the subset of defaults that are used in fuzzing, which
// requires no shared libraries, and no explicit sanitization.
fluoride_defaults {
name: "fluoride_types_defaults_fuzzable",
cflags: [
"-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
"-fvisibility=hidden",
// struct BT_HDR is defined as a variable-size header in a struct.
"-Wno-gnu-variable-sized-type-not-at-end",
// there are too many unused parameters in all the code.
"-Wno-unused-parameter",
"-DLOG_NDEBUG=1",
],
conlyflags: [
"-std=c99",
],
product_variables: {
debuggable: {
cflags: [
"-DBLUEDROID_DEBUG",
],
},
},
}
fluoride_defaults {
name: "fluoride_types_defaults",
defaults: [
"fluoride_types_defaults_fuzzable",
"libchrome_support_defaults"
],
}
fluoride_defaults {
name: "fluoride_defaults_fuzzable",
target: {
android: {
test_config_template: ":BluetoothTestConfigTemplate",
},
},
defaults: ["fluoride_types_defaults_fuzzable"],
header_libs: ["libbluetooth_headers", "libbt_callbacks_cxx_headers"],
generated_headers: [
"libbt_shim_bridge_header",
"libbt_message_loop_thread_bridge_header",
"cxx-bridge-header"
],
include_dirs: ["system/bt/gd/rust/shim"],
static_libs: [
"libbluetooth-types",
"libbt-platform-protos-lite",
"libbluetooth_rust_interop",
"liblog",
"libcutils",
],
cpp_std: "c++17",
sanitize: {
misc_undefined: ["bounds"],
},
}
fluoride_defaults {
name: "fluoride_defaults",
defaults: ["fluoride_defaults_fuzzable", "fluoride_types_defaults"],
shared_libs: [
"libcutils",
"libgrpc++",
"libgrpc_wrap",
"libhidlbase",
"libstatslog",
"libutils",
],
sanitize: {
misc_undefined: ["bounds"],
},
static_libs: [
"libbluetooth_gd",
"libbluetooth_rust_interop",
"libbt_shim_ffi",
],
target: {
darwin: {
// libstatslog -> libbinder doesn't build on mac
enabled: false,
},
android: {
shared_libs: [
"android.hardware.bluetooth@1.0",
"android.hardware.bluetooth@1.1",
],
cflags: [
"-DOS_ANDROID",
],
},
},
}
// Enables code coverage for a set of source files. Must be combined with
// "clang_coverage_bin" in order to work. See //test/gen_coverage.py for more information
// on generating code coverage.
cc_defaults {
name: "clang_file_coverage",
target: {
host: {
clang_cflags: [
"-fprofile-instr-generate",
"-fcoverage-mapping",
],
},
},
}
// Enabled code coverage on a binary. These flags allow libraries that were
// compiled with "clang_file_coverage" to be properly linked together in
// order to create a binary that will create a profraw file when ran. Note
// these flags themselves don't enable code coverage for the source files
// compiled in the binary. See //test/gen_coverage.py for more information
// on generating code coverage.
cc_defaults {
name: "clang_coverage_bin",
target: {
host: {
ldflags: [
"-fprofile-instr-generate",
"-fcoverage-mapping",
],
},
},
}