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

Merge pull request #13512 from xokdvium/speed-up-builds-pch

Reintroduce precompiled headers
This commit is contained in:
Robert Hensing 2025-07-21 12:38:52 +02:00 committed by GitHub
commit 6ec50ba736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 28 additions and 0 deletions

View file

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

View file

@ -0,0 +1,4 @@
#include "nix/cmd/installables.hh"
#include "nix/expr/eval.hh"
#include "nix/util/util.hh"
#include "nix/flake/flake.hh"

View file

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

View file

@ -0,0 +1 @@
#include "nix/expr/eval.hh"

View file

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

View file

@ -0,0 +1,8 @@
#include "nix/store/store-api.hh"
#include "nix/store/realisation.hh"
#include "nix/store/derived-path.hh"
#include "nix/store/derivations.hh"
#include "nix/store/local-store.hh"
#include "nix/util/util.hh"
#include <nlohmann/json.hpp>

View file

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

View file

@ -0,0 +1,7 @@
#include "nix/util/util.hh"
#include "nix/util/file-system.hh"
#include "nix/util/serialise.hh"
#include "nix/util/signals.hh"
#include "nix/util/source-accessor.hh"
#include <nlohmann/json.hpp>

View file

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

View file

@ -0,0 +1,3 @@
#include "nix/cmd/command.hh"
#include "nix/expr/eval.hh"
#include "nix/main/shared.hh"