aboutsummaryrefslogtreecommitdiff
path: root/src/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/build.cc b/src/build.cc
index adbfec5..88b40c7 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -9,11 +9,22 @@ void build(std::filesystem::path build_dir) {
if (build_dir != std::filesystem::current_path().string()) {
std::filesystem::current_path(build_dir);
}
+
+ bool bldit_found = false;
+ bool build_found = false;
+
for (auto const &dir_entry : std::filesystem::directory_iterator(std::filesystem::current_path().string())) {
- if (dir_entry.path().filename() == "bldit") { system("./bldit"); return; }
+ if (dir_entry.path().filename() == "bldit") {
+ bldit_found = true;
+ break;
+ }
}
- for (auto const &dir_entry : std::filesystem::directory_iterator(std::filesystem::current_path().string())) {
- if (lua_build(build_dir.c_str())) { return; }
+
+ if (bldit_found) {
+ system("./bldit");
+ } else if (lua_build(build_dir.c_str())) {
+ return;
+ } else {
+ std::cout << print_error << "no usable build system was found\n";
}
- std::cout << print_error << "no usable build system was found\n";
} \ No newline at end of file