Skip to content

Commit

Permalink
Properly configure CC/CXX
Browse files Browse the repository at this point in the history
  • Loading branch information
perillamint committed Dec 18, 2024
1 parent 663c32f commit 1cb553a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions rpi-led-matrix-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ include = [
libc = "0.2"

[build-dependencies]
cc = "1.2"
copy_dir = "0.1"

[features]
Expand Down
6 changes: 6 additions & 0 deletions rpi-led-matrix-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ fn main() {
[cpp_lib_out_dir.to_str().unwrap(), "lib"].iter().collect();
std::env::set_current_dir(&cpp_lib_lib_out_dir).unwrap();
println!("building from {}", cpp_lib_out_dir.display());
let cc_path = cc::Build::new().get_compiler();
let cxx_path = cc::Build::new().cpp(true).get_compiler();
let status = Command::new("make")
.args([
format!("CC={}", cc_path.path().to_str().unwrap()),
format!("CXX={}", cxx_path.path().to_str().unwrap()),
])
.status()
.expect("process failed to execute");
assert!(status.success(), "failed to compile the C++ library");
Expand Down

0 comments on commit 1cb553a

Please sign in to comment.