diff --git a/main.cc b/main.cc index 03e7df5..c01f142 100644 --- a/main.cc +++ b/main.cc @@ -42,9 +42,17 @@ struct build_error: std::runtime_error { /* check funcs */ -static bool ob_check_ts( +static bool ob_check_exec( string_range tname, std::vector const &deps ) { + if (!fs::exists(std::string{tname})) { + return true; + } + for (auto &dep: deps) { + if (!fs::exists(dep)) { + return true; + } + } auto get_ts = [](string_range fname) { fs::path p{std::string{fname}}; if (!fs::is_regular_file(p)) { @@ -65,20 +73,6 @@ static bool ob_check_ts( return false; } -static bool ob_check_exec( - string_range tname, std::vector const &deps -) { - if (!fs::exists(std::string{tname})) { - return true; - } - for (auto &dep: deps) { - if (!fs::exists(dep)) { - return true; - } - } - return ob_check_ts(tname, deps); -} - /* this lets us properly match % patterns in target names */ static string_range ob_compare_subst( string_range expanded, string_range toexpand