1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-29 05:31:00 +01:00

Use upstream json_fwd.hpp to speed up compilation

This commit is contained in:
Eelco Dolstra 2019-10-21 22:11:21 +02:00
parent cb1a79a96a
commit 45b740c18b
6 changed files with 75 additions and 13 deletions

View file

@ -1,6 +1,6 @@
#include "derivations.hh"
#include <nlohmann/json.hpp>
#include <nlohmann/json_fwd.hpp>
namespace nix {
@ -8,15 +8,17 @@ class ParsedDerivation
{
Path drvPath;
BasicDerivation & drv;
std::optional<nlohmann::json> structuredAttrs;
std::unique_ptr<nlohmann::json> structuredAttrs;
public:
ParsedDerivation(const Path & drvPath, BasicDerivation & drv);
const std::optional<nlohmann::json> & getStructuredAttrs() const
~ParsedDerivation();
const nlohmann::json * getStructuredAttrs() const
{
return structuredAttrs;
return structuredAttrs.get();
}
std::optional<std::string> getStringAttr(const std::string & name) const;