Set compiler.options.gPrefixDir to help it find the stdlib.
Fixes #220. Fixes #173.
This commit is contained in:
parent
cbdc4ed354
commit
b50426c3d3
2 changed files with 6 additions and 1 deletions
|
|
@ -192,6 +192,8 @@ proc findNimscriptApi(options: Options): string =
|
|||
if not inPath:
|
||||
raise newException(NimbleError, "Cannot find nimscriptapi.nim")
|
||||
|
||||
proc getNimPrefixDir(): string = splitPath(findExe("nim")).head.parentDir
|
||||
|
||||
proc execScript(scriptName: string, flags: StringTableRef, options: Options) =
|
||||
## Executes the specified script.
|
||||
##
|
||||
|
|
@ -199,6 +201,9 @@ proc execScript(scriptName: string, flags: StringTableRef, options: Options) =
|
|||
if "nimblepkg/nimscriptapi" notin compiler_options.implicitIncludes:
|
||||
compiler_options.implicitIncludes.add("nimblepkg/nimscriptapi")
|
||||
|
||||
# Ensure the compiler can find its standard library #220.
|
||||
compiler_options.gPrefixDir = getNimPrefixDir()
|
||||
|
||||
let pkgName = scriptName.splitFile.name
|
||||
|
||||
# Ensure that "nimblepkg/nimscriptapi" is in the PATH.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue