Merge "Only set -Wall once." am: 6769323a44

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2099056

Change-Id: Ic3e70c84cd63178651d680d7617469e00359474c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Yi Kong 2022-05-19 07:59:48 +00:00 committed by Automerger Merge Worker
commit 6dc7f37b34
2 changed files with 2 additions and 3 deletions

View file

@ -4041,7 +4041,7 @@ func TestIncludeDirectoryOrdering(t *testing.T) {
conly := []string{"-fPIC", "${config.CommonGlobalConlyflags}"}
cppOnly := []string{"-fPIC", "${config.CommonGlobalCppflags}", "${config.DeviceGlobalCppflags}", "${config.ArmCppflags}"}
cflags := []string{"-Wall", "-Werror", "-std=candcpp"}
cflags := []string{"-Werror", "-std=candcpp"}
cstd := []string{"-std=gnu11", "-std=conly"}
cppstd := []string{"-std=gnu++17", "-std=cpp", "-fno-rtti"}

View file

@ -590,9 +590,8 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
} else if !inList("-Werror", flags.Local.CFlags) && !inList("-Werror", flags.Local.CppFlags) {
if warningsAreAllowed(ctx.ModuleDir()) {
addToModuleList(ctx, modulesAddedWallKey, module)
flags.Local.CFlags = append([]string{"-Wall"}, flags.Local.CFlags...)
} else {
flags.Local.CFlags = append([]string{"-Wall", "-Werror"}, flags.Local.CFlags...)
flags.Local.CFlags = append([]string{"-Werror"}, flags.Local.CFlags...)
}
}
}