-
Notifications
You must be signed in to change notification settings - Fork 565
Expand file tree
/
Copy pathBUILD.bazel
More file actions
26 lines (23 loc) · 995 Bytes
/
BUILD.bazel
File metadata and controls
26 lines (23 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
load("@rules_rust//rust:defs.bzl", "rust_library")
package(
default_visibility = ["@rules_rust//ffi/rs:__subpackages__"],
)
srcs = select({
# Windows doesn't support weak symbol linkage.
# If someone can make this work on Windows, please do!
# For now we will silently not supply any symbols, because it would be very messy to conditionally define the global allocator library on toolchains depending on the platform.
"@platforms//os:windows": ["empty.rs"],
"//conditions:default": ["global_allocator_library.rs"],
})
rust_library(
name = "global_allocator_library",
srcs = srcs,
allocator_libraries = "@rules_rust//ffi/rs:empty_allocator_libraries",
edition = "2024",
rustc_env = {"RUSTC_BOOTSTRAP": "1"},
rustc_flags = select({
"//rust/settings:experimental_use_allocator_libraries_with_mangled_symbols.legacy.rg_oom": ["--cfg=rules_rust_allocator_legacy_rg_oom"],
"//conditions:default": [],
}),
tags = ["manual"],
)