When repeatedly building a project, when there are warnings but no errors in a translation unit, the main source file is typically not recompiled.
This can make it difficult to work through errors and warnings to attempt to get the project to build with no warnings. Typically one must keep iteratively building until all errors are taken care of, then do a full clean and build to ensure that there are no warnings (as well as to ensure that the previously-completed build wasn't a "fluke" caused by leftover build artifacts).
Is there any way with CMake (or some other utility such as a Bash script) to parse build output for warnings, save them in a text file somewhere, and then re-display them on subsequent builds?
For bonus points, since I'm colorizing my compiler output, can warnings be saved with the color control-characters and re-displayed with the same colorization?
(If it matters, at the moment I'm only compiling C++, and I'm typically using GCC to do so. My build generator of choice is Ninja, and I have some Bash scripts I've written that wrap all my calls to CMake and Ninja.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…