1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Merge pull request #13519 from xokdvium/pch-instantiate-templates

meson: Further optimize compile times with PCH template instantiations
This commit is contained in:
John Ericson 2025-07-21 22:39:45 -04:00 committed by GitHub
commit 3cbcceee02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,3 +18,14 @@ add_project_arguments(
'-Wno-deprecated-declarations',
language : 'cpp',
)
# This is a clang-only option for improving build times.
# It forces the instantiation of templates in the PCH itself and
# not every translation unit it's included in.
# It's available starting from clang 11, which is old enough to not
# bother checking the version.
# This feature helps in particular with the expensive nlohmann::json template
# instantiations in libutil and libstore.
if cxx.get_id() == 'clang'
add_project_arguments('-fpch-instantiate-templates', language : 'cpp')
endif