-
Notifications
You must be signed in to change notification settings - Fork 564
Expand file tree
/
Copy pathBUILD.bazel
More file actions
44 lines (37 loc) · 1.29 KB
/
BUILD.bazel
File metadata and controls
44 lines (37 loc) · 1.29 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
load("@rules_rust//rust:defs.bzl", "rust_library")
# buildifier: disable=bzl-visibility
load(
"@rules_rust//rust/private:rust.bzl",
"rust_library_without_process_wrapper",
)
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 default allocator library on toolchains depending on the platform.
"@platforms//os:windows": ["empty.rs"],
"//conditions:default": ["allocator_library.rs"],
})
# This is hacky, but lets us compile the shims even on stable.
rustc_env = {"RUSTC_BOOTSTRAP": "1"}
rustc_flags = []
rust_library(
name = "allocator_library",
srcs = srcs,
allocator_libraries = "@rules_rust//ffi/rs:empty_allocator_libraries",
edition = "2024",
rustc_env = rustc_env,
rustc_flags = rustc_flags,
tags = ["manual"],
)
rust_library_without_process_wrapper(
name = "allocator_library_without_process_wrapper",
srcs = srcs,
allocator_libraries = "@rules_rust//ffi/rs:empty_allocator_libraries",
edition = "2024",
rustc_env = rustc_env,
rustc_flags = rustc_flags,
tags = ["manual"],
)