[CMake] support for -fsyntax-only (and generating Qt/KDE's auto-generated content)

Sylvain Joubert joubert.sy at gmail.com
Tue Oct 9 16:28:33 EDT 2018


> Are you thinking of tools that are invoked instead of the compiler, like clazy-
> standalone? I thought about mentioning a potential interest of my idea for using
> such tools (but forgot in the end).

Yes, that and all the other tools supported by CMake as a "pre-command" 
before the compiler invocation (e.g. clang-tidy, iwyu,...)

> Specific support for -fsyntax-only may not be relevant for those tools, but a
> build mode where the final step of each build product is not taken would probably
> be useful there, indeed. Such a mode might even create an empty file with the
> intended name, so that there's something to refer to later during a build.
> 
> I've been considering to write a little wrapper one could "inject" using
> CMAKE_<LANG>_COMPILER_LAUNCHER but there is no equivalent for the final product
> generation step (linker, librarian).
> 
>>
>> So if we can achieve a light build mode, that would be great. In my case
>> I could completely deactivate the build part including the syntax
>> checking since that's done by the static analysis tools anyway.
> 
> You'd get that by setting your analysis tool as the compiler.

I did not think of doing that. I'll have to play with it, but I think 
the final product step will still be an issue.

Sylvain


More information about the CMake mailing list