描述
Both gcc and clang have a -fsyntax-only flag that skips the actual compilation stage. This seems like a very useful thing for a fast build check step in CIs before running proper compilation.
This is currently not usable with meson directly as passing the flag will immediately fail compiler detection as no object files are produced.
The idea would be to add a new ninja target like bikeshed-syntax-only which would only run on build steps where the compiler indicates support for such a mode (aka, all *.o targets). In case of gcc/clang, that would pass -fsyntax-only to the regular command line.
Obviously, some amount of regular targets/builds might need to be run to to produce input header/source/etc., but this should overall allow for a very fast build check step that would allow catching simple syntax/warning gotchas that tend to only show up in CI without having to wait for the 900 build steps that a commit isn't touching to finish compiling.
This is essentially the equivalent to cargo check. Including that not all errors will be found, in particular those that appear during linking.