diff --git a/cc/compiler.go b/cc/compiler.go index f16287803..0cc809d1b 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -134,6 +134,10 @@ type BaseCompilerProperties struct { // list of source files that should not be used to // build the vendor variant of the C/C++ module. Exclude_srcs []string + + // List of additional cflags that should be used to build the vendor + // variant of the C/C++ module. + Cflags []string } } @@ -396,6 +400,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag flags.CppFlags = append([]string{"-std=" + cppStd}, flags.CppFlags...) } + if ctx.vndk() { + flags.CFlags = append(flags.CFlags, esc(compiler.Properties.Target.Vendor.Cflags)...) + } + // We can enforce some rules more strictly in the code we own. strict // indicates if this is code that we can be stricter with. If we have // rules that we want to apply to *our* code (but maybe can't for