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; }