Skip to content
File

Blob: deps/rust/BUILD.bazel

975 bytes
1load("@bazel_skylib//lib:selects.bzl", "selects")
2load("@bazel_skylib//rules:write_file.bzl", "write_file")
3load("@rules_cc//cc:cc_library.bzl", "cc_library")
4load("@rules_rust//rust:defs.bzl", "rust_static_library")
5 
6# Adds missing symbols following Rust mangling change, plus missing system library on Windows.
7cc_library(
8 name = "runtime",
9 linkopts = select({
10 "@platforms//os:windows": [
11 "ntdll.lib",
12 ],
13 "//conditions:default": [],
14 }),
15 visibility = ["//visibility:public"],
16 deps = [":empty_lib"],
17)
18 
19write_file(
20 name = "lib_rs",
21 out = "lib.rs",
22 tags = ["manual"],
23)
24 
25rust_static_library(
26 name = "empty_lib",
27 srcs = [":lib.rs"],
28 # When stamping is enabled this will be replaced by the corresponding
29 # value in ./bazel-out/volatile-status.txt
30 rustc_env = {
31 "WORKERD_VERSION": "{WORKERD_VERSION}",
32 },
33 stamp = -1, # default to bazel --stamp flag
34 tags = ["manual"],
35)