aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-03-11 15:02:46 -0800
committerDan Willemsen <dwillemsen@google.com>2016-03-11 15:15:50 -0800
commite23dfb7fdccfbc75e3ddc0761e3d12876c06569a (patch)
tree6774a57fd09e281c62c714b936668ad879e63bb5
parent6553f5ef573316f40aa4b00f20b676e6c4026327 (diff)
downloadbuild_soong-e23dfb7fdccfbc75e3ddc0761e3d12876c06569a.tar.gz
build_soong-e23dfb7fdccfbc75e3ddc0761e3d12876c06569a.tar.bz2
build_soong-e23dfb7fdccfbc75e3ddc0761e3d12876c06569a.zip
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
-rw-r--r--common/paths.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/paths.go b/common/paths.go
index 3ea9ef80..8d9f6fd4 100644
--- a/common/paths.go
+++ b/common/paths.go
@@ -173,6 +173,21 @@ type Paths []Path
// 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)