Skip to content

Commit

Permalink
Try fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarnard committed Dec 1, 2024
1 parent 5108dd3 commit a445fc7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion osqp-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ categories = ["external-ffi-bindings"]
links = "osqp"

[build-dependencies]
cc = "1.0.36"
cc = "~1.0.36"
cmake = "0.1.28"
fs_extra = "1.2.0"
3 changes: 2 additions & 1 deletion osqp-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ fn main() {
}

// Try to make c_int the same size as the target pointer width (i.e. 32 or 64 bits)
println!("cargo::rustc-check-cfg=cfg(osqp_dlong)");
let dlong_enabled = match &*env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() {
"64" => {
println!(r#"cargo:rustc-cfg=feature="osqp_dlong""#);
println!("cargo:rustc-cfg=osqp_dlong");
"ON"
}
"32" => "OFF",
Expand Down
4 changes: 2 additions & 2 deletions osqp-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
mod bindings;
pub use bindings::*;

#[cfg(feature = "osqp_dlong")]
#[cfg(osqp_dlong)]
pub type osqp_int = ::std::os::raw::c_longlong;
#[cfg(not(feature = "osqp_dlong"))]
#[cfg(not(osqp_dlong))]
pub type osqp_int = ::std::os::raw::c_int;
pub type osqp_float = f64;

Expand Down

0 comments on commit a445fc7

Please sign in to comment.