From bb3add11046ec3fde6401e42ff480bf589cd5567 Mon Sep 17 00:00:00 2001 From: Matthew Maurer Date: Thu, 25 Jun 2020 09:34:12 -0700 Subject: rust: Suppress default sysroot unconditionally With proper prebuilt modules, we can avoid any rustc implicit sysroot searching. Asd a bonus, this should make rust-project.json generation correctly grab otherwise implicit dependencies. Prebuilt rlibs may include several dependency rlibs. Without a link_dirs attribute, every dependency (even if unexported) would need a separate module. Previously we were casing out on exact structs, which might be OK when libraryDecorator and procMacroDecorator were the only possibilities, but repeating the logic for three types is too much. Using an interface makes this logic scale better. Bug: 159591910 Test: cd external/rust; mma; m crosvm.experimental Change-Id: Ia1124e09f48cd05e39f094bbcb988622ebd2272f --- rust/proc_macro.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rust/proc_macro.go') diff --git a/rust/proc_macro.go b/rust/proc_macro.go index b04808702..2719161e5 100644 --- a/rust/proc_macro.go +++ b/rust/proc_macro.go @@ -27,6 +27,7 @@ type ProcMacroCompilerProperties struct { type procMacroDecorator struct { *baseCompiler + *flagExporter Properties ProcMacroCompilerProperties } @@ -35,6 +36,7 @@ type procMacroInterface interface { } var _ compiler = (*procMacroDecorator)(nil) +var _ exportedFlagsProducer = (*procMacroDecorator)(nil) func ProcMacroFactory() android.Module { module, _ := NewProcMacro(android.HostSupportedNoCross) @@ -46,6 +48,7 @@ func NewProcMacro(hod android.HostOrDeviceSupported) (*Module, *procMacroDecorat procMacro := &procMacroDecorator{ baseCompiler: NewBaseCompiler("lib", "lib64", InstallInSystem), + flagExporter: NewFlagExporter(), } module.compiler = procMacro -- cgit v1.2.3-59-g8ed1b