Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,14 @@ tasks:
- "//..."
test_targets:
- "//..."
cu_integ_cargo_workspace_windows:
name: Crate Universe - cargo_workspace
platform: windows
working_directory: crate_universe/tests/integration/cargo_workspace
build_targets:
- "//..."
test_targets:
- "//..."

# --- cargo_conditional_deps ---
cu_integ_cargo_conditional_deps_ubuntu2204:
Expand Down
10 changes: 10 additions & 0 deletions crate_universe/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ filegroup(
visibility = ["//crate_universe:__subpackages__"],
)

MSVC_RUSTC_FLAGS = [
"-Ctarget-feature=+crt-static",
]

rust_library(
name = "cargo_bazel",
srcs = glob(
Expand All @@ -67,6 +71,12 @@ rust_library(
compile_data = [":rust_data"],
edition = "2021",
proc_macro_deps = all_crate_deps(proc_macro = True),
rustc_flags = select({
"//rust/platform:aarch64-pc-windows-msvc": MSVC_RUSTC_FLAGS,
"//rust/platform:i686-pc-windows-msvc": MSVC_RUSTC_FLAGS,
"//rust/platform:x86_64-pc-windows-msvc": MSVC_RUSTC_FLAGS,
"//conditions:default": [],
}),
# This target embeds additional, stamping related information (see
# https://docs.bazel.build/versions/main/user-manual.html#workspace_status
# for more information). Set stamp = -1 to indicate that it should respect
Expand Down
3 changes: 3 additions & 0 deletions crate_universe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ repository = "https://github.com/bazelbuild/rules_rust"
cargo = []
default = ["cargo"]

[target.'cfg(all(target_os = "windows", target_env = "msvc"))']
rustflags=["-Ctarget-feature=+crt-static"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
Loading