Skip to content

Commit

Permalink
Merge pull request #113 from niklasdewally/hotfix-build
Browse files Browse the repository at this point in the history
Hotfix: fix minion and chuffed always rebuilding
  • Loading branch information
ozgurakgun authored Nov 28, 2023
2 parents de0459b + 73877ea commit 8b75ded
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 0 additions & 3 deletions solvers/chuffed/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ fn bind() {
// The input header we would like to generate
// bindings for.
.header("wrapper.h")
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
// Must manually give allow list to stop bindgen accidentally binding something complicated
// in C++ stdlib that will make it crash.
.allowlist_function("createVars")
Expand Down
9 changes: 3 additions & 6 deletions solvers/minion/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ use std::process::Command;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();

println!("cargo:rustc-link-search=all={}/build", out_dir);
println!("cargo:rustc-link-lib=static=minion");
println!("cargo:rerun-if-changed=vendor");
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=build.sh");

println!("cargo:rustc-link-search=all={}/build", out_dir);
println!("cargo:rustc-link-lib=static=minion");
build();

// also need to (dynamically) link to c++ stdlib
// https://flames-of-code.netlify.app/blog/rust-and-cmake-cplusplus/
Expand All @@ -31,7 +32,6 @@ fn main() {
unimplemented!();
}

build();
bind();
}

Expand Down Expand Up @@ -63,9 +63,6 @@ fn bind() {
// The input header we would like to generate
// bindings for.
.header("vendor/minion/libwrapper.h")
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
// Make all templates opaque as reccomended by bindgen
.opaque_type("std::.*")
// Manually allow C++ functions to stop bindgen getting confused.
Expand Down

0 comments on commit 8b75ded

Please sign in to comment.