mongo/bazel/rules_rust/BUILD.bazel
Andrew Bradshaw 9f9bac4916 SERVER-120523 Get wasm_mozjs_test working on windows (#50448)
GitOrigin-RevId: 4b11c6f56f922317d6d78404b6b7200e4802381d
2026-03-26 21:10:55 +00:00

18 lines
748 B
Python

load("@rules_rust//rust:defs.bzl", "rust_library")
package(default_visibility = ["//visibility:public"])
# Allocator shim for linking Rust rlibs into a C++ binary on Windows.
# On Linux, rules_rust provides this automatically. On Windows, MSVC doesn't
# support weak linkage so rules_rust's allocator library is empty. We provide
# strong symbol definitions here since we only link into C++ binaries.
rust_library(
name = "win_allocator_shim",
srcs = ["win_allocator_shim.rs"],
# Use empty allocator libraries to avoid circular dependency - this IS
# the allocator library.
allocator_libraries = "@rules_rust//ffi/rs:empty_allocator_libraries",
edition = "2024",
target_compatible_with = ["@platforms//os:windows"],
)