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:
parent
cb1a79a96a
commit
45b740c18b
6 changed files with 75 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue