1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

Merge pull request #13678 from xokdvium/pch-disable-gcc

meson: Disable PCH for GCC
This commit is contained in:
John Ericson 2025-08-02 19:42:17 -04:00 committed by GitHub
commit dbccfc277f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 8 additions and 5 deletions

View file

@ -19,6 +19,9 @@ add_project_arguments(
language : 'cpp',
)
# GCC doesn't benefit much from precompiled headers.
do_pch = cxx.get_id() == 'clang'
# 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.

View file

@ -92,7 +92,7 @@ this_library = library(
link_args: linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
cpp_pch : ['pch/precompiled-headers.hh']
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
)
install_headers(headers, subdir : 'nix/cmd', preserve_path : true)

View file

@ -178,7 +178,7 @@ this_library = library(
link_args: linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
cpp_pch : ['pch/precompiled-headers.hh']
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
)
install_headers(headers, subdir : 'nix/expr', preserve_path : true)

View file

@ -350,7 +350,7 @@ this_library = library(
link_args: linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
cpp_pch : ['pch/precompiled-headers.hh']
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
)
install_headers(headers, subdir : 'nix/store', preserve_path : true)

View file

@ -191,7 +191,7 @@ this_library = library(
link_args: linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
cpp_pch : 'pch/precompiled-headers.hh'
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
)
install_headers(headers, subdir : 'nix/util', preserve_path : true)

View file

@ -186,7 +186,7 @@ this_exe = executable(
include_directories : include_dirs,
link_args: linker_export_flags,
install : true,
cpp_pch : ['pch/precompiled-headers.hh']
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
)
meson.override_find_program('nix', this_exe)