summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/extccomp.nim3
-rw-r--r--compiler/nimrod.nim10
2 files changed, 10 insertions, 3 deletions
diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim
index fe1bea3ff..d3b3cee75 100644
--- a/compiler/extccomp.nim
+++ b/compiler/extccomp.nim
@@ -616,7 +616,8 @@ proc CallCCompiler*(projectfile: string) =
       if options.outFile.len > 0: 
         exefile = options.outFile
       if not noAbsolutePaths():
-        exefile = joinPath(splitFile(projectFile).dir, exefile)
+        if not exeFile.isAbsolute():
+          exefile = joinPath(splitFile(projectFile).dir, exefile)
       exefile = quoteShell(exefile)
       let linkOptions = getLinkOptions()
       linkCmd = quoteShell(linkCmd % ["builddll", builddll,
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):