Allow to modify backend link template (#6173)

This commit is contained in:
Ruslan Mustakov 2017-09-03 06:09:22 +07:00 • committed by Andreas Rumpf
commit 31ecec6473

View file

@ -677,11 +677,14 @@ proc getLinkCmd(projectfile, objfiles: string): string =
exefile = quoteShell(exefile) exefile = quoteShell(exefile)
let linkOptions = getLinkOptions() & " " & let linkOptions = getLinkOptions() & " " &
getConfigVar(cCompiler, ".options.linker") getConfigVar(cCompiler, ".options.linker")
var linkTmpl = getConfigVar(cCompiler, ".linkTmpl")
if linkTmpl.len == 0:
linkTmpl = CC[cCompiler].linkTmpl
result = quoteShell(result % ["builddll", builddll, result = quoteShell(result % ["builddll", builddll,
"buildgui", buildgui, "options", linkOptions, "objfiles", objfiles, "buildgui", buildgui, "options", linkOptions, "objfiles", objfiles,
"exefile", exefile, "nim", getPrefixDir(), "lib", libpath]) "exefile", exefile, "nim", getPrefixDir(), "lib", libpath])
result.add ' ' result.add ' '
addf(result, CC[cCompiler].linkTmpl, ["builddll", builddll, addf(result, linkTmpl, ["builddll", builddll,
"buildgui", buildgui, "options", linkOptions, "buildgui", buildgui, "options", linkOptions,
"objfiles", objfiles, "exefile", exefile, "objfiles", objfiles, "exefile", exefile,
"nim", quoteShell(getPrefixDir()), "nim", quoteShell(getPrefixDir()),