parent
d590611fc5
commit
366b9a7e4a
2 changed files with 6 additions and 11 deletions
|
|
@ -281,9 +281,6 @@ const
|
||||||
|
|
||||||
hExt* = ".h"
|
hExt* = ".h"
|
||||||
|
|
||||||
proc libNameTmpl(conf: ConfigRef): string {.inline.} =
|
|
||||||
result = if conf.target.targetOS == osWindows: "$1.lib" else: "lib$1.a"
|
|
||||||
|
|
||||||
proc nameToCC*(name: string): TSystemCC =
|
proc nameToCC*(name: string): TSystemCC =
|
||||||
## Returns the kind of compiler referred to by `name`, or ccNone
|
## Returns the kind of compiler referred to by `name`, or ccNone
|
||||||
## if the name doesn't refer to any known compiler.
|
## if the name doesn't refer to any known compiler.
|
||||||
|
|
@ -663,14 +660,7 @@ proc addExternalFileToCompile*(conf: ConfigRef; filename: AbsoluteFile) =
|
||||||
proc getLinkCmd(conf: ConfigRef; output: AbsoluteFile,
|
proc getLinkCmd(conf: ConfigRef; output: AbsoluteFile,
|
||||||
objfiles: string, isDllBuild: bool): string =
|
objfiles: string, isDllBuild: bool): string =
|
||||||
if optGenStaticLib in conf.globalOptions:
|
if optGenStaticLib in conf.globalOptions:
|
||||||
var libname: string
|
result = CC[conf.cCompiler].buildLib % ["libfile", quoteShell(output),
|
||||||
if not conf.outFile.isEmpty:
|
|
||||||
libname = conf.outFile.string.expandTilde
|
|
||||||
if not libname.isAbsolute():
|
|
||||||
libname = getCurrentDir() / libname
|
|
||||||
else:
|
|
||||||
libname = (libNameTmpl(conf) % splitFile(conf.projectName).name)
|
|
||||||
result = CC[conf.cCompiler].buildLib % ["libfile", quoteShell(libname),
|
|
||||||
"objfiles", objfiles]
|
"objfiles", objfiles]
|
||||||
else:
|
else:
|
||||||
var linkerExe = getConfigVar(conf, conf.cCompiler, ".linkerexe")
|
var linkerExe = getConfigVar(conf, conf.cCompiler, ".linkerexe")
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,15 @@ when not defined(leanCompiler):
|
||||||
finishDoc2Pass(graph.config.projectName)
|
finishDoc2Pass(graph.config.projectName)
|
||||||
|
|
||||||
proc setOutFile(conf: ConfigRef) =
|
proc setOutFile(conf: ConfigRef) =
|
||||||
|
proc libNameTmpl(conf: ConfigRef): string {.inline.} =
|
||||||
|
result = if conf.target.targetOS == osWindows: "$1.lib" else: "lib$1.a"
|
||||||
|
|
||||||
if conf.outFile.isEmpty:
|
if conf.outFile.isEmpty:
|
||||||
let base = conf.projectName
|
let base = conf.projectName
|
||||||
let targetName = if optGenDynLib in conf.globalOptions:
|
let targetName = if optGenDynLib in conf.globalOptions:
|
||||||
platform.OS[conf.target.targetOS].dllFrmt % base
|
platform.OS[conf.target.targetOS].dllFrmt % base
|
||||||
|
elif optGenStaticLib in conf.globalOptions:
|
||||||
|
libNameTmpl(conf) % base
|
||||||
else:
|
else:
|
||||||
base & platform.OS[conf.target.targetOS].exeExt
|
base & platform.OS[conf.target.targetOS].exeExt
|
||||||
conf.outFile = RelativeFile targetName
|
conf.outFile = RelativeFile targetName
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue