Add support for a generic __run_co_compile that gets the full compiler invocation command line
CMake currently has a few tool-specific __run_co_compile
mechanisms, namely: cppcheck, cpplint, include what you use, link what you use, clang-tidy.
Each of the tools expects to be invoked with specific arguments. CMake currently hardcodes the argument handling for each of those tools.
Would a contribution that accepts a generic __run_co_compile
tool be accepted? CMake would then invoke the given tool before compilation, but will pass the full compiler command line to the tool, as opposed to the other cases where only parts of the compiler command line are passed.
The difference to <LANG>_COMPILER_LAUNCHER
would be that the generic tool does not need to invoke the actual compiler itself to create the object file. And <LANG>_COMPILER_LAUNCHER
could potentially still be used in tandem with __run_co_compile
for some caching wrapper like ccache
, instead of having to create your own wrapper script that would handle both responsibilities if generic __run_co_compile
would not be available.
Adding such support would allow for custom co-compiling static code checkers, linters, etc. Of course the onus on compiler specific argument parsing would then be on the tool itself.