bugfix: fix linking when symbol files are used
This commit is contained in:
parent
a3073cf078
commit
95b28700cc
5 changed files with 12 additions and 13 deletions
|
|
@ -45,11 +45,8 @@ const
|
||||||
]
|
]
|
||||||
NimMergeEndMark = "/*\tNIM_merge_END:*/"
|
NimMergeEndMark = "/*\tNIM_merge_END:*/"
|
||||||
|
|
||||||
template mergeSectionsEnabled: expr =
|
|
||||||
{optCaasEnabled, optSymbolFiles} * gGlobalOptions != {}
|
|
||||||
|
|
||||||
proc genSectionStart*(fs: TCFileSection): PRope =
|
proc genSectionStart*(fs: TCFileSection): PRope =
|
||||||
if mergeSectionsEnabled:
|
if compilationCachePresent:
|
||||||
result = toRope(tnl)
|
result = toRope(tnl)
|
||||||
app(result, "/*\t")
|
app(result, "/*\t")
|
||||||
app(result, CFileSectionNames[fs])
|
app(result, CFileSectionNames[fs])
|
||||||
|
|
@ -57,11 +54,11 @@ proc genSectionStart*(fs: TCFileSection): PRope =
|
||||||
app(result, tnl)
|
app(result, tnl)
|
||||||
|
|
||||||
proc genSectionEnd*(fs: TCFileSection): PRope =
|
proc genSectionEnd*(fs: TCFileSection): PRope =
|
||||||
if mergeSectionsEnabled:
|
if compilationCachePresent:
|
||||||
result = toRope(NimMergeEndMark & tnl)
|
result = toRope(NimMergeEndMark & tnl)
|
||||||
|
|
||||||
proc genSectionStart*(ps: TCProcSection): PRope =
|
proc genSectionStart*(ps: TCProcSection): PRope =
|
||||||
if mergeSectionsEnabled:
|
if compilationCachePresent:
|
||||||
result = toRope(tnl)
|
result = toRope(tnl)
|
||||||
app(result, "/*\t")
|
app(result, "/*\t")
|
||||||
app(result, CProcSectionNames[ps])
|
app(result, CProcSectionNames[ps])
|
||||||
|
|
@ -69,7 +66,7 @@ proc genSectionStart*(ps: TCProcSection): PRope =
|
||||||
app(result, tnl)
|
app(result, tnl)
|
||||||
|
|
||||||
proc genSectionEnd*(ps: TCProcSection): PRope =
|
proc genSectionEnd*(ps: TCProcSection): PRope =
|
||||||
if mergeSectionsEnabled:
|
if compilationCachePresent:
|
||||||
result = toRope(NimMergeEndMark & tnl)
|
result = toRope(NimMergeEndMark & tnl)
|
||||||
|
|
||||||
proc writeTypeCache(a: TIdTable, s: var string) =
|
proc writeTypeCache(a: TIdTable, s: var string) =
|
||||||
|
|
|
||||||
|
|
@ -1254,7 +1254,7 @@ proc updateCachedModule(m: BModule) =
|
||||||
let cfile = getCFile(m)
|
let cfile = getCFile(m)
|
||||||
let cfilenoext = changeFileExt(cfile, "")
|
let cfilenoext = changeFileExt(cfile, "")
|
||||||
|
|
||||||
if mergeRequired(m):
|
if mergeRequired(m) and sfMainModule notin m.module.flags:
|
||||||
mergeFiles(cfile, m)
|
mergeFiles(cfile, m)
|
||||||
genInitCode(m)
|
genInitCode(m)
|
||||||
finishTypeDescriptions(m)
|
finishTypeDescriptions(m)
|
||||||
|
|
@ -1264,8 +1264,7 @@ proc updateCachedModule(m: BModule) =
|
||||||
|
|
||||||
addFileToLink(cfilenoext)
|
addFileToLink(cfilenoext)
|
||||||
|
|
||||||
proc cgenCaasUpdate* =
|
proc updateCachedModules* =
|
||||||
# XXX(zah): clean-up the fromCache mess
|
|
||||||
for m in cgenModules():
|
for m in cgenModules():
|
||||||
if m.fromCache: m.updateCachedModule
|
if m.fromCache: m.updateCachedModule
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@ proc resetCompilationLists* =
|
||||||
initLinkedList(toLink)
|
initLinkedList(toLink)
|
||||||
|
|
||||||
proc addFileToLink*(filename: string) =
|
proc addFileToLink*(filename: string) =
|
||||||
prependStr(toLink, filename)
|
prependStr(toLink, filename)
|
||||||
# BUGFIX: was ``appendStr``
|
# BUGFIX: was ``appendStr``
|
||||||
|
|
||||||
proc execExternalProgram*(cmd: string) =
|
proc execExternalProgram*(cmd: string) =
|
||||||
|
|
|
||||||
|
|
@ -252,8 +252,8 @@ proc CommandCompileToC =
|
||||||
|
|
||||||
compileProject()
|
compileProject()
|
||||||
|
|
||||||
if optCaasEnabled in gGlobalOptions:
|
if compilationCachePresent:
|
||||||
cgenCaasUpdate()
|
updateCachedModules()
|
||||||
|
|
||||||
if gCmd != cmdRun:
|
if gCmd != cmdRun:
|
||||||
extccomp.CallCCompiler(changeFileExt(gProjectFull, ""))
|
extccomp.CallCCompiler(changeFileExt(gProjectFull, ""))
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,9 @@ var
|
||||||
proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools}
|
proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools}
|
||||||
proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc
|
proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc
|
||||||
|
|
||||||
|
template compilationCachePresent*: expr =
|
||||||
|
{optCaasEnabled, optSymbolFiles} * gGlobalOptions != {}
|
||||||
|
|
||||||
const
|
const
|
||||||
genSubDir* = "nimcache"
|
genSubDir* = "nimcache"
|
||||||
NimExt* = "nim"
|
NimExt* = "nim"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue