From 4e50a36680340c84404b58b6e8b774c9ad3e6d40 Mon Sep 17 00:00:00 2001 From: Rigidity Date: Sun, 22 Sep 2024 14:06:34 -0400 Subject: [PATCH] vcpkg and mpir fix --- .github/workflows/rust.yml | 3 +-- Cargo.lock | 7 +++++++ rust_bindings/Cargo.toml | 1 + rust_bindings/build.rs | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9237a5c..4caeba6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -100,7 +100,7 @@ jobs: - name: Install MPIR on Windows if: matrix.os.name == 'Windows' - run: vcpkg install mpir + run: vcpkg install mpir:x64-windows-static - name: Set up Rust uses: dtolnay/rust-toolchain@stable @@ -128,7 +128,6 @@ jobs: run: | cd rust_bindings cp -r ../src cpp - git clone https://github.com/Chia-Network/mpir_gc_x64.git - name: Publish to crates.io (dry run) # We use `--allow-dirty` because the `cpp` folder is copied into the working directory. diff --git a/Cargo.lock b/Cargo.lock index 259f793..42f5945 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,6 +81,7 @@ dependencies = [ "hex", "hex-literal", "link-cplusplus", + "vcpkg", ] [[package]] @@ -359,6 +360,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "which" version = "4.4.2" diff --git a/rust_bindings/Cargo.toml b/rust_bindings/Cargo.toml index 88adc02..280b008 100644 --- a/rust_bindings/Cargo.toml +++ b/rust_bindings/Cargo.toml @@ -14,6 +14,7 @@ link-cplusplus = "1.0.9" [build-dependencies] bindgen = "0.69.4" cmake = "0.1.50" +vcpkg = "0.2.15" [dev-dependencies] hex = "0.4.3" diff --git a/rust_bindings/build.rs b/rust_bindings/build.rs index d23e51d..2ef14dc 100644 --- a/rust_bindings/build.rs +++ b/rust_bindings/build.rs @@ -45,7 +45,7 @@ fn main() { .unwrap() ); - println!("cargo:rustc-link-lib=static=mpir"); + vcpkg::find_package("mpir").unwrap(); } else { println!( "cargo:rustc-link-search=native={}",