diff options
author | 2025-02-05 02:22:33 +0000 | |
---|---|---|
committer | 2025-02-05 03:13:10 +0000 | |
commit | 7fe65ca1fe21ee107fa7c59fd21eb7ce8bac0bd6 (patch) | |
tree | be540269a26e3c95a8b670e113f744bf35fb6322 | |
parent | 1f10f684516b131b5e6aebdf9b7915cf07409510 (diff) |
rust: Rename flag providers for clarity
Rename the Rust flag and export info providers to make it more clear
when workign with the Rust exporter vs the cc exporter.
Also renames a test for additional clarity.
Test: m blueprint_tests
Change-Id: I652b55ef000a2cd00f47b1dbfe86713c33ae9d63
-rw-r--r-- | rust/library.go | 2 | ||||
-rw-r--r-- | rust/prebuilt.go | 4 | ||||
-rw-r--r-- | rust/rust.go | 10 | ||||
-rw-r--r-- | rust/rust_test.go | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/rust/library.go b/rust/library.go index dd194374f..769a682a6 100644 --- a/rust/library.go +++ b/rust/library.go @@ -768,7 +768,7 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa cc.AddStubDependencyProviders(ctx) // Set our flagexporter provider to export relevant Rust flags - library.flagExporter.setProvider(ctx) + library.flagExporter.setRustProvider(ctx) return ret } diff --git a/rust/prebuilt.go b/rust/prebuilt.go index e35e510da..9bd51115f 100644 --- a/rust/prebuilt.go +++ b/rust/prebuilt.go @@ -158,7 +158,7 @@ func (prebuilt *prebuiltLibraryDecorator) compilerProps() []interface{} { func (prebuilt *prebuiltLibraryDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) buildOutput { prebuilt.flagExporter.exportLinkDirs(android.PathsForModuleSrc(ctx, prebuilt.Properties.Link_dirs).Strings()...) - prebuilt.flagExporter.setProvider(ctx) + prebuilt.flagExporter.setRustProvider(ctx) srcPath := prebuiltPath(ctx, prebuilt) prebuilt.baseCompiler.unstrippedOutputFile = srcPath return buildOutput{outputFile: srcPath} @@ -211,7 +211,7 @@ func (prebuilt *prebuiltProcMacroDecorator) compilerProps() []interface{} { func (prebuilt *prebuiltProcMacroDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) buildOutput { prebuilt.flagExporter.exportLinkDirs(android.PathsForModuleSrc(ctx, prebuilt.Properties.Link_dirs).Strings()...) - prebuilt.flagExporter.setProvider(ctx) + prebuilt.flagExporter.setRustProvider(ctx) srcPath := prebuiltPath(ctx, prebuilt) prebuilt.baseCompiler.unstrippedOutputFile = srcPath return buildOutput{outputFile: srcPath} diff --git a/rust/rust.go b/rust/rust.go index f4fda2224..b1880cf57 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -573,8 +573,8 @@ func (flagExporter *flagExporter) exportWholeStaticLibs(flags ...string) { flagExporter.wholeStaticLibObjects = android.FirstUniqueStrings(append(flagExporter.wholeStaticLibObjects, flags...)) } -func (flagExporter *flagExporter) setProvider(ctx ModuleContext) { - android.SetProvider(ctx, FlagExporterInfoProvider, FlagExporterInfo{ +func (flagExporter *flagExporter) setRustProvider(ctx ModuleContext) { + android.SetProvider(ctx, RustFlagExporterInfoProvider, RustFlagExporterInfo{ LinkDirs: flagExporter.linkDirs, RustLibObjects: flagExporter.rustLibPaths, StaticLibObjects: flagExporter.staticLibObjects, @@ -589,7 +589,7 @@ func NewFlagExporter() *flagExporter { return &flagExporter{} } -type FlagExporterInfo struct { +type RustFlagExporterInfo struct { Flags []string LinkDirs []string RustLibObjects []string @@ -598,7 +598,7 @@ type FlagExporterInfo struct { SharedLibPaths []string } -var FlagExporterInfoProvider = blueprint.NewProvider[FlagExporterInfo]() +var RustFlagExporterInfoProvider = blueprint.NewProvider[RustFlagExporterInfo]() func (mod *Module) isCoverageVariant() bool { return mod.coverage.Properties.IsCoverageVariant @@ -1573,7 +1573,7 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps { directSrcProvidersDeps = append(directSrcProvidersDeps, &dep) } - exportedInfo, _ := android.OtherModuleProvider(ctx, dep, FlagExporterInfoProvider) + exportedInfo, _ := android.OtherModuleProvider(ctx, dep, RustFlagExporterInfoProvider) //Append the dependencies exported objects, except for proc-macros which target a different arch/OS if depTag != procMacroDepTag { diff --git a/rust/rust_test.go b/rust/rust_test.go index 858c4db95..4390f556e 100644 --- a/rust/rust_test.go +++ b/rust/rust_test.go @@ -432,7 +432,7 @@ func TestRustAliases(t *testing.T) { } } -func TestRustRlibs(t *testing.T) { +func TestRustFFIRlibs(t *testing.T) { ctx := testRust(t, ` rust_ffi_static { name: "libbar", |