Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 authored and yhql committed Jan 26, 2023
1 parent 8e86632 commit 4e3a013
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ fn main() -> Result<(), Box<dyn Error>> {

let output = Command::new("arm-none-eabi-gcc")
.arg("-print-sysroot")
.output().ok();
.output()
.ok();
let sysroot = output
.as_ref().and_then(|o|std::str::from_utf8(&o.stdout).ok())
.unwrap_or("").trim();
.as_ref()
.and_then(|o| std::str::from_utf8(&o.stdout).ok())
.unwrap_or("")
.trim();

let gcc_toolchain = if sysroot.is_empty() {
String::from("/usr/include/")
Expand Down

0 comments on commit 4e3a013

Please sign in to comment.