.compile pragma supports wildcards
This commit is contained in:
parent
c8dcf8993f
commit
27bc6c1974
1 changed files with 16 additions and 4 deletions
|
|
@ -402,7 +402,19 @@ proc relativeFile(c: PContext; n: PNode; ext=""): string =
|
||||||
if result.len == 0: result = s
|
if result.len == 0: result = s
|
||||||
|
|
||||||
proc processCompile(c: PContext, n: PNode) =
|
proc processCompile(c: PContext, n: PNode) =
|
||||||
let found = relativeFile(c, n)
|
var s = expectStrLit(c, n)
|
||||||
|
var found = parentDir(n.info.toFullPath) / s
|
||||||
|
if '*' in found:
|
||||||
|
for f in os.walkFiles(found):
|
||||||
|
let trunc = f.changeFileExt("")
|
||||||
|
extccomp.addExternalFileToCompile(f)
|
||||||
|
extccomp.addFileToLink(completeCFilePath(trunc, false))
|
||||||
|
else:
|
||||||
|
if not fileExists(found):
|
||||||
|
if isAbsolute(s): found = s
|
||||||
|
else:
|
||||||
|
found = findFile(s)
|
||||||
|
if found.len == 0: found = s
|
||||||
let trunc = found.changeFileExt("")
|
let trunc = found.changeFileExt("")
|
||||||
extccomp.addExternalFileToCompile(found)
|
extccomp.addExternalFileToCompile(found)
|
||||||
extccomp.addFileToLink(completeCFilePath(trunc, false))
|
extccomp.addFileToLink(completeCFilePath(trunc, false))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue