summary refs log blame commit diff stats
path: root/tools/vccenv/vccexe.nim
blob: 48ae8c8da9380eb3735802ea73b5cd56cad6d9c9 (plain) (tree)
1
2
3
4
5
6


                                  
                                    
     
                                               












                                             
               



                                 
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()