diff options
author | Dan Willemsen <dwillemsen@google.com> | 2016-03-11 15:02:46 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2016-03-11 15:15:50 -0800 |
commit | e23dfb7fdccfbc75e3ddc0761e3d12876c06569a (patch) | |
tree | 6774a57fd09e281c62c714b936668ad879e63bb5 /common | |
parent | 6553f5ef573316f40aa4b00f20b676e6c4026327 (diff) | |
download | build_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
Diffstat (limited to 'common')
-rw-r--r-- | common/paths.go | 15 |
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) |