fix empty link file list during external compilation (#5577)
This commit is contained in:
parent
be174fc3c7
commit
d508303fad
1 changed files with 18 additions and 8 deletions
|
|
@ -785,14 +785,24 @@ proc writeJsonBuildInstructions*(projectfile: string) =
|
||||||
else:
|
else:
|
||||||
lit "],\L"
|
lit "],\L"
|
||||||
|
|
||||||
proc linkfiles(f: File; buf, objfiles: var string; toLink: seq[string]) =
|
proc linkfiles(f: File; buf, objfiles: var string) =
|
||||||
for i, it in toLink:
|
for i, it in externalToLink:
|
||||||
let objfile = addFileExt(it, CC[cCompiler].objExt)
|
let
|
||||||
str(objfile)
|
objFile = if noAbsolutePaths(): it.extractFilename else: it
|
||||||
|
objStr = addFileExt(objFile, CC[cCompiler].objExt)
|
||||||
add(objfiles, ' ')
|
add(objfiles, ' ')
|
||||||
add(objfiles, quoteShell(objfile))
|
add(objfiles, objStr)
|
||||||
|
str objStr
|
||||||
if i == toLink.high:
|
if toCompile.len == 0 and i == externalToLink.high:
|
||||||
|
lit "\L"
|
||||||
|
else:
|
||||||
|
lit ",\L"
|
||||||
|
for i, x in toCompile:
|
||||||
|
let objStr = quoteShell(x.obj)
|
||||||
|
add(objfiles, ' ')
|
||||||
|
add(objfiles, objStr)
|
||||||
|
str objStr
|
||||||
|
if i == toCompile.high:
|
||||||
lit "\L"
|
lit "\L"
|
||||||
else:
|
else:
|
||||||
lit ",\L"
|
lit ",\L"
|
||||||
|
|
@ -809,7 +819,7 @@ proc writeJsonBuildInstructions*(projectfile: string) =
|
||||||
lit "],\L\"link\":[\L"
|
lit "],\L\"link\":[\L"
|
||||||
var objfiles = ""
|
var objfiles = ""
|
||||||
# XXX add every file here that is to link
|
# XXX add every file here that is to link
|
||||||
linkfiles(f, buf, objfiles, externalToLink)
|
linkfiles(f, buf, objfiles)
|
||||||
|
|
||||||
lit "],\L\"linkcmd\": "
|
lit "],\L\"linkcmd\": "
|
||||||
str getLinkCmd(projectfile, objfiles)
|
str getLinkCmd(projectfile, objfiles)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue