diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index d018af519d6c07..9ab76ef27b68af 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -136,7 +136,6 @@ config("optimize_default") { config("disabled_warnings") { cflags = [ "-Wno-deprecated-declarations", - "-Wno-unknown-warning-option", "-Wno-missing-field-initializers", "-Wno-unused-parameter", ] @@ -150,6 +149,9 @@ config("disabled_warnings") { "-Wno-cast-function-type", ] } + else { + cflags += [ "-Wno-unknown-warning-option" ] + } } config("strict_warnings") { diff --git a/config/mbed/chip-gn/.gn b/config/mbed/chip-gn/.gn index 0ae417efaade6f..16511ad58e23d5 100644 --- a/config/mbed/chip-gn/.gn +++ b/config/mbed/chip-gn/.gn @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/build.gni") + # The location of the build configuration file. buildconfig = "//build/config/BUILDCONFIG.gn" @@ -22,5 +24,10 @@ default_args = { target_cpu = "arm" target_os = "mbed" + default_configs_warnings = [ + "${build_root}/config/compiler:warnings_default", + "//:chip_custom_cflags_config" + ] + import("//args.gni") } diff --git a/config/mbed/chip-gn/BUILD.gn b/config/mbed/chip-gn/BUILD.gn index f3f708aa493094..b92f0c3ec5f0bf 100644 --- a/config/mbed/chip-gn/BUILD.gn +++ b/config/mbed/chip-gn/BUILD.gn @@ -19,6 +19,11 @@ assert(current_os == "mbed") declare_args() { chip_build_libshell = false + chip_custom_build_cflags = [] +} + +config("chip_custom_cflags_config") { + cflags = chip_custom_build_cflags } group("mbed") { diff --git a/config/mbed/chip-gn/args.gni b/config/mbed/chip-gn/args.gni index 40782a51aadd84..f8b9ce9f6af867 100644 --- a/config/mbed/chip-gn/args.gni +++ b/config/mbed/chip-gn/args.gni @@ -21,6 +21,13 @@ chip_project_config_include = "" chip_system_project_config_include = "" chip_device_project_config_include = "" +chip_custom_build_cflags = [ + "-Wno-shadow", + "-Wno-conversion", + "-Wno-maybe-uninitialized", + "-Wno-return-type" + ] + custom_toolchain = "//toolchain:mbed" mbedtls_target = "//mbedtls:mbedtls"