Skip to content

Commit

Permalink
fix: return an error when the parsing has failed
Browse files Browse the repository at this point in the history
  • Loading branch information
kino-ma authored and twistedfall committed May 28, 2024
1 parent c5bfa08 commit 77fbe22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ impl Library {
let mut cargo_metadata = Vec::with_capacity(64);
let include_paths: Vec<_> = include_paths.iter().map(PathBuf::from).collect();

let version = Self::version_from_include_paths(&include_paths);
let version = Self::version_from_include_paths(&include_paths).ok_or("could not get versions from header files")?;

cargo_metadata.extend(Self::process_link_paths(Some(link_paths), vec![], None));
cargo_metadata.extend(Self::process_link_libs(Some(link_libs), vec![], None));

Ok(Self {
include_paths,
version: version.unwrap_or_else(|| Version::new(0, 0, 0)),
version,
cargo_metadata,
})
} else {
Expand Down

0 comments on commit 77fbe22

Please sign in to comment.