Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add windows-gnu to rust tests #531

Merged
merged 1 commit into from
Jan 23, 2025
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
target: x86_64-unknown-linux-gnu
- host: windows-latest
target: x86_64-pc-windows-msvc
- host: windows-latest
target: x86_64-pc-windows-gnu
- host: macos-14
target: aarch64-apple-darwin
- host: macos-latest
Expand Down
9 changes: 7 additions & 2 deletions bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ fn main() {
// an int. There is a bug in bindgen associated with this. It assumes that a bool in C is
// the same size as a bool in Rust. This is the root cause of the issues on Windows. If/when
// this is fixed in bindgen, it should be safe to remove this compiler flag.
cc.flag("/std:c11");

// This flag is for MSVC
cc.flag_if_supported("/std:c11");

// This is for GCC
cc.flag_if_supported("-std=c11");
}

cc.include(c_src_dir.clone());
Expand Down Expand Up @@ -155,7 +160,7 @@ fn make_bindings(
#[cfg(feature = "generate-bindings")]
fn replace_ckzg_ret_repr(mut bindings: String) -> String {
let target = env::var("TARGET").unwrap_or_default();
let repr_to_replace = if target.contains("windows") {
let repr_to_replace = if target.contains("windows") && target.contains("msvc") {
"#[repr(i32)]"
} else {
"#[repr(u32)]"
Expand Down
Loading