diff options
Diffstat (limited to 'aconfig/codegen/cc_aconfig_library.go')
| -rw-r--r-- | aconfig/codegen/cc_aconfig_library.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/aconfig/codegen/cc_aconfig_library.go b/aconfig/codegen/cc_aconfig_library.go index ce3745665..528c100f3 100644 --- a/aconfig/codegen/cc_aconfig_library.go +++ b/aconfig/codegen/cc_aconfig_library.go @@ -99,7 +99,12 @@ func (this *CcAconfigLibraryCallbacks) GeneratorSources(ctx cc.ModuleContext) cc // Get the values that came from the global RELEASE_ACONFIG_VALUE_SETS flag declarationsModules := ctx.GetDirectDepsProxyWithTag(ccDeclarationsTag) if len(declarationsModules) != 1 { - panic(fmt.Errorf("Exactly one aconfig_declarations property required")) + if ctx.Config().AllowMissingDependencies() { + ctx.AddMissingDependencies([]string{"exactly_one_aconfig_declarations_required"}) + return result + } else { + panic(fmt.Errorf("Exactly one aconfig_declarations property required")) + } } declarations, _ := android.OtherModuleProvider(ctx, declarationsModules[0], android.AconfigDeclarationsProviderKey) @@ -129,7 +134,12 @@ func (this *CcAconfigLibraryCallbacks) GeneratorBuildActions(ctx cc.ModuleContex // Get the values that came from the global RELEASE_ACONFIG_VALUE_SETS flag declarationsModules := ctx.GetDirectDepsProxyWithTag(ccDeclarationsTag) if len(declarationsModules) != 1 { - panic(fmt.Errorf("Exactly one aconfig_declarations property required")) + if ctx.Config().AllowMissingDependencies() { + ctx.AddMissingDependencies([]string{"exactly_one_aconfig_declarations_required"}) + return + } else { + panic("Exactly one aconfig_declarations property required") + } } declarations, _ := android.OtherModuleProvider(ctx, declarationsModules[0], android.AconfigDeclarationsProviderKey) |
