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:
commit
723656daab
10 changed files with 30 additions and 1 deletions
|
|
@ -75,6 +75,7 @@ this_exe = executable(
|
|||
# TODO: -lrapidcheck, see ../libutil-support/build.meson
|
||||
link_args : linker_export_flags + [ '-lrapidcheck' ],
|
||||
install : true,
|
||||
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
|||
4
src/libexpr-tests/pch/precompiled-headers.hh
Normal file
4
src/libexpr-tests/pch/precompiled-headers.hh
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#include "nix/expr/tests/libexpr.hh"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock.h>
|
||||
|
|
@ -292,7 +292,7 @@ void Fetch::fetch(
|
|||
auto authIt = headerIt->find("Authorization");
|
||||
if (authIt == headerIt->end())
|
||||
return std::nullopt;
|
||||
return *authIt;
|
||||
return std::string(*authIt);
|
||||
}();
|
||||
const uint64_t size = obj.at("size");
|
||||
sizeCallback(size);
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ this_library = library(
|
|||
link_args : linker_export_flags,
|
||||
prelink : true, # For C++ static initializers
|
||||
install : true,
|
||||
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
|
||||
)
|
||||
|
||||
install_headers(headers, subdir : 'nix/fetchers', preserve_path : true)
|
||||
|
|
|
|||
3
src/libfetchers/pch/precompiled-headers.hh
Normal file
3
src/libfetchers/pch/precompiled-headers.hh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#include "nix/fetchers/fetchers.hh"
|
||||
#include "nix/store/store-api.hh"
|
||||
#include "nix/util/json-utils.hh"
|
||||
|
|
@ -94,6 +94,7 @@ this_exe = executable(
|
|||
link_args : linker_export_flags + [ '-lrapidcheck' ],
|
||||
# get main from gtest
|
||||
install : true,
|
||||
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
@ -127,6 +128,7 @@ if get_option('benchmarks')
|
|||
include_directories : include_dirs,
|
||||
link_args : linker_export_flags,
|
||||
install : true,
|
||||
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
|
||||
cpp_args : [
|
||||
'-DNIX_UNIT_TEST_DATA="' + meson.current_source_dir() + '/data"',
|
||||
],
|
||||
|
|
|
|||
9
src/libstore-tests/pch/precompiled-headers.hh
Normal file
9
src/libstore-tests/pch/precompiled-headers.hh
Normal 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>
|
||||
|
|
@ -89,6 +89,7 @@ this_exe = executable(
|
|||
link_args : linker_export_flags + [ '-lrapidcheck' ],
|
||||
# get main from gtest
|
||||
install : true,
|
||||
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
|||
5
src/libutil-tests/pch/precompiled-headers.hh
Normal file
5
src/libutil-tests/pch/precompiled-headers.hh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include "nix/util/util.hh"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock.h>
|
||||
#include <rapidcheck/gtest.h>
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
#include "nix/cmd/command.hh"
|
||||
#include "nix/expr/eval.hh"
|
||||
#include "nix/main/shared.hh"
|
||||
#include "nix/store/derivations.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue