From 81cff0908e23d5c902f00a86bb19e00de6589cc3 Mon Sep 17 00:00:00 2001 From: def Date: Thu, 7 May 2015 02:29:31 +0200 Subject: [PATCH 1/2] Fix the lib path used with --app:staticlib For example if gProjectName is "src/false.nim" the old static lib name was "libsrc/false.nim.a", now it is "libfalse.a". --- compiler/extccomp.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index 26f0318ee..7d777b0e3 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -668,7 +668,8 @@ proc callCCompiler*(projectfile: string) = it = PStrEntry(it.next) if optGenStaticLib in gGlobalOptions: - linkCmd = CC[c].buildLib % ["libfile", (libNameTmpl() % gProjectName), + let (_, name, _) = splitFile(gProjectName) + linkCmd = CC[c].buildLib % ["libfile", (libNameTmpl() % name), "objfiles", objfiles] else: var linkerExe = getConfigVar(c, ".linkerexe") From a7b39e3ebf4e46f946176f3da1b11c4f52345b6f Mon Sep 17 00:00:00 2001 From: def Date: Thu, 7 May 2015 20:35:16 +0200 Subject: [PATCH 2/2] Improve code style a bit --- compiler/extccomp.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index 7d777b0e3..75cb1ef27 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -668,7 +668,7 @@ proc callCCompiler*(projectfile: string) = it = PStrEntry(it.next) if optGenStaticLib in gGlobalOptions: - let (_, name, _) = splitFile(gProjectName) + let name = splitFile(gProjectName).name linkCmd = CC[c].buildLib % ["libfile", (libNameTmpl() % name), "objfiles", objfiles] else: