Merge "Ninja and shell escape command line flags"
diff --git a/cc/androidmk.go b/cc/androidmk.go
index f446333..a4d7fcf 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -100,6 +100,10 @@
if len(exportedIncludes) > 0 {
fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DIRS :=", strings.Join(exportedIncludes, " "))
}
+ exportedIncludeDeps := library.exportedFlagsDeps()
+ if len(exportedIncludeDeps) > 0 {
+ fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DEPS :=", strings.Join(exportedIncludeDeps.Strings(), " "))
+ }
fmt.Fprintln(w, "LOCAL_BUILT_MODULE_STEM := $(LOCAL_MODULE)"+outputFile.Ext())
@@ -192,6 +196,12 @@
}
func (installer *baseInstaller) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
+ // Soong installation is only supported for host modules. Have Make
+ // installation trigger Soong installation.
+ if ctx.Target().Os.Class == android.Host {
+ ret.OutputFile = android.OptionalPathForPath(installer.path)
+ }
+
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
path := installer.path.RelPathString()
dir, file := filepath.Split(path)
diff --git a/cc/cc.go b/cc/cc.go
index 66c47c1..9a19812 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -80,6 +80,7 @@
GeneratedHeaders android.Paths
Flags, ReexportedFlags []string
+ ReexportedFlagsDeps android.Paths
CrtBegin, CrtEnd android.OptionalPath
}
@@ -760,6 +761,8 @@
depPaths.Flags = append(depPaths.Flags, flags)
if tag == genHeaderExportDepTag {
depPaths.ReexportedFlags = append(depPaths.ReexportedFlags, flags)
+ depPaths.ReexportedFlagsDeps = append(depPaths.ReexportedFlagsDeps,
+ genRule.GeneratedSourceFiles()...)
}
} else {
ctx.ModuleErrorf("module %q is not a genrule", name)
@@ -799,10 +802,13 @@
if t, ok := tag.(dependencyTag); ok && t.library {
if i, ok := cc.linker.(exportedFlagsProducer); ok {
flags := i.exportedFlags()
+ deps := i.exportedFlagsDeps()
depPaths.Flags = append(depPaths.Flags, flags...)
+ depPaths.GeneratedHeaders = append(depPaths.GeneratedHeaders, deps...)
if t.reexportFlags {
depPaths.ReexportedFlags = append(depPaths.ReexportedFlags, flags...)
+ depPaths.ReexportedFlagsDeps = append(depPaths.ReexportedFlagsDeps, deps...)
}
}
diff --git a/cc/library.go b/cc/library.go
index cc5ff15..7cc587f 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -117,7 +117,8 @@
type flagExporter struct {
Properties FlagExporterProperties
- flags []string
+ flags []string
+ flagsDeps android.Paths
}
func (f *flagExporter) exportIncludes(ctx ModuleContext, inc string) {
@@ -131,12 +132,21 @@
f.flags = append(f.flags, flags...)
}
+func (f *flagExporter) reexportDeps(deps android.Paths) {
+ f.flagsDeps = append(f.flagsDeps, deps...)
+}
+
func (f *flagExporter) exportedFlags() []string {
return f.flags
}
+func (f *flagExporter) exportedFlagsDeps() android.Paths {
+ return f.flagsDeps
+}
+
type exportedFlagsProducer interface {
exportedFlags() []string
+ exportedFlagsDeps() android.Paths
}
var _ exportedFlagsProducer = (*flagExporter)(nil)
@@ -445,6 +455,7 @@
library.exportIncludes(ctx, "-I")
library.reexportFlags(deps.ReexportedFlags)
+ library.reexportDeps(deps.ReexportedFlagsDeps)
return out
}