Skip to content
Snippets Groups Projects
Commit 4043a70f authored by David Duarte's avatar David Duarte
Browse files

Rename fluoride_common_options into bluetooth_cflags

fluoride_common_options are not only used inside fluoride but all
bluetooth cc targets so use the prefix `bluetooth` instead of
`fluoride`.

Also use a less generic name `common_options` -> `cflags` to
document what contains this default for the rules using this default

Test: mma packages/modules/Bluetooth
Bug: 279502784
Change-Id: Ic3b7a62bc97f8eab24d9130fbe2e2367596bdc9b
parent f3122155
No related branches found
No related tags found
No related merge requests found
Showing with 49 additions and 27 deletions
......@@ -45,6 +45,39 @@ filegroup {
],
}
// This default contains properties that should be common to all the cc targets
// developed by the Bluetooth team.
//
// Be careful when adding new properties here:
// - The option should not impact negatively any target, for example "-Wno-*"
// options should not be added here but instead on every targets needing
// them to avoid allowing adding new warnings in targets that didn't contained
// them (you can use the bpmodify tool to ease the work of adding this warning
// everywhere) and also allows cleaning them one at a time.
//
// - The option should apply to all the c/c++ code developed by the Bluetooth team:
// test, tools, fuzzers, etc, not only production targets, if you need to add an option
// for a subset of Bluetooth cc targets you should look at the defaults including this
// defaults like "fluoride_defaults" and "gd_defaults".
//
// - Try to keep the name as precise as possible to document to the dependent of what
// this default contains. This also means that if you add a new option that isn't
// documented by the name of this default, rename it.
//
// - Try avoiding adding option that would not fit "future" targets, for exemple dependencies,
// even if every modules of Bluetooth depends on a specific dependency it should be left out
// from this default to not push it for future targets that might not need it.
cc_defaults {
name: "bluetooth_cflags",
cflags: [
"-Wall",
"-Werror",
"-Wextra",
// there are too many unused parameters in all the code.
"-Wno-unused-parameter",
],
}
// Address Sanitizer is flaky on Android x86_64 binaries but it's not on x86
// binaries.
// This default workaround the x86_64 ASAN flakyness by running 32bit binaries
......
......@@ -9,7 +9,7 @@ package {
cc_defaults {
name: "audio_a2dp_hw_defaults",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
shared_libs: ["libchrome"],
include_dirs: [
"packages/modules/Bluetooth/system",
......
......@@ -11,7 +11,7 @@ package {
cc_defaults {
name: "audio_bluetooth_hw_defaults",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
cflags: [
// suppress the warning in stream_apis.cc
"-Wno-sign-compare",
......
......@@ -9,7 +9,7 @@ package {
cc_defaults {
name: "audio_hearing_aid_hw_defaults",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
shared_libs: ["libchrome"],
include_dirs: [
"packages/modules/Bluetooth/system",
......
......@@ -34,7 +34,7 @@ btifCommonIncludes = [
cc_library {
name: "libstatslog_bt",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
host_supported: true,
generated_sources: ["statslog_bt.cpp"],
generated_headers: ["statslog_bt.h"],
......
......@@ -7,22 +7,11 @@ package {
default_applicable_licenses: ["system_bt_license"],
}
cc_defaults {
name: "fluoride_common_options",
cflags: [
"-Wall",
"-Werror",
"-Wextra",
// there are too many unused parameters in all the code.
"-Wno-unused-parameter",
],
}
// Fuzzable defaults are the subset of defaults that are used in fuzzing, which
// requires no shared libraries, and no explicit sanitization.
cc_defaults {
name: "fluoride_types_defaults_fuzzable",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
cflags: [
"-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
"-DLOG_NDEBUG=1",
......
......@@ -11,7 +11,7 @@ package {
cc_defaults {
name: "gd_defaults",
defaults: [
"fluoride_common_options",
"bluetooth_cflags",
],
tidy_checks: [
"-performance-unnecessary-value-param",
......
......@@ -176,7 +176,7 @@ cc_test {
test_suites: ["device-tests"],
defaults: [
"bluetooth_gtest_x86_asan_workaround",
"fluoride_common_options",
"bluetooth_cflags",
"mts_defaults",
],
host_supported: true,
......
......@@ -48,7 +48,7 @@ genrule {
cc_defaults {
name: "bluetooth_flatbuffer_bundler_defaults",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
cpp_std: "c++17",
generated_headers: [
"BluetoothGeneratedBundlerSchema_h_bfbs",
......
......@@ -101,7 +101,7 @@ genrule {
cc_library_static {
name: "libbt_hidl_hal_cxx",
defaults: [
"fluoride_common_options",
"bluetooth_cflags",
"gd_ffi_defaults",
"rust_static_cc_lib_defaults",
],
......
......@@ -9,7 +9,7 @@ package {
cc_library_static {
name: "lib-bt-packets",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
host_supported: true,
export_include_dirs: [
"./",
......
......@@ -9,7 +9,7 @@ package {
cc_library_static {
name: "lib-bt-packets-avrcp",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
header_libs: ["avrcp_headers"],
export_header_lib_headers: ["avrcp_headers"],
export_include_dirs: ["."],
......
......@@ -9,7 +9,7 @@ package {
cc_library_static {
name: "lib-bt-packets-base",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
export_include_dirs: ["./"],
host_supported: true,
include_dirs: ["packages/modules/Bluetooth/system/include"],
......
......@@ -110,7 +110,7 @@ rust_test_host {
cc_library_static {
name: "libbluetooth_core_rs_bridge",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
srcs: [
"src/connection/ffi/connection_shim.cc",
"src/core/ffi/module.cc",
......
......@@ -24,7 +24,7 @@ package {
cc_binary {
name: "android.hardware.bluetooth@1.1-service.btlinux",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
proprietary: true,
relative_install_path: "hw",
srcs: [
......@@ -52,7 +52,7 @@ cc_binary {
cc_library_static {
name: "async_fd_watcher",
defaults: ["fluoride_common_options"],
defaults: ["bluetooth_cflags"],
proprietary: true,
srcs: [
"async_fd_watcher.cc",
......
......@@ -348,7 +348,7 @@ python_test_host {
cc_test_host {
name: "rootcanal_test_host",
defaults: [
"fluoride_common_options",
"bluetooth_cflags",
],
// TODO(b/231993739): Reenable isolated:true by deleting the explicit disable below
isolated: false,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment