libfetchers: Improve compile times with PCH
(Before) **** Time summary: Compilation (17 times): Parsing (frontend): 72.3 s Codegen & opts (backend): 47.8 s (After) Compilation (19 times): Parsing (frontend): 27.5 s Codegen & opts (backend): 43.8 s
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user