diff options
author | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2019-07-05 10:47:26 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-09-11 08:25:54 +0000 |
commit | 2cf0ba1fba9293b3265a186527dbc90d395dfd20 (patch) | |
tree | 4a25d77ccd7e201e01bfcbcf086370869c53cce4 /src | |
parent | 7df0868ad59dd071f2ce2dd355488128fa56f645 (diff) | |
download | qtbase-2cf0ba1fba9293b3265a186527dbc90d395dfd20.tar.gz |
Use pre-compiled headers when building Qt with cmake
Some modules define their own manually-maintained lists, and we can rely
on the headers generated by each module to include in the pch as well
e.g. QtCore/QtCore.
There's also e.g. QtWidgetDepends for QtWidgets, but this only
works for modules, not for tools, examples or other applications.
For now we'll use the Qt<Module>/Qt<Module> headers for the
modules we depend on.
Building with PCH can be disabled with -DBUILD_WITH_PCH=NO, and it only
works for versions of CMake newer than 3.15.20190829.
Change-Id: Iae52bd69acfdfd58f4cd20d3cfa3c7f42775f732
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/concurrent/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/corelib/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/gui/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/network/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platformsupport/edid/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/eglconvenience/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/eventdispatchers/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/fbconvenience/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/fontdatabases/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/input/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/input/xkbcommon/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/linuxaccessibility/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/services/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/platformsupport/vkconvenience/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/sql/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/widgets/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/xml/CMakeLists.txt | 1 |
17 files changed, 37 insertions, 14 deletions
diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt index b0d90e40ba..f330f10a1f 100644 --- a/src/concurrent/CMakeLists.txt +++ b/src/concurrent/CMakeLists.txt @@ -29,11 +29,11 @@ add_qt_module(Concurrent Qt::CorePrivate PUBLIC_LIBRARIES Qt::Core + PRECOMPILED_HEADER + "../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:concurrent.pro:<TRUE>: -# CONFIG = "exceptions" -# PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" # _LOADED = "qt_module" ## Scopes: diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 2959939458..47ba9ce7fc 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -250,6 +250,11 @@ add_qt_module(Core PUBLIC_LIBRARIES # special case: Qt::Platform # special case: DISABLE_TOOLS_EXPORT # special case: + PRECOMPILED_HEADER + global/qt_pch.h + NO_PCH_SOURCES + text/qstring_compat.cpp + tools/qvector_msvc.cpp # special case begin # Generated in QtBaseGlobalTargets EXTRA_CMAKE_FILES ${QT_CORE_RESOURCE_GENERATED_FILE_PATH} diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b5297cad62..1702f0f9d3 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -264,6 +264,10 @@ add_qt_module(Gui ZLIB::ZLIB PUBLIC_LIBRARIES Qt::Core + NO_PCH_SOURCES + "painting/qdrawhelper.cpp" + PRECOMPILED_HEADER + "kernel/qt_gui_pch.h" ) # Resources: diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 85ee368df5..7e392d393c 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -60,6 +60,8 @@ add_qt_module(Network ZLIB::ZLIB PUBLIC_LIBRARIES Qt::Core + PRECOMPILED_HEADER + "../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:network.pro:<TRUE>: diff --git a/src/platformsupport/edid/CMakeLists.txt b/src/platformsupport/edid/CMakeLists.txt index 948cb7e091..adb2d43cc0 100644 --- a/src/platformsupport/edid/CMakeLists.txt +++ b/src/platformsupport/edid/CMakeLists.txt @@ -15,10 +15,11 @@ add_qt_module(EdidSupport Qt::CorePrivate PUBLIC_LIBRARIES Qt::Core + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:edid.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "edid_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" diff --git a/src/platformsupport/eglconvenience/CMakeLists.txt b/src/platformsupport/eglconvenience/CMakeLists.txt index a6a6633d03..e2cb21521b 100644 --- a/src/platformsupport/eglconvenience/CMakeLists.txt +++ b/src/platformsupport/eglconvenience/CMakeLists.txt @@ -19,12 +19,13 @@ add_qt_module(EglSupport Qt::CorePrivate Qt::GuiPrivate EGL::EGL # special case + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:eglconvenience.pro:<NONE>: # CONFIG = "static" "internal_module" "egl" # MODULE = "egl_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" ## Scopes: diff --git a/src/platformsupport/eventdispatchers/CMakeLists.txt b/src/platformsupport/eventdispatchers/CMakeLists.txt index 5e88450023..a85af287a0 100644 --- a/src/platformsupport/eventdispatchers/CMakeLists.txt +++ b/src/platformsupport/eventdispatchers/CMakeLists.txt @@ -17,12 +17,13 @@ add_qt_module(EventDispatcherSupport PUBLIC_LIBRARIES Qt::Core Qt::Gui + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:eventdispatchers.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "eventdispatcher_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" ## Scopes: diff --git a/src/platformsupport/fbconvenience/CMakeLists.txt b/src/platformsupport/fbconvenience/CMakeLists.txt index 05ee44b967..51bbdfe176 100644 --- a/src/platformsupport/fbconvenience/CMakeLists.txt +++ b/src/platformsupport/fbconvenience/CMakeLists.txt @@ -21,10 +21,11 @@ add_qt_module(FbSupport PUBLIC_LIBRARIES Qt::Core Qt::Gui + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:fbconvenience.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "fb_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index 2e42a71cb2..d6e92bb2f2 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -18,12 +18,13 @@ add_qt_module(FontDatabaseSupport PUBLIC_LIBRARIES Qt::Core Qt::Gui + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:fontdatabases.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "fontdatabase_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" ## Scopes: diff --git a/src/platformsupport/input/CMakeLists.txt b/src/platformsupport/input/CMakeLists.txt index 859d2d33ad..681d103a82 100644 --- a/src/platformsupport/input/CMakeLists.txt +++ b/src/platformsupport/input/CMakeLists.txt @@ -22,12 +22,13 @@ add_qt_module(InputSupport Qt::Core Qt::DeviceDiscoverySupport Qt::Gui + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 3:.:.:input-support.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "input_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" ## Scopes: diff --git a/src/platformsupport/input/xkbcommon/CMakeLists.txt b/src/platformsupport/input/xkbcommon/CMakeLists.txt index 1a96d5eafe..50c86bb5b8 100644 --- a/src/platformsupport/input/xkbcommon/CMakeLists.txt +++ b/src/platformsupport/input/xkbcommon/CMakeLists.txt @@ -19,12 +19,13 @@ add_qt_module(XkbCommonSupport Qt::Core Qt::Gui XKB::XKB + PRECOMPILED_HEADER + "../../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:xkbcommon.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "xkbcommon_support" -# PRECOMPILED_HEADER = "../../../corelib/global/qt_pch.h" # _LOADED = "qt_module" ## Scopes: diff --git a/src/platformsupport/linuxaccessibility/CMakeLists.txt b/src/platformsupport/linuxaccessibility/CMakeLists.txt index af48f9d57d..023f17197b 100644 --- a/src/platformsupport/linuxaccessibility/CMakeLists.txt +++ b/src/platformsupport/linuxaccessibility/CMakeLists.txt @@ -39,10 +39,11 @@ add_qt_module(LinuxAccessibilitySupport Qt::Core Qt::DBus Qt::Gui + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:linuxaccessibility.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "linuxaccessibility_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" diff --git a/src/platformsupport/services/CMakeLists.txt b/src/platformsupport/services/CMakeLists.txt index b926030e12..52b96aff24 100644 --- a/src/platformsupport/services/CMakeLists.txt +++ b/src/platformsupport/services/CMakeLists.txt @@ -17,12 +17,13 @@ add_qt_module(ServiceSupport PUBLIC_LIBRARIES Qt::Core Qt::Gui + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:services.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "service_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" ## Scopes: diff --git a/src/platformsupport/vkconvenience/CMakeLists.txt b/src/platformsupport/vkconvenience/CMakeLists.txt index 325da3f8f8..feee14dafc 100644 --- a/src/platformsupport/vkconvenience/CMakeLists.txt +++ b/src/platformsupport/vkconvenience/CMakeLists.txt @@ -20,10 +20,11 @@ add_qt_module(VulkanSupport PUBLIC_LIBRARIES Qt::Core Qt::Gui + PRECOMPILED_HEADER + "../../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:vkconvenience.pro:<TRUE>: # CONFIG = "static" "internal_module" # MODULE = "vulkan_support" -# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" # _LOADED = "qt_module" diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index 8e9345765f..4f420afb99 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -27,11 +27,12 @@ add_qt_module(Sql Qt::CorePrivate PUBLIC_LIBRARIES Qt::Core + PRECOMPILED_HEADER + "../corelib/global/qt_pch.h" ) #### Keys ignored in scope 1:.:.:sql.pro:<TRUE>: # MODULE_PLUGIN_TYPES = "sqldrivers" -# PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" # SQL_P = "sql" # _LOADED = "qt_module" diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index f3abc16550..2d4299dedc 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -63,6 +63,8 @@ add_qt_module(Widgets PUBLIC_LIBRARIES Qt::Core Qt::Gui + PRECOMPILED_HEADER + "kernel/qt_widgets_pch.h" ) add_dependencies(Widgets ${QT_CMAKE_EXPORT_NAMESPACE}::uic) # special case diff --git a/src/xml/CMakeLists.txt b/src/xml/CMakeLists.txt index 6c7ad3489e..d31f092e5d 100644 --- a/src/xml/CMakeLists.txt +++ b/src/xml/CMakeLists.txt @@ -19,7 +19,6 @@ add_qt_module(Xml ) #### Keys ignored in scope 1:.:.:xml.pro:<TRUE>: -# PRECOMPILED_HEADER = <EMPTY> # _LOADED = "qt_module" ## Scopes: |