summary refs log tree commit diff stats
path: root/compiler/nimconf.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-05-11 15:28:26 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-05-11 15:28:26 +0200
commit3c4ceea4272a8e9d817e16e71581f8fa15460a34 (patch)
tree12644c95f91c57118463c45d9af465dcd3b5a720 /compiler/nimconf.nim
parenta8a544a8f716f98a8f20cd3baea5291d0de72a16 (diff)
downloadNim-3c4ceea4272a8e9d817e16e71581f8fa15460a34.tar.gz
move more global variables into ConfigRef
Diffstat (limited to 'compiler/nimconf.nim')
-rw-r--r--compiler/nimconf.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim
index b333252a1..6a26f8dc7 100644
--- a/compiler/nimconf.nim
+++ b/compiler/nimconf.nim
@@ -239,7 +239,7 @@ proc loadConfigs*(cfg: string; cache: IdentCache; config: ConfigRef = nil) =
   if optSkipUserConfigFile notin gGlobalOptions:
     readConfigFile(getUserConfigPath(cfg), cache, config)
 
-  let pd = if gProjectPath.len > 0: gProjectPath else: getCurrentDir()
+  let pd = if config.projectPath.len > 0: config.projectPath else: getCurrentDir()
   if optSkipParentConfigFiles notin gGlobalOptions:
     for dir in parentDirs(pd, fromRoot=true, inclusive=false):
       readConfigFile(dir / cfg, cache, config)
@@ -247,13 +247,13 @@ proc loadConfigs*(cfg: string; cache: IdentCache; config: ConfigRef = nil) =
   if optSkipProjConfigFile notin gGlobalOptions:
     readConfigFile(pd / cfg, cache, config)
 
-    if gProjectName.len != 0:
+    if config.projectName.len != 0:
       # new project wide config file:
-      var projectConfig = changeFileExt(gProjectFull, "nimcfg")
+      var projectConfig = changeFileExt(config.projectFull, "nimcfg")
       if not fileExists(projectConfig):
-        projectConfig = changeFileExt(gProjectFull, "nim.cfg")
+        projectConfig = changeFileExt(config.projectFull, "nim.cfg")
       readConfigFile(projectConfig, cache, config)
 
-proc loadConfigs*(cfg: string; config: ConfigRef = nil) =
+proc loadConfigs*(cfg: string; config: ConfigRef) =
   # for backwards compatibility only.
   loadConfigs(cfg, newIdentCache(), config)