- [NEW] "--clean" borra tot lo previament compilat pa començar de zero.

- [NEW] Al primer error ja para.
This commit is contained in:
2025-06-30 17:46:43 +02:00
parent 5e1c39e140
commit 6d5b9eb453

View File

@@ -245,7 +245,17 @@ void MaybeRecompile(std::string source_file)
int main(int argc, char *argv[])
{
if (argc>1) std::filesystem::current_path(argv[1]);
if (argc>1) {
for (int i=1; i<argc; ++i) {
if (argv[i][0] == '-') {
if (strcmp(argv[i], "--clean")==0) {
system("rm -rf build");
}
} else {
std::filesystem::current_path(argv[i]);
}
}
}
loadLagueirtoFile();
@@ -287,7 +297,10 @@ int main(int argc, char *argv[])
{
std::string command = "g++ " + build_path + "/*.o " + libs + " -o " + executable;
std::cout << command << std::endl;
system(command.c_str());
if (system(command.c_str()) != 0) {
std::cout << "ABORTED!" << std::endl;
exit(1);
}
std::chrono::steady_clock::time_point end_all = std::chrono::steady_clock::now();
float t = float(std::chrono::duration_cast<std::chrono::microseconds>(end_all - begin_all).count())/1000000;
std::cout << "(" << t << " seconds)" << std::endl;