fixes #1262
This commit is contained in:
parent
1a88c01f92
commit
4ebd7d0744
1 changed files with 12 additions and 10 deletions
|
|
@ -393,21 +393,23 @@ type
|
||||||
TLinkFeature = enum
|
TLinkFeature = enum
|
||||||
linkNormal, linkSys
|
linkNormal, linkSys
|
||||||
|
|
||||||
proc processCompile(c: PContext, n: PNode) =
|
proc relativeFile(c: PContext; n: PNode; ext=""): string =
|
||||||
var s = expectStrLit(c, n)
|
var s = expectStrLit(c, n)
|
||||||
var found = findFile(s)
|
if ext.len > 0 and splitFile(s).ext == "":
|
||||||
if found == "": found = s
|
s = addFileExt(s, ext)
|
||||||
var trunc = changeFileExt(found, "")
|
result = parentDir(n.info.toFullPath) / s
|
||||||
if not isAbsolute(found):
|
if not fileExists(result):
|
||||||
found = parentDir(n.info.toFullPath) / found
|
if isAbsolute(s): result = s
|
||||||
|
else: result = findFile(s)
|
||||||
|
|
||||||
|
proc processCompile(c: PContext, n: PNode) =
|
||||||
|
let found = relativeFile(c, n)
|
||||||
|
let trunc = found.changeFileExt("")
|
||||||
extccomp.addExternalFileToCompile(found)
|
extccomp.addExternalFileToCompile(found)
|
||||||
extccomp.addFileToLink(completeCFilePath(trunc, false))
|
extccomp.addFileToLink(completeCFilePath(trunc, false))
|
||||||
|
|
||||||
proc processCommonLink(c: PContext, n: PNode, feature: TLinkFeature) =
|
proc processCommonLink(c: PContext, n: PNode, feature: TLinkFeature) =
|
||||||
var f = expectStrLit(c, n)
|
let found = relativeFile(c, n, CC[cCompiler].objExt)
|
||||||
if splitFile(f).ext == "": f = addFileExt(f, CC[cCompiler].objExt)
|
|
||||||
var found = findFile(f)
|
|
||||||
if found == "": found = f # use the default
|
|
||||||
case feature
|
case feature
|
||||||
of linkNormal: extccomp.addFileToLink(found)
|
of linkNormal: extccomp.addFileToLink(found)
|
||||||
of linkSys:
|
of linkSys:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue