blob: adef9d6638a833ba509db36d5d908f50cca847db [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"],
}
filegroup {
name: "BluetoothFlatbufferBundlerSources",
visibility: ["//visibility:private"],
srcs: [
"bundler.cc",
"main.cc",
],
}
filegroup {
name: "BluetoothFlatbufferBundlerTestSources",
visibility: ["//visibility:private"],
srcs: [
"bundler.cc",
"test.cc",
],
}
// Flatbuffer bundler schema that wraps the bundled binary module schema
genrule {
name: "BluetoothGeneratedBundlerSchema_h_bfbs",
visibility: [
"//system/bt/gd",
"//system/bt/main",
],
tools: [
"flatc",
],
cmd: "$(location flatc) -I system/bt/gd -b --schema -o $(genDir) --cpp $(in) ",
srcs: [
"bundler_schema.fbs",
],
out: [
"bundler_schema_generated.h", "bundler_schema.bfbs",
],
}
cc_defaults {
name: "bluetooth_flatbuffer_bundler_defaults",
cpp_std: "c++17",
cflags: [
"-Wall",
"-Werror",
"-Wno-unused-parameter",
"-Wno-unused-variable",
],
generated_headers: [
"BluetoothGeneratedBundlerSchema_h_bfbs",
],
sanitize: {
misc_undefined: ["bounds"],
},
static_libs: [
"libflatbuffers-cpp",
],
}
cc_binary_host {
name: "bluetooth_flatbuffer_bundler",
srcs: [
":BluetoothFlatbufferBundlerSources",
],
defaults: [
"bluetooth_flatbuffer_bundler_defaults",
],
}
cc_test {
name: "bluetooth_flatbuffer_bundler_test",
host_supported: true,
srcs: [
":BluetoothFlatbufferBundlerTestSources",
],
defaults: [
"bluetooth_flatbuffer_bundler_defaults",
],
data: [
"test.bfbs",
],
test_options: {
unit_test: true,
},
}