Support missing include dirs for unbundled branches
Treat absolute paths specified from a module (include_dirs, etc) like
actual module dependencies. If it doesn't exist, produce a ninja error
instead of refusing to create the ninja file.
Change-Id: I662b9bb2af04b2006984a07d1ccb700b63dde582
diff --git a/common/paths.go b/common/paths.go
index 3ea9ef8..8d9f6fd 100644
--- a/common/paths.go
+++ b/common/paths.go
@@ -173,6 +173,21 @@
// PathsForSource returns Paths rooted from SrcDir
func PathsForSource(ctx PathContext, paths []string) Paths {
+ if pathConfig(ctx).AllowMissingDependencies() {
+ if modCtx, ok := ctx.(AndroidModuleContext); ok {
+ ret := make(Paths, 0, len(paths))
+ intermediates := PathForModuleOut(modCtx, "missing").String()
+ for _, path := range paths {
+ p := OptionalPathForSource(ctx, intermediates, path)
+ if p.Valid() {
+ ret = append(ret, p.Path())
+ } else {
+ modCtx.AddMissingDependencies([]string{path})
+ }
+ }
+ return ret
+ }
+ }
ret := make(Paths, len(paths))
for i, path := range paths {
ret[i] = PathForSource(ctx, path)