Can we have a headersclean check for frameworks?

David Faure faure at kde.org
Sun May 22 22:50:54 UTC 2016


On jeudi 12 mai 2016 00:15:21 CEST Aleix Pol wrote:
> On Wed, May 11, 2016 at 10:51 PM, Stephen Kelly <steveire at gmail.com> wrote:
> > Hi,
> > 
> > Qt has a headersclean utility which runs each header through the compiler
> > on its own. That verifies that it doesn't cause certain warnings, can
> > compile in the presence of certain Qt defines, and includes or forward
> > declares everything it should.
> > 
> > We don't have such a thing in KF5, but as shown by
> > 
> >  https://quickgit.kde.org/?p=kconfigwidgets.git&a=commitdiff&h=2900814b
> > 
> > we would benefit from it.
> > 
> > Does anyone want to try to implement it (or borrow the Qt implementation)
> > and integrate it?
> > 
> > We can probably add it to ECM and run it as part of the build of
> > frameworks.
> That could make sense, maybe as a clazy check?
> 
> Can you point us to Qt's so we know what we're talking about?

It's about compiling the headers with a strict set of flags (and no .cpp code).
Sounds more like ECM than clazy to me.

See the hit for headersclean in mkspecs/features/qt_module_headers.prf
for the flags and the implementation:
it adds a "extra compiler command" which runs the actual C++ compiler, with as 
input all the public headers, and no linking happens (it obviously wouldn't 
link).

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list