nim_builder: enable parallel building

This commit is contained in:
Emery Hemingway 2022-10-04 11:16:39 -05:00 committed by ehmry
parent 1471e0c739
commit 729189eee8
2 changed files with 4 additions and 4 deletions

View File

@ -2,10 +2,10 @@
{ strictDeps ? true, depsBuildBuild ? [ ], nativeBuildInputs ? [ ]
, configurePhase ? null, buildPhase ? null, checkPhase ? null
, installPhase ? null, meta ? { }, ... }@attrs:
, installPhase ? null, enableParallelBuilding ? true, meta ? { }, ... }@attrs:
stdenv.mkDerivation (attrs // {
inherit strictDeps;
inherit strictDeps enableParallelBuilding;
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
nativeBuildInputs = [ nim ] ++ nativeBuildInputs;

View File

@ -119,8 +119,8 @@ proc buildPhase*() =
binDir = getOutputDir("bin") / "bin"
if bins != @[]:
for bin in bins:
cmds.add("nim compile $# --outdir:$# $#" %
[getenv"nimFlags", binDir, normalizedPath(srcDir / bin)])
cmds.add("nim compile $# --parallelBuild:$# --outdir:$# $#" %
[getenv("nimFlags"), getenv("NIX_BUILD_CORES","1"), binDir, normalizedPath(srcDir / bin)])
if getEnvBool"nimDoc":
echo "generating documentation"
let docDir = getOutputDir("doc") / "doc"