From 2c0a180be04d49239ef635f34ac60402ddc27cea Mon Sep 17 00:00:00 2001 From: Isaac Chen Date: Tue, 15 Oct 2019 17:16:05 +0800 Subject: [PATCH] Extend ALLOW_MISSING_DEPENDENCIES coverage Make build system respect ALLOW_MISSING_DEPENDENCIES, when building architecture B products, and ignore targets with dependencies that are not available for architecture B. Bug: 142701187 Test: # Add a dummy Android.bp with a module only for arm64 $ m -j TARGET_PRODUCT=aosp_x86 TARGET_BUILD_VARIANT=userdebug Change-Id: I64de33674732df8c286671c806a07bcd19862b80 --- cc/cc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cc/cc.go b/cc/cc.go index f6f8abbf8..10c425ac6 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1925,7 +1925,11 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps { if ptr != nil { if !linkFile.Valid() { - ctx.ModuleErrorf("module %q missing output file", depName) + if !ctx.Config().AllowMissingDependencies() { + ctx.ModuleErrorf("module %q missing output file", depName) + } else { + ctx.AddMissingDependencies([]string{depName}) + } return } *ptr = append(*ptr, linkFile.Path())