mirror of
https://github.com/NixOS/nix.git
synced 2025-11-22 18:29:36 +01:00
meson: Add option for controlling PCH
In practice it turns out that turning off PCH is pretty useful when debugging incorrect includes. I didn't want to add this option initially because of the sheer amount of copy-pasta that meson requires. But considering that this is useful and the cost of copying the option a single time is not too high this seems acceptable.
This commit is contained in:
parent
fb117e0cac
commit
c105846646
11 changed files with 106 additions and 2 deletions
|
|
@ -29,7 +29,11 @@ add_project_arguments(
|
|||
)
|
||||
|
||||
# GCC doesn't benefit much from precompiled headers.
|
||||
do_pch = cxx.get_id() == 'clang'
|
||||
if get_option('pch') == 'auto'
|
||||
do_pch = cxx.get_id() == 'clang'
|
||||
else
|
||||
do_pch = get_option('pch') == 'enabled'
|
||||
endif
|
||||
|
||||
# This is a clang-only option for improving build times.
|
||||
# It forces the instantiation of templates in the PCH itself and
|
||||
|
|
@ -38,7 +42,7 @@ do_pch = cxx.get_id() == 'clang'
|
|||
# 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'
|
||||
if cxx.get_id() == 'clang' and do_pch
|
||||
add_project_arguments('-fpch-instantiate-templates', language : 'cpp')
|
||||
endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue