Add yacc generated headers to the include path am: e1a3ce3609 am: 967f8d4750

am: e092b92b63

Change-Id: If85a086bbe27051d250400aefb0b54c06c28b5df
This commit is contained in:
Dan Willemsen 2016-11-03 07:25:07 +00:00 committed by android-build-merger
commit 5f131206ac
2 changed files with 10 additions and 5 deletions

View file

@ -124,7 +124,7 @@ func (compiler *baseCompiler) compilerDeps(ctx BaseModuleContext, deps Deps) Dep
deps.GeneratedSources = append(deps.GeneratedSources, compiler.Properties.Generated_sources...)
deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers...)
if compiler.hasProto() {
if compiler.hasSrcExt(".proto") {
deps = protoDeps(ctx, deps, &compiler.Proto)
}
@ -322,16 +322,21 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag
flags.CFlags = append(flags.CFlags, "-DANDROID_STRICT")
}
if compiler.hasProto() {
if compiler.hasSrcExt(".proto") {
flags = protoFlags(ctx, flags, &compiler.Proto)
}
if compiler.hasSrcExt(".y") || compiler.hasSrcExt(".yy") {
flags.GlobalFlags = append(flags.GlobalFlags,
"-I"+android.PathForModuleGen(ctx, "yacc", ctx.ModuleDir()).String())
}
return flags
}
func (compiler *baseCompiler) hasProto() bool {
func (compiler *baseCompiler) hasSrcExt(ext string) bool {
for _, src := range compiler.Properties.Srcs {
if filepath.Ext(src) == ".proto" {
if filepath.Ext(src) == ext {
return true
}
}

View file

@ -477,7 +477,7 @@ func (library *libraryDecorator) link(ctx ModuleContext,
library.reexportFlags(deps.ReexportedFlags)
library.reexportDeps(deps.ReexportedFlagsDeps)
if library.baseCompiler.hasProto() {
if library.baseCompiler.hasSrcExt(".proto") {
if library.Properties.Proto.Export_proto_headers {
library.reexportFlags([]string{
"-I" + protoSubDir(ctx).String(),