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

Fix Windows build #3

Merged
merged 5 commits into from
Apr 10, 2023
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
12 changes: 9 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build
run: cargo build
- name: Test
run: cargo test
run: cargo test -- --test-threads 1

windows:
runs-on: windows-latest
Expand All @@ -34,10 +34,16 @@ jobs:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: "x86_64-pc-windows-gnu"
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
- name: Build
run: cargo build
run: cargo build --target x86_64-pc-windows-gnu
- name: Test
run: cargo test
run: cargo test --target x86_64-pc-windows-gnu

linux:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ name = "blosc2"

[dependencies]
blosc2-sys = { path = "blosc2-sys" }

[dev-dependencies]
ctor = "0.2.0"
5 changes: 4 additions & 1 deletion blosc2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ fn main() {
println!("cargo:rustc-link-search={}/lib", lib.display());
println!("cargo:rustc-link-lib=static=blosc2");

let out = PathBuf::from(&(format!("{}/src/ffi.rs", env!("CARGO_MANIFEST_DIR"))));
let out = PathBuf::from(&(format!("{}/bindings.rs", std::env::var("OUT_DIR").unwrap())));
bindgen::Builder::default()
.header(&format!("{}/include/blosc2.h", lib.display()))
.layout_tests(false)
.no_default("tagMONITORINFOEXA") // Windows specific, no default [u8;40usize]
.opaque_type("_IMAGE_TLS_DIRECTORY64") // Windows specific, error[E0588]: packed type cannot transitively contain a #[repr(align)] type
.derive_default(true)
.derive_copy(true)
.derive_debug(true)
Expand Down
Loading