mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
The executables precompile Qt since #7235, but the libcockatrice_* static libraries still reparse the full Qt Core stack in every TU. Measured over the tree after the IWYU pass: 380 MB of header parse in the libraries, 92% of it reachable from qtcore_pch.h. - Apply qtcore_pch.h to the 14 Qt Core static library targets (skips libcockatrice_rng: its SFMT.c is C and cannot use a C++ precompiled header). - Grow qtcore_pch.h with 25 QtCore headers that IWYU shows are re-parsed across many TUs and were not already reachable from the existing list (JSON/QUuid cluster, QSettings, item models, threading, XmlStream, QTemporaryDir, ...). - Grow qtwidgets_pch.h with 30 QtGui/QtWidgets headers (dialog cluster, item views, QImageReader, ...). Only stable Qt headers go into the PCH, so it rarely invalidates. Test executables stay PCH-less: 1-3 TUs per target does not amortize the extra precompile. Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
53 lines
1.9 KiB
CMake
53 lines
1.9 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(Utility VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTOUIC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(UTILITY_SOURCES
|
|
libcockatrice/utility/cryptoutil.cpp
|
|
libcockatrice/utility/expression.cpp
|
|
libcockatrice/utility/levenshtein.cpp
|
|
libcockatrice/utility/passwordhasher.cpp
|
|
libcockatrice/utility/report_categories.cpp
|
|
libcockatrice/utility/server_rate_limiter.cpp
|
|
libcockatrice/utility/translation_loader.cpp
|
|
libcockatrice/utility/warning_categories.cpp
|
|
)
|
|
|
|
set(UTILITY_HEADERS
|
|
libcockatrice/utility/card_ref.h
|
|
libcockatrice/utility/color.h
|
|
libcockatrice/utility/cryptoutil.h
|
|
libcockatrice/utility/expression.h
|
|
libcockatrice/utility/levenshtein.h
|
|
libcockatrice/utility/local_server_name.h
|
|
libcockatrice/utility/macros.h
|
|
libcockatrice/utility/passwordhasher.h
|
|
libcockatrice/utility/playmat_params.h
|
|
libcockatrice/utility/report_categories.h
|
|
libcockatrice/utility/string_limits.h
|
|
libcockatrice/utility/dice_limits.h
|
|
libcockatrice/utility/counter_limits.h
|
|
libcockatrice/utility/clamped_arithmetic.h
|
|
libcockatrice/utility/zone_names.h
|
|
libcockatrice/utility/days_years_between.h
|
|
libcockatrice/utility/server_rate_limiter.h
|
|
libcockatrice/utility/translation_loader.h
|
|
libcockatrice/utility/warning_categories.h
|
|
)
|
|
|
|
add_library(libcockatrice_utility STATIC ${UTILITY_SOURCES} ${UTILITY_HEADERS})
|
|
|
|
target_include_directories(libcockatrice_utility PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
target_link_libraries(libcockatrice_utility PUBLIC libcockatrice_rng OpenSSL::Crypto ${QT_CORE_MODULE})
|
|
|
|
set(ORACLE_LIBS)
|
|
|
|
include_directories(${${COCKATRICE_QT_VERSION_NAME}Core_INCLUDE_DIRS})
|
|
|
|
target_precompile_headers(libcockatrice_utility PRIVATE "${CMAKE_SOURCE_DIR}/cmake/pch/qtcore_pch.h")
|