summary refs log tree commit diff stats
path: root/tools/vccexe.nim
blob: a62def77ce73ae4f2482b256898d2ca7648928cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()