merge ob_check_ts
parent
e7c756a73c
commit
b64fc5d52f
24
main.cc
24
main.cc
|
@ -42,9 +42,17 @@ struct build_error: std::runtime_error {
|
||||||
|
|
||||||
/* check funcs */
|
/* check funcs */
|
||||||
|
|
||||||
static bool ob_check_ts(
|
static bool ob_check_exec(
|
||||||
string_range tname, std::vector<std::string> const &deps
|
string_range tname, std::vector<std::string> 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) {
|
auto get_ts = [](string_range fname) {
|
||||||
fs::path p{std::string{fname}};
|
fs::path p{std::string{fname}};
|
||||||
if (!fs::is_regular_file(p)) {
|
if (!fs::is_regular_file(p)) {
|
||||||
|
@ -65,20 +73,6 @@ static bool ob_check_ts(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ob_check_exec(
|
|
||||||
string_range tname, std::vector<std::string> 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 */
|
/* this lets us properly match % patterns in target names */
|
||||||
static string_range ob_compare_subst(
|
static string_range ob_compare_subst(
|
||||||
string_range expanded, string_range toexpand
|
string_range expanded, string_range toexpand
|
||||||
|
|
Loading…
Reference in New Issue