diff options
Diffstat (limited to 'compiler/options.nim')
-rw-r--r-- | compiler/options.nim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/options.nim b/compiler/options.nim index 8cfd2f2fb..f096f22e0 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -234,6 +234,7 @@ type ## symbols are always guaranteed to be style ## insensitive. Otherwise hell would break lose. packageCache*: StringTableRef + nimblePaths*: seq[AbsoluteDir] searchPaths*: seq[AbsoluteDir] lazyPaths*: seq[AbsoluteDir] outFile*: RelativeFile @@ -587,6 +588,15 @@ proc pathSubs*(conf: ConfigRef; p, config: string): string = if "~/" in result: result = result.replace("~/", home & '/') +iterator nimbleSubs*(conf: ConfigRef; p: string): string = + let pl = p.toLowerAscii + if "$nimblepath" in pl or "$nimbledir" in pl: + for i in countdown(conf.nimblePaths.len-1, 0): + let nimblePath = removeTrailingDirSep(conf.nimblePaths[i].string) + yield p % ["nimblepath", nimblePath, "nimbledir", nimblePath] + else: + yield p + proc toGeneratedFile*(conf: ConfigRef; path: AbsoluteFile, ext: string): AbsoluteFile = ## converts "/home/a/mymodule.nim", "rod" to "/home/a/nimcache/mymodule.rod" |