[build2] Build system module for code-generation utilities Qt moc, etc

Patrick Fromberg patrick.fromberg at gmail.com
Thu Oct 3 19:41:15 UTC 2019


On 03/10/2019 15:16, Boris Kolpackov wrote:
> [Adding Sam Schweigel who was interested[1] in this as well.]
>
> Patrick Fromberg <patrick.fromberg at gmail.com> writes:
>
>> The discussion was about how detecting which files in a Qt project require
>> calling MOC on them before compiling.
>>
>> Such cpp files are hundred percent c++ files from the compiler's point of
>> view. However those files are actually not exactly cpp files. They have some
>> additional information for moc "secretly" encoded in c++.
> I am a bit confused: is it source files (.cpp), header files (.hpp), or
> both that may need to be processed by MOC?
Both
>
>
>> I don't think this is a bad thing ( I actually like MOC ) but would it not
>> make sense to give those files a different file name ending?
> It will probably help a bit since now you know exactly what you need to
> process with MOC.
>
> In build2 we can achieve the same with target types but then you won't
> be able to use wildcard patters, which are very handy, I must say.
Not being able to use wildcards would be a pest.
>
>> If there is a strong argument for this different file name ending ( not just
>> from the point of view of build2 ) then the Qt team may even adopt this.
> Hm, unless this is coming from the Qt team itself, I somewhat doubt it:
> lots of tooling (build systems, IDEs/editors, static analyzers, etc) will
> have to be taught about these new C++ source/header file extensions.
>
> The C++ community is currently having the same debate about a separate
> extension for module interface files and while I think the rationale is
> a lot stronger, there is still a lot of push back.

Ok, by mentioning future module file extensions I think you proved that 
my idea
was stupid because you cannot have each tooling layer add information via
file name extensions.

But in general, do not assume intransigence on the side of Qt team.
Many Qt developers are praying for a saviour to save their souls from cmake
after QBS has been discontinued.


>
> [1] https://lists.build2.org/archives/users/2019-May/000631.html

-- 
Patrick Fromberg
Tel: 020 8815 9607
Mob: 07586 309 763



More information about the users mailing list