compilesettings: add libpath (#16997)

* compilesettings: add libpath

* add test

* changelog

* fixup

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Timothee Cour 2021-02-12 14:50:41 -08:00 • committed by GitHub
commit 4326f743d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 19 deletions

View file

@ -12,7 +12,7 @@ import
ast, astalgo, modules, passes, condsyms,
options, sem, llstream, lineinfos, vm,
vmdef, modulegraphs, idents, os, pathutils,
passaux, scriptconfig
passaux, scriptconfig, std/compilesettings
type
Interpreter* = ref object ## Use Nim as an interpreter with this object
@ -92,10 +92,9 @@ proc findNimStdLib*(): string =
return ""
proc findNimStdLibCompileTime*(): string =
## Same as ``findNimStdLib`` but uses source files used at compile time,
## Same as `findNimStdLib` but uses source files used at compile time,
## and asserts on error.
const exe = getCurrentCompilerExe()
result = exe.splitFile.dir.parentDir / "lib"
result = querySetting(libPath)
doAssert fileExists(result / "system.nim"), "result:" & result
proc createInterpreter*(scriptName: string;