diff options
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/binary.go | 4 | ||||
| -rw-r--r-- | rust/compiler.go | 4 | ||||
| -rw-r--r-- | rust/rust.go | 37 |
3 files changed, 45 insertions, 0 deletions
diff --git a/rust/binary.go b/rust/binary.go index c2d97f3ab..ca07d07c1 100644 --- a/rust/binary.go +++ b/rust/binary.go @@ -164,3 +164,7 @@ func (binary *binaryDecorator) stdLinkage(ctx *depsContext) RustLinkage { } return binary.baseCompiler.stdLinkage(ctx) } + +func (binary *binaryDecorator) isDependencyRoot() bool { + return true +} diff --git a/rust/compiler.go b/rust/compiler.go index ee88a273f..bcea6cccc 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -236,6 +236,10 @@ func (compiler *baseCompiler) compile(ctx ModuleContext, flags Flags, deps PathD panic(fmt.Errorf("baseCrater doesn't know how to crate things!")) } +func (compiler *baseCompiler) isDependencyRoot() bool { + return false +} + func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps { deps.Rlibs = append(deps.Rlibs, compiler.Properties.Rlibs...) deps.Dylibs = append(deps.Dylibs, compiler.Properties.Dylibs...) diff --git a/rust/rust.go b/rust/rust.go index 105384676..1fa97af96 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -106,6 +106,42 @@ type Module struct { hideApexVariantFromMake bool } +func (mod *Module) Header() bool { + //TODO: If Rust libraries provide header variants, this needs to be updated. + return false +} + +func (mod *Module) SetPreventInstall() { + mod.Properties.PreventInstall = true +} + +// Returns true if the module is "vendor" variant. Usually these modules are installed in /vendor +func (mod *Module) InVendor() bool { + return mod.Properties.ImageVariationPrefix == cc.VendorVariationPrefix +} + +func (mod *Module) SetHideFromMake() { + mod.Properties.HideFromMake = true +} + +func (mod *Module) SanitizePropDefined() bool { + return false +} + +func (mod *Module) IsDependencyRoot() bool { + if mod.compiler != nil { + return mod.compiler.isDependencyRoot() + } + panic("IsDependencyRoot called on a non-compiler Rust module") +} + +func (mod *Module) IsPrebuilt() bool { + if _, ok := mod.compiler.(*prebuiltLibraryDecorator); ok { + return true + } + return false +} + func (mod *Module) OutputFiles(tag string) (android.Paths, error) { switch tag { case "": @@ -281,6 +317,7 @@ type compiler interface { SetDisabled() stdLinkage(ctx *depsContext) RustLinkage + isDependencyRoot() bool } type exportedFlagsProducer interface { |