From 3b38ceac2e12c2b1bbe3876eb634000ddb2a9b68 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Fri, 20 Dec 2013 13:13:09 +0100 Subject: [PATCH 1/2] Runs user specified outFile if available. Refs #738. --- compiler/nimrod.nim | 10 ++++++++-- 1 file 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): From c0e2cb29195c9d84781609689697a26892ea943c Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Fri, 20 Dec 2013 13:33:43 +0100 Subject: [PATCH 2/2] Allows passing absolute paths for output. Refs #738. Previous to this the project base dir was added always, preventing user specified absolute paths to work. --- compiler/extccomp.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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,