Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Commit 0755549

Browse files
committed
Add deno-x86_64-pc-windows-msvc BUCK file
Signed-off-by: Eli Ma <eli@patch.sh>
1 parent 66f7426 commit 0755549

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

BUCK

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cargo.rust_binary(
77
crate_root = "src/main.rs",
88
deps = [
99
# ---
10+
"//third-party/rust/crates/deno-x86_64-pc-windows-msvc/0.23.0:deno-x86_64-pc-windows-msvc",
1011
"//third-party/rust/crates/windows_x86_64_msvc/0.53.0:windows_x86_64_msvc",
1112
"//third-party/rust/crates/windows_x86_64_gnullvm/0.53.0:windows_x86_64_gnullvm",
1213
"//third-party/rust/crates/windows_x86_64_gnu/0.53.0:windows_x86_64_gnu",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
load("@prelude//toolchains:rust.bzl", "system_rust_toolchain")
2+
load("//third-party/rust/crates/deno-x86_64-pc-windows-msvc/0.23.0:build.bzl", "get_rustc_flags")
3+
4+
# This rust_library is for deno-x86_64-pc-windows-msvc binaries
5+
# It implements the functionality from the original Cargo.toml and build.rs
6+
rust_library(
7+
name = "deno-x86_64-pc-windows-msvc",
8+
# Using fixed edition as per requirements
9+
# Note: original Cargo.toml doesn't specify edition, defaulting to 2015
10+
edition = "2021",
11+
srcs = glob(["src/**/*.rs"]),
12+
crate_root = "src/lib.rs",
13+
features = [],
14+
# Conditionally add rustc flags based on target triple
15+
rustc_flags = get_rustc_flags(),
16+
env = {},
17+
deps = [],
18+
visibility = ["PUBLIC"],
19+
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def get_rustc_flags():
2+
"""
3+
Determine rustc flags based on target platform.
4+
5+
This mimics the build.rs logic which only sets the library search path
6+
when the target is x86_64-pc-windows-msvc.
7+
"""
8+
# Get target platform from config
9+
target = read_config("rust", "target", "")
10+
11+
# Only add link search path for x86_64-pc-windows-msvc target
12+
if target == "x86_64-pc-windows-msvc":
13+
return [
14+
"-L",
15+
"native=lib",
16+
]
17+
return []

0 commit comments

Comments
 (0)