simplified code of the upcoming vccexe and vcclinkerexe tools

This commit is contained in:
Araq 2016-10-24 21:55:57 +02:00
commit 11dd0b3b51
4 changed files with 65 additions and 75 deletions

24
tools/vccenv/vccexe.nim Normal file
View 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()