simplified code of the upcoming vccexe and vcclinkerexe tools
This commit is contained in:
parent
c15cef7d2d
commit
11dd0b3b51
4 changed files with 65 additions and 75 deletions
24
tools/vccenv/vccexe.nim
Normal file
24
tools/vccenv/vccexe.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import strtabs, os, osproc, vccenv
|
||||
|
||||
when defined(release):
|
||||
let vccOptions = {poParentStreams}
|
||||
else:
|
||||
let vccOptions = {poEchoCmd, poParentStreams}
|
||||
|
||||
when isMainModule:
|
||||
var vccEnvStrTab: StringTableRef = nil
|
||||
when defined(i386):
|
||||
vccEnvStrTab = getVccEnv "x86"
|
||||
when defined(amd64):
|
||||
vccEnvStrTab = getVccEnv "amd64"
|
||||
when defined(arm):
|
||||
vccEnvStrTab = getVccEnv "arm"
|
||||
if vccEnvStrTab != nil:
|
||||
for vccEnvKey, vccEnvVal in vccEnvStrTab:
|
||||
putEnv(vccEnvKey, vccEnvVal)
|
||||
let vccProcess = startProcess(
|
||||
"cl.exe",
|
||||
args = commandLineParams(),
|
||||
options = vccOptions
|
||||
)
|
||||
quit vccProcess.waitForExit()
|
||||
Loading…
Add table
Add a link
Reference in a new issue