Building the STL prints:
S:\GitHub\STL>ninja -C out\build\x64
ninja: Entering directory `out\build\x64'
[390/936] Linking CXX shared library out\bin\amd64\msvcp140_oss.dll
Creating library stl\msvcp140_base_oss.lib and object stl\msvcp140_base_oss.exp
Generating code
Finished generating code
[427/936] Linking CXX shared library out\bin\amd64\msvcp140_1_oss.dll
Creating library stl\msvcp140_1_oss.lib and object stl\msvcp140_1_oss.exp
Generating code
Finished generating code
[436/936] Linking CXX shared library out\bin\amd64\msvcp140d_oss.dll
Creating library stl\msvcp140_based_oss.lib and object stl\msvcp140_based_oss.exp
[575/936] Linking CXX shared library out\bin\amd64\msvcp140_codecvt_ids_oss.dll
Creating library stl\msvcp140_codecvt_ids_oss.lib and object stl\msvcp140_codecvt_ids_oss.exp
Generating code
Finished generating code
[578/936] Linking CXX shared library out\bin\amd64\msvcp140d_codecvt_ids_oss.dll
Creating library stl\msvcp140_codecvt_idsd_oss.lib and object stl\msvcp140_codecvt_idsd_oss.exp
[583/936] Linking CXX shared library out\bin\amd64\msvcp140_1d_oss.dll
Creating library stl\msvcp140_1d_oss.lib and object stl\msvcp140_1d_oss.exp
[704/936] Linking CXX shared library out\bin\amd64\msvcp140_2_oss.dll
Creating library stl\msvcp140_2_oss.lib and object stl\msvcp140_2_oss.exp
Generating code
Finished generating code
[705/936] Linking CXX shared library out\bin\amd64\msvcp140_2d_oss.dll
Creating library stl\msvcp140_2d_oss.lib and object stl\msvcp140_2d_oss.exp
[936/936] Linking CXX static library out\lib\amd64\libcpmt1.lib
All of these Creating library, Generating code, and Finished generating code messages are noisy. They also interrupt ninja's progress reporting.
ninja to suppress these messages?ninja to suppress these messages? (I observe that the MSVC compiler front-end ordinarily likes to print meow.cpp when it compiles a file, yet that isn't appearing here - is that somehow being suppressed, and could that suppression be extended to codegen/linker messages?)/silent compiler option? (For compatibility reasons, it's presumably not possible to change the behavior of /nologo.) I can even see where the Generating code / Finished generating code messages are being printed in the compiler's source code, so this shouldn't be too hard to implement.It appears that ninja filters the output of cl in https://github.com/ninja-build/ninja/blob/master/src/clparser.cc:
// static
bool CLParser::FilterInputFilename(string line) {
transform(line.begin(), line.end(), line.begin(), ToLowerASCII);
// TODO: other extensions, like .asm?
return EndsWith(line, ".c") ||
EndsWith(line, ".cc") ||
EndsWith(line, ".cxx") ||
EndsWith(line, ".cpp");
}
then (in CLParser::Parse):
} else if (FilterInputFilename(line)) {
// Drop it.
// TODO: if we support compiling multiple output files in a single
// cl.exe invocation, we should stash the filename.
} else {
Ah, so it should be possible to add additional filtering! Awesome.
I don't think it's easy for ninja to add filters, because the messages emitted by cl is localized, which means ninja needs hundreds of filters to omit that message. It's eaiser to change code of the compiler, I think.
Honestly it may be useful to implement silence option for CL as well, and then skip heuristic from ninja side for a compiler that supports it...
@barcharcraz observed that if we get an option from the compiler back-end, we should notify CMake or contribute a change, because CMake could pass that option when creating projects.