diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index 5417cd1e93aa..3814cbd15136 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -223,6 +223,7 @@ proc readConfigFile*(filename: AbsoluteFile; cache: IdentCache; stream = llStreamOpen(filename, fmRead) if stream != nil: openLexer(L, filename, stream, cache, config) + setConfigVar(config, "srcDir", parentDir(filename.string)) tok = Token(tokType: tkEof) # to avoid a pointless warning var condStack: seq[bool] = @[] confTok(L, tok, config, condStack) # read in the first token