From f95397be6d4e05d12823922107ff0cae32bacc57 Mon Sep 17 00:00:00 2001 From: tokatoka Date: Tue, 14 Feb 2023 14:43:29 +0900 Subject: [PATCH 1/2] chg --- build.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 854f528..242fb2f 100644 --- a/build.rs +++ b/build.rs @@ -19,10 +19,16 @@ 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; + } else { + } } + return true; } #[cfg(target_os = "linux")] @@ -33,7 +39,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"; From f5de3ec80a50f24e2e2bbe36968aa96e09fc23c0 Mon Sep 17 00:00:00 2001 From: tokatoka Date: Tue, 14 Feb 2023 14:46:41 +0900 Subject: [PATCH 2/2] more --- build.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/build.rs b/build.rs index 242fb2f..c8a706e 100644 --- a/build.rs +++ b/build.rs @@ -25,7 +25,6 @@ fn build_dep_check(tools: &[&str]) -> bool { if found.is_err() { println!("cargo:warning={tool} not found! Couldn't build tinyinst_rs"); return false; - } else { } } return true;