Merge "Export device arm64 rust flags to Bazel" into main am: 001ec85bcc
am: 59ffcbd8de
am: b1182cefa4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2773604 Change-Id: I33213c49c3f0b97f0ff51e0499a55da56ea6ca92 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
af3b2d6e00
2 changed files with 14 additions and 5 deletions
|
@ -54,6 +54,7 @@ func init() {
|
|||
strings.Join(rustFlags, " "))
|
||||
}
|
||||
|
||||
ExportedVars.ExportStringListStaticVariable("DEVICE_ARM64_RUSTC_FLAGS", Arm64RustFlags)
|
||||
}
|
||||
|
||||
type toolchainArm64 struct {
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
|
||||
var (
|
||||
pctx = android.NewPackageContext("android/soong/rust/config")
|
||||
exportedVars = android.NewExportedVariables(pctx)
|
||||
ExportedVars = android.NewExportedVariables(pctx)
|
||||
|
||||
RustDefaultVersion = "1.72.0"
|
||||
RustDefaultBase = "prebuilts/rust/"
|
||||
|
@ -111,9 +111,17 @@ func init() {
|
|||
|
||||
pctx.StaticVariable("DeviceGlobalLinkFlags", strings.Join(deviceGlobalLinkFlags, " "))
|
||||
|
||||
exportedVars.ExportStringStaticVariable("RUST_DEFAULT_VERSION", RustDefaultVersion)
|
||||
exportedVars.ExportStringListStaticVariable("GLOBAL_RUSTC_FLAGS", GlobalRustFlags)
|
||||
exportedVars.ExportStringListStaticVariable("LINUX_HOST_GLOBAL_LINK_FLAGS", LinuxHostGlobalLinkFlags)
|
||||
ExportedVars.ExportStringStaticVariable("RUST_DEFAULT_VERSION", RustDefaultVersion)
|
||||
ExportedVars.ExportStringListStaticVariable("GLOBAL_RUSTC_FLAGS", GlobalRustFlags)
|
||||
ExportedVars.ExportStringListStaticVariable("LINUX_HOST_GLOBAL_LINK_FLAGS", LinuxHostGlobalLinkFlags)
|
||||
|
||||
ExportedVars.ExportStringListStaticVariable("DEVICE_GLOBAL_RUSTC_FLAGS", deviceGlobalRustFlags)
|
||||
ExportedVars.ExportStringListStaticVariable("DEVICE_GLOBAL_LINK_FLAGS",
|
||||
android.RemoveListFromList(deviceGlobalLinkFlags, []string{
|
||||
// The cc_config flags are retrieved from cc_toolchain by rust rules.
|
||||
"${cc_config.DeviceGlobalLldflags}",
|
||||
"-B${cc_config.ClangBin}",
|
||||
}))
|
||||
}
|
||||
|
||||
func HostPrebuiltTag(config android.Config) string {
|
||||
|
@ -137,5 +145,5 @@ func GetRustVersion(ctx android.PathContext) string {
|
|||
|
||||
// BazelRustToolchainVars returns a string with
|
||||
func BazelRustToolchainVars(config android.Config) string {
|
||||
return android.BazelToolchainVars(config, exportedVars)
|
||||
return android.BazelToolchainVars(config, ExportedVars)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue