fix #17286 nim check -b:js works (#19704)

* fix #17286 nim check -b:js works

* fix
This commit is contained in:
flywind 2022-04-09 23:52:11 +08:00 • committed by GitHub
commit a77ffdb7ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -65,6 +65,8 @@ proc commandCheck(graph: ModuleGraph) =
if optWasNimscript in conf.globalOptions:
defineSymbol(conf.symbols, "nimscript")
defineSymbol(conf.symbols, "nimconfig")
elif conf.backend == backendJs:
setTarget(conf.target, osJS, cpuJS)
semanticPasses(graph) # use an empty backend for semantic checking only
compileProject(graph)