summaryrefslogtreecommitdiff
path: root/rust/rust.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-07-09 17:38:55 +0100
committer Paul Duffin <paulduffin@google.com> 2021-07-09 23:54:01 +0100
commitd5cf92e29874c29a65e99ab14a41af40a092a1a5 (patch)
tree60420ca4c38777f907fad24cb56232fcb933dfe7 /rust/rust.go
parent4fbfb59d3e43d92a2ef5c50049210dfcb634fc9e (diff)
Support customizing behavior around sourceOrOutputDependencyTag
Previously, modules customized behavior around the handling of sourceOrOutputDependencyTag by comparing them to android.SourceDepTag and retrieving the module using something like this: ctx.GetDirectDepWithTag(m, android.SourceDepTag) The problem with that is it does not allow an output tag to be specified and does not handle fully qualified names properly. This adds the following: * IsSourceDepTag and IsSourceDepTagWithOutputTag to check whether a blueprint.DependencyTag is a sourceOrOutputDependencyTag. The latter also checks that it has the correct output tag. * GetModuleFromPathDep(ctx, moduleName, outputTag) as a replacement for ctx.GetDirectDepWithTag(m, android.SourceDepTag). Replaces usages of: * t == SourceDepTag with IsSourceDepTagWithOutputTag(t, "") * ctx.GetDirectDepWithTag(m, android.SourceDepTag) with GetModuleFromPathDep(ctx, m, "") It also deprecates the following: * android.SourcDepTag - as a follow up change needs to modify the sourceOrOutputDependencyTag will make this useless. * ExpandSources, ExpandsSources - copies existing deprecated messages from the implementation to the interface so that they can be seen by users of that interface. Bug: 193228441 Test: m nothing Change-Id: I8c397232b8d7dc1f9702c04ad45ea7819d4631ae
Diffstat (limited to 'rust/rust.go')
-rw-r--r--rust/rust.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/rust/rust.go b/rust/rust.go
index 0a9869fdc..38f1742d4 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -990,7 +990,9 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
case procMacroDepTag:
directProcMacroDeps = append(directProcMacroDeps, rustDep)
mod.Properties.AndroidMkProcMacroLibs = append(mod.Properties.AndroidMkProcMacroLibs, makeLibName)
- case android.SourceDepTag:
+ }
+
+ if android.IsSourceDepTagWithOutputTag(depTag, "") {
// Since these deps are added in path_properties.go via AddDependencies, we need to ensure the correct
// OS/Arch variant is used.
var helper string
@@ -1120,8 +1122,7 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
}
if srcDep, ok := dep.(android.SourceFileProducer); ok {
- switch depTag {
- case android.SourceDepTag:
+ if android.IsSourceDepTagWithOutputTag(depTag, "") {
// These are usually genrules which don't have per-target variants.
directSrcDeps = append(directSrcDeps, srcDep)
}