diff options
author | Dan Willemsen <dwillemsen@google.com> | 2016-04-20 14:21:14 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2016-04-20 15:54:19 -0700 |
commit | b40aab6955ebb85b8ab5b3934838a4df507fa62c (patch) | |
tree | 22f98d257217aabdd8802571d94de82329451415 /genrule | |
parent | 21b481b757e5599fec65a6a2ab573313b9def713 (diff) | |
download | build_soong-b40aab6955ebb85b8ab5b3934838a4df507fa62c.tar.gz build_soong-b40aab6955ebb85b8ab5b3934838a4df507fa62c.tar.bz2 build_soong-b40aab6955ebb85b8ab5b3934838a4df507fa62c.zip |
Fix generated sources and headers
Add two cc properties: `generated_sources` and `generated_headers`,
instead of just adding genrule modules to `deps`. Label these with the
dep tagging mechanism, add the generated_headers paths to the include
paths, and add dependencies to generated headers for each compile.
Add dependencies so that regular sources can include generated yacc
headers, not just other generated lex/yacc files. Static/shared specific
sources still don't have dependencies to or from regular sources though.
Switch from an implicit dependency on generated files to an orderonly
dependency, since the depfile will take care of the necessary implicit
dependencies for incremental builds.
Change-Id: I436675acb1f57329d98b81c56dcb4384201a68ea
Diffstat (limited to 'genrule')
-rw-r--r-- | genrule/genrule.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go index 248da49c..3c2e331f 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -39,6 +39,7 @@ func init() { type SourceFileGenerator interface { GeneratedSourceFiles() common.Paths + GeneratedHeaderDir() common.Path } type HostToolProvider interface { @@ -68,6 +69,8 @@ type generator struct { deps common.Paths rule blueprint.Rule + genPath common.Path + outputFiles common.Paths } @@ -82,6 +85,10 @@ func (g *generator) GeneratedSourceFiles() common.Paths { return g.outputFiles } +func (g *generator) GeneratedHeaderDir() common.Path { + return g.genPath +} + func genruleDepsMutator(ctx common.AndroidBottomUpMutatorContext) { if g, ok := ctx.Module().(*generator); ok { if g.properties.Tool != "" { @@ -111,6 +118,8 @@ func (g *generator) GenerateAndroidBuildActions(ctx common.AndroidModuleContext) } }) + g.genPath = common.PathForModuleGen(ctx, "") + for _, task := range g.tasks(ctx) { g.generateSourceFile(ctx, task) } |