mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes serious regression that was introduced in the handling of .compile pragma
This commit is contained in:
@@ -658,16 +658,16 @@ proc externalFileChanged(cfile: Cfile): bool =
|
||||
f.writeLine($currentHash)
|
||||
close(f)
|
||||
|
||||
proc addExternalFileToCompile*(c: var Cfile) =
|
||||
if optForceFullMake notin gGlobalOptions and not externalFileChanged(c):
|
||||
c.flags.incl CfileFlag.Cached
|
||||
toCompile.add(c)
|
||||
|
||||
proc addExternalFileToCompile*(filename: string) =
|
||||
let c = Cfile(cname: filename,
|
||||
var c = Cfile(cname: filename,
|
||||
obj: toObjFile(completeCFilePath(changeFileExt(filename, ""), false)),
|
||||
flags: {CfileFlag.External})
|
||||
if optForceFullMake in gGlobalOptions or externalFileChanged(c):
|
||||
toCompile.add(c)
|
||||
|
||||
proc addExternalFileToCompile*(c: Cfile) =
|
||||
if optForceFullMake in gGlobalOptions or externalFileChanged(c):
|
||||
toCompile.add(c)
|
||||
addExternalFileToCompile(c)
|
||||
|
||||
proc compileCFile(list: CFileList, script: var Rope, cmds: var TStringSeq,
|
||||
prettyCmds: var TStringSeq) =
|
||||
@@ -782,7 +782,7 @@ proc callCCompiler*(projectfile: string) =
|
||||
it = PStrEntry(it.next)
|
||||
for x in toCompile:
|
||||
add(objfiles, ' ')
|
||||
add(objfiles, quoteShell(x.obj))
|
||||
add(objfiles, x.obj)
|
||||
|
||||
linkCmd = getLinkCmd(projectfile, objfiles)
|
||||
if optCompileOnly notin gGlobalOptions:
|
||||
|
||||
@@ -419,8 +419,10 @@ proc processCompile(c: PContext, n: PNode) =
|
||||
var found = parentDir(n.info.toFullPath) / s
|
||||
for f in os.walkFiles(found):
|
||||
let nameOnly = extractFilename(f)
|
||||
extccomp.addExternalFileToCompile(Cfile(cname: f,
|
||||
obj: dest % nameOnly, flags: {CfileFlag.External}))
|
||||
var cf = Cfile(cname: f,
|
||||
obj: completeCFilePath(dest % nameOnly),
|
||||
flags: {CfileFlag.External})
|
||||
extccomp.addExternalFileToCompile(cf)
|
||||
else:
|
||||
let s = expectStrLit(c, n)
|
||||
var found = parentDir(n.info.toFullPath) / s
|
||||
|
||||
Reference in New Issue
Block a user