Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ccf62f5 authored by Hui Peng's avatar Hui Peng
Browse files

Factor out duplicated warning options

There are multiple duplicated compiler options
configs for turning warnings into error.
This patch factor out these duplicated configs

Bug: 250720917
Test: refactoring CL. Existing unit tests still pass.

Change-Id: I66ace35eea122be2458b6eb03ac406c8ba50ca61
parent 23783b7b
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -69,12 +69,6 @@ cc_library_shared {
        "libbluetooth",
        "libc++fs",
    ],
    cflags: [
        "-Wall",
        "-Werror",
        "-Wextra",
        "-Wno-unused-parameter",
    ],
    sanitize: {
        scs: true,
    },
+11 −10
Original line number Diff line number Diff line
@@ -9,8 +9,18 @@ package {
    default_applicable_licenses: ["system_bt_license"],
}

cc_defaults {
    name: "audio_bluetooth_hw_defaults",
    defaults: ["fluoride_common_options"],
    cflags: [
        // suppress the warning in stream_apis.cc
        "-Wno-sign-compare",
    ],
}

cc_library_shared {
    name: "audio.bluetooth.default",
    defaults: ["audio_bluetooth_hw_defaults"],
    relative_install_path: "hw",
    proprietary: true,
    srcs: [
@@ -37,15 +47,11 @@ cc_library_shared {
        "libbluetooth_audio_session",
        "libhidlbase",
    ],
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-unused-parameter",
    ],
}

cc_test {
    name: "audio_bluetooth_hw_test",
    defaults: ["audio_bluetooth_hw_defaults"],
    srcs: [
        "utils.cc",
        "utils_unittest.cc",
@@ -56,9 +62,4 @@ cc_test {
        "liblog",
        "libutils",
    ],
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-unused-parameter",
    ],
}
+1 −4
Original line number Diff line number Diff line
@@ -35,14 +35,11 @@ btifCommonIncludes = [

cc_library {
    name: "libstatslog_bt",
    defaults: ["fluoride_common_options"],
    host_supported: true,
    generated_sources: ["statslog_bt.cpp"],
    generated_headers: ["statslog_bt.h"],
    export_generated_headers: ["statslog_bt.h"],
    cflags: [
        "-Wall",
        "-Werror",
    ],
    shared_libs: [
        "libcutils",
    ],
+14 −12
Original line number Diff line number Diff line
@@ -23,8 +23,20 @@ bootstrap_go_package {
    pluginFor: ["soong_build"],
}

cc_defaults {
    name: "fluoride_common_options",
    cflags: [
        "-Wall",
        "-Wextra",
        "-Werror",
        // there are too many unused parameters in all the code.
        "-Wno-unused-parameter",
    ],
}

fluoride_defaults {
    name: "libchrome_support_defaults",
    defaults: ["fluoride_common_options"],
    static_libs: [
        "libchrome",
        "libmodpb64",
@@ -33,11 +45,6 @@ fluoride_defaults {
    shared_libs: [
      "libbase",
    ],
    cflags: [
        "-Wall",
        "-Wextra",
        "-Werror",
    ],
    target: {
        darwin: {
            enabled: false,
@@ -54,12 +61,8 @@ fluoride_defaults {
// default to be used only on platform libs that can rely on shared libchrome
fluoride_defaults {
    name: "libchrome_shared_support_defaults",
    defaults: ["fluoride_common_options"],
    shared_libs: ["libchrome"],
    cflags: [
        "-Wall",
        "-Wextra",
        "-Werror",
    ],
    target: {
        darwin: {
            enabled: false,
@@ -72,13 +75,12 @@ fluoride_defaults {
// requires no shared libraries, and no explicit sanitization.
fluoride_defaults {
    name: "fluoride_types_defaults_fuzzable",
    defaults: ["fluoride_common_options"],
    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: [
+0 −2
Original line number Diff line number Diff line
@@ -21,9 +21,7 @@ cc_library_static {
    cflags: [
        "-O3",
        "-ffast-math",
        "-Werror",
        "-Wmissing-braces",
        "-Wno-unused-parameter",
        "-Wno-#warnings",
        "-Wuninitialized",
        "-Wno-self-assign",
Loading