Undefine some symbols and globalOptions when processing nimscript (#9945) [backport]
* Undefine some symbols when processing nimscript * Undefine taintMode when processing nimscript * Reload .cfg configuration
This commit is contained in:
parent
8dfe7c0963
commit
bb85869237
1 changed files with 12 additions and 0 deletions
|
|
@ -48,6 +48,15 @@ proc loadConfigsAndRunMainCommand*(self: NimProg, cache: IdentCache; conf: Confi
|
||||||
if self.suggestMode:
|
if self.suggestMode:
|
||||||
conf.command = "nimsuggest"
|
conf.command = "nimsuggest"
|
||||||
|
|
||||||
|
# These defines/options should not be enabled while processing nimscript
|
||||||
|
# bug #4446, #9420, #8991, #9589, #9153
|
||||||
|
undefSymbol(conf.symbols, "profiler")
|
||||||
|
undefSymbol(conf.symbols, "memProfiler")
|
||||||
|
undefSymbol(conf.symbols, "nodejs")
|
||||||
|
|
||||||
|
# bug #9120
|
||||||
|
conf.globalOptions.excl(optTaintMode)
|
||||||
|
|
||||||
proc runNimScriptIfExists(path: AbsoluteFile)=
|
proc runNimScriptIfExists(path: AbsoluteFile)=
|
||||||
if fileExists(path):
|
if fileExists(path):
|
||||||
runNimScript(cache, path, freshDefines = false, conf)
|
runNimScript(cache, path, freshDefines = false, conf)
|
||||||
|
|
@ -79,6 +88,9 @@ proc loadConfigsAndRunMainCommand*(self: NimProg, cache: IdentCache; conf: Confi
|
||||||
# 'nimsuggest foo.nims' means to just auto-complete the NimScript file
|
# 'nimsuggest foo.nims' means to just auto-complete the NimScript file
|
||||||
discard
|
discard
|
||||||
|
|
||||||
|
# Reload configuration from .cfg file
|
||||||
|
loadConfigs(DefaultConfig, cache, conf)
|
||||||
|
|
||||||
# now process command line arguments again, because some options in the
|
# now process command line arguments again, because some options in the
|
||||||
# command line can overwite the config file's settings
|
# command line can overwite the config file's settings
|
||||||
extccomp.initVars(conf)
|
extccomp.initVars(conf)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue