merge ob_check_ts

master
Daniel Kolesa 2017-06-21 21:02:16 +02:00
parent e7c756a73c
commit b64fc5d52f
1 changed files with 9 additions and 15 deletions

24
main.cc
View File

@ -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<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) {
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<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 */
static string_range ob_compare_subst(
string_range expanded, string_range toexpand