summary refs log tree commit diff stats
path: root/compiler/nimrod.nim
diff options
context:
space:
mode:
authorGrzegorz Adam Hankiewicz <gradha@imap.cc>2013-12-20 13:13:09 +0100
committerGrzegorz Adam Hankiewicz <gradha@imap.cc>2013-12-20 13:13:09 +0100
commit3b38ceac2e12c2b1bbe3876eb634000ddb2a9b68 (patch)
tree0624b3703b1b7cf6bccb5b0940b564d7dc31a500 /compiler/nimrod.nim
parent7ee0763bc5b88229074dcf9f7b780cb4873453aa (diff)
downloadNim-3b38ceac2e12c2b1bbe3876eb634000ddb2a9b68.tar.gz
Runs user specified outFile if available. Refs #738.
Diffstat (limited to 'compiler/nimrod.nim')
-rw-r--r--compiler/nimrod.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim
index 8e3c0e61e..2bc94e3f8 100644
--- a/compiler/nimrod.nim
+++ b/compiler/nimrod.nim
@@ -65,8 +65,14 @@ proc HandleCmdLine() =
             completeCFilePath(changeFileExt(gProjectFull, "js").prependCurDir))
           execExternalProgram("node " & ex & ' ' & service.arguments)
         else:
-          var ex = quoteShell(
-            changeFileExt(gProjectFull, exeExt).prependCurDir)
+          var binPath: string
+          if options.outFile.len > 0:
+            # If the user specified an outFile path, use that directly.
+            binPath = options.outFile.prependCurDir
+          else:
+            # Figure out ourselves a valid binary name.
+            binPath = changeFileExt(gProjectFull, exeExt).prependCurDir
+          var ex = quoteShell(binPath)
           execExternalProgram(ex & ' ' & service.arguments)
 
 when defined(GC_setMaxPause):