fixes #257
This commit is contained in:
parent
6978caa4ac
commit
8281bd9f0f
2 changed files with 29 additions and 28 deletions
|
|
@ -391,33 +391,6 @@ proc resetCompilationLists* =
|
||||||
initLinkedList(externalToCompile)
|
initLinkedList(externalToCompile)
|
||||||
initLinkedList(toLink)
|
initLinkedList(toLink)
|
||||||
|
|
||||||
proc footprint(filename: string): TCrc32 =
|
|
||||||
result = crcFromFile(filename) ><
|
|
||||||
platform.OS[targetOS].name ><
|
|
||||||
platform.CPU[targetCPU].name ><
|
|
||||||
extccomp.CC[extccomp.ccompiler].name
|
|
||||||
|
|
||||||
proc externalFileChanged(filename: string): bool =
|
|
||||||
var crcFile = toGeneratedFile(filename, "crc")
|
|
||||||
var currentCrc = int(footprint(filename))
|
|
||||||
var f: TFile
|
|
||||||
if open(f, crcFile, fmRead):
|
|
||||||
var line = newStringOfCap(40)
|
|
||||||
if not f.readLine(line): line = "0"
|
|
||||||
close(f)
|
|
||||||
var oldCrc = parseInt(line)
|
|
||||||
result = oldCrc != currentCrc
|
|
||||||
else:
|
|
||||||
result = true
|
|
||||||
if result:
|
|
||||||
if open(f, crcFile, fmWrite):
|
|
||||||
f.writeln($currentCrc)
|
|
||||||
close(f)
|
|
||||||
|
|
||||||
proc addExternalFileToCompile*(filename: string) =
|
|
||||||
if optForceFullMake in gGlobalOptions or externalFileChanged(filename):
|
|
||||||
appendStr(externalToCompile, filename)
|
|
||||||
|
|
||||||
proc addFileToLink*(filename: string) =
|
proc addFileToLink*(filename: string) =
|
||||||
prependStr(toLink, filename)
|
prependStr(toLink, filename)
|
||||||
# BUGFIX: was ``appendStr``
|
# BUGFIX: was ``appendStr``
|
||||||
|
|
@ -536,6 +509,34 @@ proc getCompileCFileCmd*(cfilename: string, isExternal = false): string =
|
||||||
"nimrod", quoteIfContainsWhite(getPrefixDir()),
|
"nimrod", quoteIfContainsWhite(getPrefixDir()),
|
||||||
"lib", quoteIfContainsWhite(libpath)])
|
"lib", quoteIfContainsWhite(libpath)])
|
||||||
|
|
||||||
|
proc footprint(filename: string): TCrc32 =
|
||||||
|
result = crcFromFile(filename) ><
|
||||||
|
platform.OS[targetOS].name ><
|
||||||
|
platform.CPU[targetCPU].name ><
|
||||||
|
extccomp.CC[extccomp.ccompiler].name ><
|
||||||
|
getCompileCFileCmd(filename, true)
|
||||||
|
|
||||||
|
proc externalFileChanged(filename: string): bool =
|
||||||
|
var crcFile = toGeneratedFile(filename, "crc")
|
||||||
|
var currentCrc = int(footprint(filename))
|
||||||
|
var f: TFile
|
||||||
|
if open(f, crcFile, fmRead):
|
||||||
|
var line = newStringOfCap(40)
|
||||||
|
if not f.readLine(line): line = "0"
|
||||||
|
close(f)
|
||||||
|
var oldCrc = parseInt(line)
|
||||||
|
result = oldCrc != currentCrc
|
||||||
|
else:
|
||||||
|
result = true
|
||||||
|
if result:
|
||||||
|
if open(f, crcFile, fmWrite):
|
||||||
|
f.writeln($currentCrc)
|
||||||
|
close(f)
|
||||||
|
|
||||||
|
proc addExternalFileToCompile*(filename: string) =
|
||||||
|
if optForceFullMake in gGlobalOptions or externalFileChanged(filename):
|
||||||
|
appendStr(externalToCompile, filename)
|
||||||
|
|
||||||
proc CompileCFile(list: TLinkedList, script: var PRope, cmds: var TStringSeq,
|
proc CompileCFile(list: TLinkedList, script: var PRope, cmds: var TStringSeq,
|
||||||
isExternal: bool) =
|
isExternal: bool) =
|
||||||
var it = PStrEntry(list.head)
|
var it = PStrEntry(list.head)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# Configuration file for the Nimrod Compiler.
|
# Configuration file for the Nimrod Compiler.
|
||||||
# (c) 2012 Andreas Rumpf
|
# (c) 2013 Andreas Rumpf
|
||||||
|
|
||||||
# Feel free to edit the default values as you need.
|
# Feel free to edit the default values as you need.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue