diff options
author | 2023-09-22 03:58:59 +0000 | |
---|---|---|
committer | 2023-09-22 22:05:54 +0000 | |
commit | 9c64274b275a00d7753bbe1a15945652521b2044 (patch) | |
tree | 2ce76ca4f1fd585328de3d4c6365bb72e89c1a7c /rust/toolchain_library.go | |
parent | 789a7e0883d5e142ff98898ac02797f106d38b9c (diff) |
Revert^3 "add crate_root property to rust modules"
60375c4adf0753d0e2519ebf1b908d424dd2d466
Change-Id: I356e936139592893a47d4c6b9e747f24470b11f9
Diffstat (limited to 'rust/toolchain_library.go')
-rw-r--r-- | rust/toolchain_library.go | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/rust/toolchain_library.go b/rust/toolchain_library.go index cb345a4b6..2b2f88520 100644 --- a/rust/toolchain_library.go +++ b/rust/toolchain_library.go @@ -41,10 +41,8 @@ func init() { } type toolchainLibraryProperties struct { - // path to the toolchain crate root, relative to the top of the toolchain source - Toolchain_crate_root *string `android:"arch_variant"` - // path to the rest of the toolchain srcs, relative to the top of the toolchain source - Toolchain_srcs []string `android:"arch_variant"` + // path to the toolchain source, relative to the top of the toolchain source + Toolchain_src *string `android:"arch_variant"` } type toolchainLibraryDecorator struct { @@ -90,20 +88,15 @@ func initToolchainLibrary(module *Module, library *libraryDecorator) android.Mod func rustSetToolchainSource(ctx android.LoadHookContext) { if toolchainLib, ok := ctx.Module().(*Module).compiler.(*toolchainLibraryDecorator); ok { prefix := filepath.Join(config.HostPrebuiltTag(ctx.Config()), GetRustPrebuiltVersion(ctx)) - versionedCrateRoot := path.Join(prefix, android.String(toolchainLib.Properties.Toolchain_crate_root)) - versionedSrcs := make([]string, len(toolchainLib.Properties.Toolchain_srcs)) - for i, src := range toolchainLib.Properties.Toolchain_srcs { - versionedSrcs[i] = path.Join(prefix, src) - } + newSrcs := []string{path.Join(prefix, android.String(toolchainLib.Properties.Toolchain_src))} type props struct { - Crate_root *string - Srcs []string + Srcs []string } p := &props{} - p.Crate_root = &versionedCrateRoot - p.Srcs = versionedSrcs + p.Srcs = newSrcs ctx.AppendProperties(p) + } else { ctx.ModuleErrorf("Called rustSetToolchainSource on a non-Rust Module.") } |