[Development] Proposing CMake as build tool for Qt 6
Konstantin Tokarev
annulen at yandex.ru
Mon Jun 17 18:44:33 CEST 2019
17.06.2019, 19:09, "Konstantin Tokarev" <annulen at yandex.ru>:
> 17.06.2019, 18:43, "Thiago Macieira" <thiago.macieira at intel.com>:
>> On Monday, 17 June 2019 08:16:38 PDT Konstantin Tokarev wrote:
>>> 17.06.2019, 18:15, "Thiago Macieira" <thiago.macieira at intel.com>:
>>> > On Monday, 17 June 2019 02:52:03 PDT Konstantin Tokarev wrote:
>>> >> I think that automatic generation of PCH is a bad idea, leading to
>>> >> wasting
>>> >> build time.
>>> >
>>> > Like we do in Qt today?
>>>
>>> Yep. Approach of Qt Creator is much better.
>>
>> Elaborate, please.
>
> Qt Creator uses manually crafted precompiled header files [1,2], which include
> only those headers which are often used across the project. If you pull all public
> headers of used Qt modules into pch like it was a kitchen sink, you spend a lot of
> extra time precompiling stuff which wiould be used once or twice. It also increases
> size of binary representation of PCH, and might make compilation slower because
> compiler now has to do lookups in larger AST.
>
> [1] https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/shared/qtcreator_pch.h
> [2] https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/shared/qtcreator_gui_pch.h
To put it differently:
Including some header into PCH is an optimization. Including everything into PCH without
proof that each header there is necessary is premature optimization.
--
Regards,
Konstantin
More information about the Development
mailing list