From bcaa0849b8ee851bb974cf78ca466f7326238a40 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Sat, 11 Apr 2026 19:46:45 +0200 Subject: [PATCH] =?UTF-8?q?-=20[NEW]=20Al=20primer=20error=20de=20compilac?= =?UTF-8?q?i=C3=B3,=20aborta=20tot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 5266ff1..cc00c8a 100644 --- a/main.cpp +++ b/main.cpp @@ -259,11 +259,16 @@ void MaybeRecompile(std::string source_file) { std::cout << command << std::endl; std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); - system(command.c_str()); + int result = system(command.c_str()); std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now(); float t = float(std::chrono::duration_cast(end - begin).count())/1000000; std::cout << "(" << t << " seconds)" << std::endl; + + if (result != 0) { + std::cout << "Compilation failed! Aborting..." << std::endl; + exit(1); + } } else { //std::cout << object_file << " està actualitzat" << std::endl; }