Allow cc.LinkabeInterfaces to request "" variants.
cc.LinkableInterfaces should be able to request if an empty variant is required from the LinkageMutator. We were previously assuming that if only static or shared libraries were being built, then we didn't need the empty variant. However this should be explicit to handle cases where the default set of variants being created may not include both static and shared libraries. Bug: 144861059 Test: m -j crosvm.experimental Change-Id: I66724bdc16ff350b06dfa4d049c82f33019979a5
This commit is contained in:
13
rust/rust.go
13
rust/rust.go
@@ -89,6 +89,19 @@ func (mod *Module) SelectedStl() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (mod *Module) NonCcVariants() bool {
|
||||
if mod.compiler != nil {
|
||||
if library, ok := mod.compiler.(libraryInterface); ok {
|
||||
if library.buildRlib() || library.buildDylib() {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
panic(fmt.Errorf("NonCcVariants called on non-library module: %q", mod.BaseModuleName()))
|
||||
}
|
||||
|
||||
func (mod *Module) ApiLevel() string {
|
||||
panic(fmt.Errorf("Called ApiLevel on Rust module %q; stubs libraries are not yet supported.", mod.BaseModuleName()))
|
||||
}
|
||||
|
Reference in New Issue
Block a user