Modified setDefaultLibpath to search using findExe"nim".
This is so that Nimble (and other tools) which use the compiler modules for nimscript support or other purposes can find $lib.
This commit is contained in:
parent
ae60f4ae76
commit
c83e4390d8
1 changed files with 11 additions and 0 deletions
|
|
@ -203,6 +203,17 @@ proc setDefaultLibpath*() =
|
||||||
else: libpath = joinPath(prefix, "lib")
|
else: libpath = joinPath(prefix, "lib")
|
||||||
else: libpath = joinPath(prefix, "lib")
|
else: libpath = joinPath(prefix, "lib")
|
||||||
|
|
||||||
|
# Special rule to support other tools (nimble) which import the compiler
|
||||||
|
# modules and make use of them.
|
||||||
|
let realNimPath = # Make sure we expand the symlink
|
||||||
|
if symlinkExists(findExe("nim")): expandSymlink(findExe("nim"))
|
||||||
|
else: findExe("nim")
|
||||||
|
# Find out if $nim/../../lib/system.nim exists.
|
||||||
|
let parentNimLibPath = realNimPath.parentDir().parentDir() / "lib"
|
||||||
|
if not fileExists(libpath / "system.nim") and
|
||||||
|
fileExists(parentNimlibPath / "system.nim"):
|
||||||
|
libpath = parentNimLibPath
|
||||||
|
|
||||||
proc canonicalizePath*(path: string): string =
|
proc canonicalizePath*(path: string): string =
|
||||||
when not FileSystemCaseSensitive: result = path.expandFilename.toLower
|
when not FileSystemCaseSensitive: result = path.expandFilename.toLower
|
||||||
else: result = path.expandFilename
|
else: result = path.expandFilename
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue