From b99f3743e7371cc2975d5b9a7a6b0cbb7eb7f742 Mon Sep 17 00:00:00 2001 From: Anatoly Galiulin Date: Fri, 16 Dec 2016 14:26:47 +0700 Subject: Use ``out`` compiler option when linking static library --- compiler/extccomp.nim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index 735b44028..402c9592e 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -659,8 +659,14 @@ proc compileCFile(list: TLinkedList, script: var Rope, cmds: var TStringSeq, proc getLinkCmd(projectfile, objfiles: string): string = if optGenStaticLib in gGlobalOptions: - let name = splitFile(gProjectName).name - result = CC[cCompiler].buildLib % ["libfile", (libNameTmpl() % name), + var libname: string + if options.outFile.len > 0: + libname = options.outFile.expandTilde + if not libname.isAbsolute(): + libname = getCurrentDir() / libname + else: + libname = (libNameTmpl() % splitFile(gProjectName).name) + result = CC[cCompiler].buildLib % ["libfile", libname, "objfiles", objfiles] else: var linkerExe = getConfigVar(cCompiler, ".linkerexe") -- cgit 1.4.1-2-gfad0