Add support for genrule

Add genrule, which uses a host executable (possibly built by the
build system) to generate a single source file.  This differs slightly
from gensrcs, which takes a list of sources and translates them through
a host executable to individual source files.

Change-Id: I94bda62c4c53fb3f3817def190e6a7561508d297
This commit is contained in:
Colin Cross
2015-04-28 13:25:36 -07:00
parent c3144b1553
commit d350ecd102
3 changed files with 135 additions and 41 deletions

View File

@@ -1202,6 +1202,7 @@ var _ ccObjectProvider = (*ccObject)(nil)
type CCBinary struct {
CCLinked
out string
installFile string
BinaryProperties struct {
// static_executable: compile executable with -static
Static_executable bool
@@ -1349,7 +1350,14 @@ func (c *CCBinary) compileModule(ctx common.AndroidModuleContext,
}
func (c *CCBinary) installModule(ctx common.AndroidModuleContext, flags CCFlags) {
ctx.InstallFile(filepath.Join("bin", c.Properties.Relative_install_path), c.out)
c.installFile = ctx.InstallFile(filepath.Join("bin", c.Properties.Relative_install_path), c.out)
}
func (c *CCBinary) HostToolPath() string {
if c.HostOrDevice().Host() {
return c.installFile
}
return ""
}
type CCTest struct {