diff options
| author | frosty <gabriel@bwaaa.monster> | 2026-04-22 22:30:21 -0400 |
|---|---|---|
| committer | dacctal <dacctalyt@gmail.com> | 2026-04-24 03:39:52 +0000 |
| commit | f1d7a1903e49c75f9965693247e8d102a96b482c (patch) | |
| tree | 1edd5ebe0a62c00353f824581a24e0afa305873f /src/build.cc | |
| parent | 0b9cc83f71399a41cf4e93ef82af7c8ba5c2ab96 (diff) | |
misc optimisations and QoL improvements
Diffstat (limited to 'src/build.cc')
| -rw-r--r-- | src/build.cc | 19 |
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 |
