refactoring: moved setOutFile to where it belongs
This commit is contained in:
parent
3492178494
commit
d66e274e1a
2 changed files with 15 additions and 14 deletions
|
|
@ -66,20 +66,6 @@ when not defined(leanCompiler):
|
||||||
compileProject(graph)
|
compileProject(graph)
|
||||||
finishDoc2Pass(graph.config.projectName)
|
finishDoc2Pass(graph.config.projectName)
|
||||||
|
|
||||||
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:
|
|
||||||
let base = conf.projectName
|
|
||||||
let targetName = if optGenDynLib in conf.globalOptions:
|
|
||||||
platform.OS[conf.target.targetOS].dllFrmt % base
|
|
||||||
elif optGenStaticLib in conf.globalOptions:
|
|
||||||
libNameTmpl(conf) % base
|
|
||||||
else:
|
|
||||||
base & platform.OS[conf.target.targetOS].exeExt
|
|
||||||
conf.outFile = RelativeFile targetName
|
|
||||||
|
|
||||||
proc commandCompileToC(graph: ModuleGraph) =
|
proc commandCompileToC(graph: ModuleGraph) =
|
||||||
let conf = graph.config
|
let conf = graph.config
|
||||||
setOutFile(conf)
|
setOutFile(conf)
|
||||||
|
|
|
||||||
|
|
@ -884,3 +884,18 @@ proc floatInt64Align*(conf: ConfigRef): int16 =
|
||||||
# to 4bytes (except with -malign-double)
|
# to 4bytes (except with -malign-double)
|
||||||
return 4
|
return 4
|
||||||
return 8
|
return 8
|
||||||
|
|
||||||
|
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:
|
||||||
|
let base = conf.projectName
|
||||||
|
let targetName =
|
||||||
|
if optGenDynLib in conf.globalOptions:
|
||||||
|
platform.OS[conf.target.targetOS].dllFrmt % base
|
||||||
|
elif optGenStaticLib in conf.globalOptions:
|
||||||
|
libNameTmpl(conf) % base
|
||||||
|
else:
|
||||||
|
base & platform.OS[conf.target.targetOS].exeExt
|
||||||
|
conf.outFile = RelativeFile targetName
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue