[Build] Add precompiled headers for Qt-backed executables

Reparsing QtCore/QtGui/QtWidgets/QtNetwork in ~460 client translation
units is the dominant compilation cost. Precompile the two common layers:
- qtcore_pch.h (Qt Core only; safe even for headless Servatrice)
- qtwidgets_pch.h (adds Gui/Widgets/Network; used by Cockatrice and Oracle)

target_precompile_headers() requires CMake 3.16, now the project minimum.
Estimated 30-50% faster client rebuilds.
This commit is contained in:
Lukas Brübach 2026-09-01 16:15:29 +02:00 committed by GitHub
parent 61e6a9913e
commit a03e4350b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 0 deletions

View file

@ -112,6 +112,8 @@ qt6_add_executable(
MANUAL_FINALIZATION
)
target_precompile_headers(oracle PRIVATE "${CMAKE_SOURCE_DIR}/cmake/pch/qtwidgets_pch.h")
# ------------------------
# Link libraries
# ------------------------