Merge "Add "aidl.flags:" property for cc_/java_ modules"
This commit is contained in:
@@ -4356,3 +4356,21 @@ func TestStubsLibReexportsHeaders(t *testing.T) {
|
||||
t.Errorf("expected %q in cflags, got %q", "-Iinclude/libbar", cFlags)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAidlFlagsPassedToTheAidlCompiler(t *testing.T) {
|
||||
ctx := testCc(t, `
|
||||
cc_library {
|
||||
name: "libfoo",
|
||||
srcs: ["a/Foo.aidl"],
|
||||
aidl: { flags: ["-Werror"], },
|
||||
}
|
||||
`)
|
||||
|
||||
libfoo := ctx.ModuleForTests("libfoo", "android_arm64_armv8-a_static")
|
||||
manifest := android.RuleBuilderSboxProtoForTests(t, libfoo.Output("aidl.sbox.textproto"))
|
||||
aidlCommand := manifest.Commands[0].GetCommand()
|
||||
expectedAidlFlag := "-Werror"
|
||||
if !strings.Contains(aidlCommand, expectedAidlFlag) {
|
||||
t.Errorf("aidl command %q does not contain %q", aidlCommand, expectedAidlFlag)
|
||||
}
|
||||
}
|
||||
|
@@ -123,6 +123,9 @@ type BaseCompilerProperties struct {
|
||||
|
||||
// whether to generate traces (for systrace) for this interface
|
||||
Generate_traces *bool
|
||||
|
||||
// list of flags that will be passed to the AIDL compiler
|
||||
Flags []string
|
||||
}
|
||||
|
||||
Renderscript struct {
|
||||
@@ -521,6 +524,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
||||
}
|
||||
|
||||
if compiler.hasSrcExt(".aidl") {
|
||||
flags.aidlFlags = append(flags.aidlFlags, compiler.Properties.Aidl.Flags...)
|
||||
if len(compiler.Properties.Aidl.Local_include_dirs) > 0 {
|
||||
localAidlIncludeDirs := android.PathsForModuleSrc(ctx, compiler.Properties.Aidl.Local_include_dirs)
|
||||
flags.aidlFlags = append(flags.aidlFlags, includeDirsToFlags(localAidlIncludeDirs))
|
||||
|
Reference in New Issue
Block a user