summary refs log tree commit diff stats
path: root/tools/vccexe.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tools/vccexe.nim')
-rw-r--r--tools/vccexe.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/vccexe.nim b/tools/vccexe.nim
new file mode 100644
index 000000000..a62def77c
--- /dev/null
+++ b/tools/vccexe.nim
@@ -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()
+    
\ No newline at end of file