I got curious to try the new generator FASTBuild supported by the latest release-candidate of CMake 4.2. I have a codebase of ~2M lines of code that have used CMake + Ninja on Linux for many years.
When building with -G FASTBuild instead of Ninja, I got compiler warnings, that I don’t see when building with Ninja. The compiler is the same in both cases (GCC 13 on Ubuntu 24.04).
After some investigation I see that FASTBuild internally first pre-processes my source, and then compiles the preprocessed “*.cpp.ii” files to object files. This simple difference makes GCC behave differently ( no warning –> warnings ).
If I copy/paste the compile command FASTNinja uses to compile a “.cpp.ii” file with warnings, and instead use the same command to compile the original source code, the warning disappear.
So I conclude the my CMake files still produces “working” command lines, when feeded directly to GCC. But FASTBuild’s way of using preprocessed files as an intermediate step causes the difference.
I usually have CMAKE_COMPILE_WARNING_AS_ERROR set to TRUE, but when doing this experiment with FASTBuild I used –compile-no-warning-as-error–compile-no-warning-as-error to see how far FASTBuild got ignoring these “new” warnings. But if I should use FASTBuild, I want to be able to be “warning free” eventually.