Add VCC wrappers
Enables automatic loading of Visual Studio C/C++ Build Tools
This commit is contained in:
parent
abf4e204c2
commit
c93ed48580
3 changed files with 117 additions and 0 deletions
25
tools/vccexe.nim
Normal file
25
tools/vccexe.nim
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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".addFileExt(ExeExt),
|
||||
args = commandLineParams(),
|
||||
options = vccOptions
|
||||
)
|
||||
quit vccProcess.waitForExit()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue