-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.nims
More file actions
34 lines (32 loc) · 1.45 KB
/
Copy pathconfig.nims
File metadata and controls
34 lines (32 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
switch("path", "src")
# begin Nimble config (version 2)
when withDir(thisDir(), system.fileExists("nimble.paths")):
include "nimble.paths"
# end Nimble config
# Monorepo fallback: workspace root may set `--noNimblePath`, so add local
# nimsimd install path if available.
when not declared(simdNexusNoNimbleFallback):
import std/[os, strutils]
var
p: string = ""
line: string = ""
eirNimblePaths: string = joinPath("..", "Eir-CompressionAndECC", "nimble.paths")
fallback: string = joinPath(getHomeDir(), ".nimble", "pkgs2", "nimsimd-1.3.2-5202ce48d46eaf593da54e884774cdb2a884e717")
if fileExists(eirNimblePaths):
for rawLine in readFile(eirNimblePaths).splitLines:
line = rawLine.strip()
if line.startsWith("--path:") and line.contains("nimsimd-"):
p = line["--path:".len .. ^1].strip(chars = {'"', '\''})
if dirExists(p):
switch("path", p)
if dirExists(fallback):
switch("path", fallback)
## Shared pragmas and promises: one copy for the whole workspace.
if dirExists(thisDir() & "/../Rune-Pragmas/meta"):
switch("path", thisDir() & "/../Rune-Pragmas/meta")
if dirExists(thisDir() & "/submodules/Rune-Pragmas/meta"):
switch("path", thisDir() & "/submodules/Rune-Pragmas/meta")
if dirExists(thisDir() & "/../Var-Invariants/src"):
switch("path", thisDir() & "/../Var-Invariants/src")
if dirExists(thisDir() & "/submodules/Var-Invariants/src"):
switch("path", thisDir() & "/submodules/Var-Invariants/src")