undefine C symbols in JS backend [backport:1.6] (#19437)
fix #19330; fix #19059
This commit is contained in:
parent
33bfe5b12c
commit
7b09fd70ab
3 changed files with 11 additions and 3 deletions
|
|
@ -64,7 +64,8 @@ proc loadConfigsAndProcessCmdLine*(self: NimProg, cache: IdentCache; conf: Confi
|
||||||
if conf.cmd == cmdNimscript: return false
|
if conf.cmd == cmdNimscript: return false
|
||||||
# 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 overwrite the config file's settings
|
# command line can overwrite the config file's settings
|
||||||
extccomp.initVars(conf)
|
if conf.backend != backendJs: # bug #19059
|
||||||
|
extccomp.initVars(conf)
|
||||||
self.processCmdLine(passCmd2, "", conf)
|
self.processCmdLine(passCmd2, "", conf)
|
||||||
if conf.cmd == cmdNone:
|
if conf.cmd == cmdNone:
|
||||||
rawMessage(conf, errGenerated, "command missing")
|
rawMessage(conf, errGenerated, "command missing")
|
||||||
|
|
|
||||||
|
|
@ -899,8 +899,9 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
||||||
splitSwitch(conf, arg, key, val, pass, info)
|
splitSwitch(conf, arg, key, val, pass, info)
|
||||||
os.putEnv(key, val)
|
os.putEnv(key, val)
|
||||||
of "cc":
|
of "cc":
|
||||||
expectArg(conf, switch, arg, pass, info)
|
if conf.backend != backendJs: # bug #19330
|
||||||
setCC(conf, arg, info)
|
expectArg(conf, switch, arg, pass, info)
|
||||||
|
setCC(conf, arg, info)
|
||||||
of "track":
|
of "track":
|
||||||
expectArg(conf, switch, arg, pass, info)
|
expectArg(conf, switch, arg, pass, info)
|
||||||
track(conf, arg, info)
|
track(conf, arg, info)
|
||||||
|
|
|
||||||
6
tests/js/tcsymbol.nim
Normal file
6
tests/js/tcsymbol.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
discard """
|
||||||
|
matrix: "--cc:gcc; --cc:tcc"
|
||||||
|
"""
|
||||||
|
|
||||||
|
doAssert not defined(gcc)
|
||||||
|
doAssert not defined(tcc)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue