Loading rust/binary.go +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ func NewRustBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator module := newModule(hod, android.MultilibFirst) binary := &binaryDecorator{ baseCompiler: NewBaseCompiler("bin", ""), baseCompiler: NewBaseCompiler("bin", "", InstallInSystem), } module.compiler = binary Loading rust/compiler.go +14 −1 Original line number Diff line number Diff line Loading @@ -36,14 +36,22 @@ func (compiler *baseCompiler) setNoStdlibs() { compiler.Properties.No_stdlibs = proptools.BoolPtr(true) } func NewBaseCompiler(dir, dir64 string) *baseCompiler { func NewBaseCompiler(dir, dir64 string, location installLocation) *baseCompiler { return &baseCompiler{ Properties: BaseCompilerProperties{}, dir: dir, dir64: dir64, location: location, } } type installLocation int const ( InstallInSystem installLocation = 0 InstallInData = iota ) type BaseCompilerProperties struct { // whether to pass "-D warnings" to rustc. Defaults to true. Deny_warnings *bool Loading Loading @@ -109,10 +117,15 @@ type baseCompiler struct { subDir string relative string path android.InstallPath location installLocation } var _ compiler = (*baseCompiler)(nil) func (compiler *baseCompiler) inData() bool { return compiler.location == InstallInData } func (compiler *baseCompiler) compilerProps() []interface{} { return []interface{}{&compiler.Properties} } Loading rust/library.go +1 −1 Original line number Diff line number Diff line Loading @@ -290,7 +290,7 @@ func NewRustLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorat BuildShared: true, BuildStatic: true, }, baseCompiler: NewBaseCompiler("lib", "lib64"), baseCompiler: NewBaseCompiler("lib", "lib64", InstallInSystem), } module.compiler = library Loading rust/proc_macro.go +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ func NewProcMacro(hod android.HostOrDeviceSupported) (*Module, *procMacroDecorat module := newModule(hod, android.MultilibFirst) procMacro := &procMacroDecorator{ baseCompiler: NewBaseCompiler("lib", "lib64"), baseCompiler: NewBaseCompiler("lib", "lib64", InstallInSystem), } module.compiler = procMacro Loading rust/rust.go +8 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,7 @@ type compiler interface { compilerDeps(ctx DepsContext, deps Deps) Deps crateName() string inData() bool install(ctx ModuleContext, path android.Path) relativeInstallPath() string } Loading Loading @@ -681,6 +682,13 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { return depPaths } func (mod *Module) InstallInData() bool { if mod.compiler == nil { return false } return mod.compiler.inData() } func linkPathFromFilePath(filepath android.Path) string { return strings.Split(filepath.String(), filepath.Base())[0] } Loading Loading
rust/binary.go +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ func NewRustBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator module := newModule(hod, android.MultilibFirst) binary := &binaryDecorator{ baseCompiler: NewBaseCompiler("bin", ""), baseCompiler: NewBaseCompiler("bin", "", InstallInSystem), } module.compiler = binary Loading
rust/compiler.go +14 −1 Original line number Diff line number Diff line Loading @@ -36,14 +36,22 @@ func (compiler *baseCompiler) setNoStdlibs() { compiler.Properties.No_stdlibs = proptools.BoolPtr(true) } func NewBaseCompiler(dir, dir64 string) *baseCompiler { func NewBaseCompiler(dir, dir64 string, location installLocation) *baseCompiler { return &baseCompiler{ Properties: BaseCompilerProperties{}, dir: dir, dir64: dir64, location: location, } } type installLocation int const ( InstallInSystem installLocation = 0 InstallInData = iota ) type BaseCompilerProperties struct { // whether to pass "-D warnings" to rustc. Defaults to true. Deny_warnings *bool Loading Loading @@ -109,10 +117,15 @@ type baseCompiler struct { subDir string relative string path android.InstallPath location installLocation } var _ compiler = (*baseCompiler)(nil) func (compiler *baseCompiler) inData() bool { return compiler.location == InstallInData } func (compiler *baseCompiler) compilerProps() []interface{} { return []interface{}{&compiler.Properties} } Loading
rust/library.go +1 −1 Original line number Diff line number Diff line Loading @@ -290,7 +290,7 @@ func NewRustLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorat BuildShared: true, BuildStatic: true, }, baseCompiler: NewBaseCompiler("lib", "lib64"), baseCompiler: NewBaseCompiler("lib", "lib64", InstallInSystem), } module.compiler = library Loading
rust/proc_macro.go +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ func NewProcMacro(hod android.HostOrDeviceSupported) (*Module, *procMacroDecorat module := newModule(hod, android.MultilibFirst) procMacro := &procMacroDecorator{ baseCompiler: NewBaseCompiler("lib", "lib64"), baseCompiler: NewBaseCompiler("lib", "lib64", InstallInSystem), } module.compiler = procMacro Loading
rust/rust.go +8 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,7 @@ type compiler interface { compilerDeps(ctx DepsContext, deps Deps) Deps crateName() string inData() bool install(ctx ModuleContext, path android.Path) relativeInstallPath() string } Loading Loading @@ -681,6 +682,13 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { return depPaths } func (mod *Module) InstallInData() bool { if mod.compiler == nil { return false } return mod.compiler.inData() } func linkPathFromFilePath(filepath android.Path) string { return strings.Split(filepath.String(), filepath.Base())[0] } Loading