diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-01-06 17:48:19 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-01-06 17:48:19 +0100 |
commit | 05a15ed660f8b43c85242fed1a863853e8c749b3 (patch) | |
tree | 2aaec389e043cf20637ce8a9d7d3ac394dae836e /src/task_cc.cc | |
parent | 78c5477b3989d67169de2d05665adfb801caab23 (diff) |
Reduce chance of lines being cut and mixed up when printing from the task threads.
Diffstat (limited to 'src/task_cc.cc')
-rw-r--r-- | src/task_cc.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/task_cc.cc b/src/task_cc.cc index e1f3023..9a801b5 100644 --- a/src/task_cc.cc +++ b/src/task_cc.cc @@ -175,22 +175,23 @@ int TaskCC::runInner() if(settings.verbose == 0) { + std::string output; switch(sourceLanguage()) { case ctor::language::c: - std::cout << "CC "; + output = "CC "; break; case ctor::language::cpp: - std::cout << "CXX "; + output = "CXX "; break; case ctor::language::automatic: case ctor::language::assembler: // Only c/c++ handled by this task type. break; } - std::cout << - sourceFile.lexically_normal().string() << " => " << - targetFile().lexically_normal().string() << std::endl; + output += sourceFile.lexically_normal().string() + " => " + + targetFile().lexically_normal().string() + '\n'; + std::cout << output << std::flush; } const auto& cfg = ctor::get_configuration(); |