1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00

Merge pull request #13775 from xokdvium/more-pch

treewide: Futher improve compile times for clangStdenv builds
This commit is contained in:
Jörg Thalheim 2025-08-17 14:47:41 +02:00 committed by GitHub
commit 723656daab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 30 additions and 1 deletions

View file

@ -75,6 +75,7 @@ this_exe = executable(
# TODO: -lrapidcheck, see ../libutil-support/build.meson # TODO: -lrapidcheck, see ../libutil-support/build.meson
link_args : linker_export_flags + [ '-lrapidcheck' ], link_args : linker_export_flags + [ '-lrapidcheck' ],
install : true, install : true,
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
) )
test( test(

View file

@ -0,0 +1,4 @@
#include "nix/expr/tests/libexpr.hh"
#include <gtest/gtest.h>
#include <gmock/gmock.h>

View file

@ -292,7 +292,7 @@ void Fetch::fetch(
auto authIt = headerIt->find("Authorization"); auto authIt = headerIt->find("Authorization");
if (authIt == headerIt->end()) if (authIt == headerIt->end())
return std::nullopt; return std::nullopt;
return *authIt; return std::string(*authIt);
}(); }();
const uint64_t size = obj.at("size"); const uint64_t size = obj.at("size");
sizeCallback(size); sizeCallback(size);

View file

@ -66,6 +66,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 : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
) )
install_headers(headers, subdir : 'nix/fetchers', preserve_path : true) install_headers(headers, subdir : 'nix/fetchers', preserve_path : true)

View file

@ -0,0 +1,3 @@
#include "nix/fetchers/fetchers.hh"
#include "nix/store/store-api.hh"
#include "nix/util/json-utils.hh"

View file

@ -94,6 +94,7 @@ this_exe = executable(
link_args : linker_export_flags + [ '-lrapidcheck' ], link_args : linker_export_flags + [ '-lrapidcheck' ],
# get main from gtest # get main from gtest
install : true, install : true,
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
) )
test( test(
@ -127,6 +128,7 @@ if get_option('benchmarks')
include_directories : include_dirs, include_directories : include_dirs,
link_args : linker_export_flags, link_args : linker_export_flags,
install : true, install : true,
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
cpp_args : [ cpp_args : [
'-DNIX_UNIT_TEST_DATA="' + meson.current_source_dir() + '/data"', '-DNIX_UNIT_TEST_DATA="' + meson.current_source_dir() + '/data"',
], ],

View file

@ -0,0 +1,9 @@
#include "nix/store/store-api.hh"
#include "nix/store/tests/libstore.hh"
#include "nix/util/util.hh"
#include <gtest/gtest.h>
#include <nlohmann/json.hpp>
#include <rapidcheck/gtest.h>
#include <regex>

View file

@ -89,6 +89,7 @@ this_exe = executable(
link_args : linker_export_flags + [ '-lrapidcheck' ], link_args : linker_export_flags + [ '-lrapidcheck' ],
# get main from gtest # get main from gtest
install : true, install : true,
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
) )
test( test(

View file

@ -0,0 +1,5 @@
#include "nix/util/util.hh"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <rapidcheck/gtest.h>

View file

@ -1,3 +1,6 @@
#include "nix/cmd/command.hh" #include "nix/cmd/command.hh"
#include "nix/expr/eval.hh" #include "nix/expr/eval.hh"
#include "nix/main/shared.hh" #include "nix/main/shared.hh"
#include "nix/store/derivations.hh"
#include <nlohmann/json.hpp>