Skip to content

Commit

Permalink
Merge pull request #14 from niklasdewally/pr/use-minion-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurakgun authored Oct 10, 2023
2 parents 27a39e5 + 7f0a52e commit 45ea0b7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[submodule "minion-bindings/vendor"]
path = solvers/minion/vendor
url = https://github.com/niklasdewally/minion
url = https://github.com/minion/minion
ignore = dirty

[submodule "solvers/chuffed/vendor"]
path = solvers/chuffed/vendor
url = https://github.com/Kieranoski702/chuffed
3 changes: 1 addition & 2 deletions solvers/minion/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ fn bind() {
let bindings = bindgen::Builder::default()
// The input header we would like to generate
// bindings for.
.header("vendor/minion/minion.h")
.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))
// Must manually give allow list to stop bindgen accidentally binding something complicated
// in C++ stdlib that will make it crash.
.allowlist_var("MinionVersion")
.allowlist_function("minion_main")
.clang_arg("-Ivendor/build/src/") // generated from configure.py
.clang_arg("-Ivendor/minion/")
Expand Down
5 changes: 0 additions & 5 deletions solvers/minion/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

use minion_rs::bindings::MinionVersion;
use std::ffi::c_char;
use std::ffi::CString;

pub fn main() {
unsafe {
let minionVersion: &str = std::str::from_utf8_unchecked(MinionVersion);
println!("{:?}", minionVersion);
}

// https://stackoverflow.com/questions/34379641/how-do-i-convert-rust-args-into-the-argc-and-argv-c-equivalents
let args = std::env::args()
Expand Down

0 comments on commit 45ea0b7

Please sign in to comment.