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:
commit
3cbcceee02
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue