diff options
Diffstat (limited to 'compiler/scriptconfig.nim')
-rw-r--r-- | compiler/scriptconfig.nim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim index 184b60733..cf69e29f1 100644 --- a/compiler/scriptconfig.nim +++ b/compiler/scriptconfig.nim @@ -13,7 +13,7 @@ import ast, modules, idents, passes, passaux, condsyms, options, nimconf, sem, semdata, llstream, vm, vmdef, commands, msgs, - os, times, osproc, wordrecg, strtabs, modulegraphs, lineinfos + os, times, osproc, wordrecg, strtabs, modulegraphs, lineinfos, pathutils # we support 'cmpIgnoreStyle' natively for efficiency: from strutils import cmpIgnoreStyle, contains @@ -105,7 +105,7 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string; cbconf exists: setResult(a, options.existsConfigVar(conf, a.getString 0)) cbconf nimcacheDir: - setResult(a, options.getNimcacheDir(conf)) + setResult(a, options.getNimcacheDir(conf).string) cbconf paramStr: setResult(a, os.paramStr(int a.getInt 0)) cbconf paramCount: @@ -120,8 +120,8 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string; if arg.len > 0: conf.projectName = arg let path = - if conf.projectName.isAbsolute: conf.projectName - else: conf.projectPath / conf.projectName + if conf.projectName.isAbsolute: AbsoluteFile(conf.projectName) + else: conf.projectPath / RelativeFile(conf.projectName) try: conf.projectFull = canonicalizePath(conf, path) except OSError: @@ -149,9 +149,9 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string; cbconf cppDefine: options.cppDefine(conf, a.getString(0)) -proc runNimScript*(cache: IdentCache; scriptName: string; +proc runNimScript*(cache: IdentCache; scriptName: AbsoluteFile; freshDefines=true; conf: ConfigRef) = - rawMessage(conf, hintConf, scriptName) + rawMessage(conf, hintConf, scriptName.string) let graph = newModuleGraph(cache, conf) connectCallbacks(graph) @@ -169,7 +169,7 @@ proc runNimScript*(cache: IdentCache; scriptName: string; var m = graph.makeModule(scriptName) incl(m.flags, sfMainModule) - graph.vm = setupVM(m, cache, scriptName, graph) + graph.vm = setupVM(m, cache, scriptName.string, graph) graph.compileSystemModule() # TODO: see why this unsets hintConf in conf.notes discard graph.processModule(m, llStreamOpen(scriptName, fmRead)) |