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
|
|
@ -10,7 +10,7 @@ srcDir = "src"
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
||||||
requires "nim >= 0.13.0"
|
requires "nim >= 0.13.0", "compiler#head"
|
||||||
|
|
||||||
task tests, "Run the Nimble tester!":
|
task tests, "Run the Nimble tester!":
|
||||||
withDir "tests":
|
withDir "tests":
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,8 @@ proc findNimscriptApi(options: Options): string =
|
||||||
if not inPath:
|
if not inPath:
|
||||||
raise newException(NimbleError, "Cannot find nimscriptapi.nim")
|
raise newException(NimbleError, "Cannot find nimscriptapi.nim")
|
||||||
|
|
||||||
|
proc getNimPrefixDir(): string = splitPath(findExe("nim")).head.parentDir
|
||||||
|
|
||||||
proc execScript(scriptName: string, flags: StringTableRef, options: Options) =
|
proc execScript(scriptName: string, flags: StringTableRef, options: Options) =
|
||||||
## Executes the specified script.
|
## Executes the specified script.
|
||||||
##
|
##
|
||||||
|
|
@ -199,6 +201,9 @@ proc execScript(scriptName: string, flags: StringTableRef, options: Options) =
|
||||||
if "nimblepkg/nimscriptapi" notin compiler_options.implicitIncludes:
|
if "nimblepkg/nimscriptapi" notin compiler_options.implicitIncludes:
|
||||||
compiler_options.implicitIncludes.add("nimblepkg/nimscriptapi")
|
compiler_options.implicitIncludes.add("nimblepkg/nimscriptapi")
|
||||||
|
|
||||||
|
# Ensure the compiler can find its standard library #220.
|
||||||
|
compiler_options.gPrefixDir = getNimPrefixDir()
|
||||||
|
|
||||||
let pkgName = scriptName.splitFile.name
|
let pkgName = scriptName.splitFile.name
|
||||||
|
|
||||||
# Ensure that "nimblepkg/nimscriptapi" is in the PATH.
|
# Ensure that "nimblepkg/nimscriptapi" is in the PATH.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue