[build] fix nimbus-build-system (#343)

Ensures that we include the correct paths when building
with nimbus-build-system.

Fixes Error: cannot open file: ""

Copied from:
1ea102b033/config.nims (L5)
This commit is contained in:
markspanbroek 2023-02-08 09:48:27 +01:00 committed by GitHub
parent 82e7a2dde6
commit 3b4a078052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,15 @@
import std/os
const currentDir = currentSourcePath()[0 .. ^(len("config.nims") + 1)]
if getEnv("NIMBUS_BUILD_SYSTEM") == "yes" and
# BEWARE
# In Nim 1.6, config files are evaluated with a working directory
# matching where the Nim command was invocated. This means that we
# must do all file existance checks with full absolute paths:
system.fileExists(currentDir & "nimbus-build-system.paths"):
include "nimbus-build-system.paths"
if defined(release):
switch("nimcache", joinPath(currentSourcePath.parentDir, "nimcache/release/$projectName"))
else: