Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ const TINYINST_DIRNAME: &str = "Tinyinst";
const TINYINST_REVISION: &str = "cfb9b15a53e5e6489f2f72c77e804fb0a7af94b5";

#[cfg(not(target_os = "linux"))]
fn build_dep_check(tools: &[&str]) {
fn build_dep_check(tools: &[&str]) -> bool {
for tool in tools {
which(tool).unwrap_or_else(|_| panic!("Build tool {tool} not found"));
let found = which(tool);
if found.is_err() {
println!("cargo:warning={tool} not found! Couldn't build tinyinst_rs");
return false;
}
}
return true;
}

#[cfg(target_os = "linux")]
Expand All @@ -33,7 +38,9 @@ fn main() {

#[cfg(not(target_os = "linux"))]
fn main() {
build_dep_check(&["git", "cxxbridge"]);
if !build_dep_check(&["git", "cxxbridge", "cmake"]) {
return;
}

#[cfg(target_os = "windows")]
let cmake_generator = "Visual Studio 17 2022";
Expand Down