Skip to content

Commit

Permalink
feat: add windows-gnu to rust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Jan 22, 2025
1 parent d1168fc commit e7f2b1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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
6 changes: 5 additions & 1 deletion bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ fn main() {

let mut cc = cc::Build::new();

#[cfg(all(windows, target_env = "msvc"))]
#[cfg(windows)]
{
cc.flag("-D_CRT_SECURE_NO_WARNINGS");

// In blst, if __STDC_VERSION__ isn't defined as c99 or greater, it will typedef a bool to
// 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.
#[cfg(target_env = "msvc")]
cc.flag("/std:c11");

#[cfg(target_env = "gnu")]
cc.flag("-std=c++11");
}

cc.include(c_src_dir.clone());
Expand Down

0 comments on commit e7f2b1a

Please sign in to comment.