diff options
Diffstat (limited to 'src/libstore/platform.cc')
-rw-r--r-- | src/libstore/platform.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/libstore/platform.cc b/src/libstore/platform.cc index acdedab99..d10d33f0e 100644 --- a/src/libstore/platform.cc +++ b/src/libstore/platform.cc @@ -1,4 +1,5 @@ #include "local-store.hh" +#include "build/local-derivation-goal.hh" #if __linux__ #include "platform/linux.hh" @@ -19,4 +20,43 @@ std::shared_ptr<LocalStore> LocalStore::makeLocalStore(const Params & params) return std::shared_ptr<LocalStore>(new FallbackLocalStore(params)); #endif } + +std::shared_ptr<LocalDerivationGoal> LocalDerivationGoal::makeLocalDerivationGoal( + const StorePath & drvPath, + const OutputsSpec & wantedOutputs, + Worker & worker, + BuildMode buildMode +) +{ +#if __linux__ + return std::make_shared<LinuxLocalDerivationGoal>(drvPath, wantedOutputs, worker, buildMode); +#elif __APPLE__ + return std::make_shared<DarwinLocalDerivationGoal>(drvPath, wantedOutputs, worker, buildMode); +#else + return std::make_shared<FallbackLocalDerivationGoal>(drvPath, wantedOutputs, worker, buildMode); +#endif +} + +std::shared_ptr<LocalDerivationGoal> LocalDerivationGoal::makeLocalDerivationGoal( + const StorePath & drvPath, + const BasicDerivation & drv, + const OutputsSpec & wantedOutputs, + Worker & worker, + BuildMode buildMode +) +{ +#if __linux__ + return std::make_shared<LinuxLocalDerivationGoal>( + drvPath, drv, wantedOutputs, worker, buildMode + ); +#elif __APPLE__ + return std::make_shared<DarwinLocalDerivationGoal>( + drvPath, drv, wantedOutputs, worker, buildMode + ); +#else + return std::make_shared<FallbackLocalDerivationGoal>( + drvPath, drv, wantedOutputs, worker, buildMode + ); +#endif +} } |