[caas] first version that actually works (still has a lot of logical memory leaks on recompilation)

This commit is contained in:
Zahary Karadjov 2012-11-20 16:48:32 +02:00
commit f9bd8cc985
9 changed files with 259 additions and 62 deletions

View file

@ -379,9 +379,18 @@ proc toObjFile*(filenameWithoutExt: string): string =
# Object file for compilation
result = changeFileExt(filenameWithoutExt, cc[ccompiler].objExt)
proc addFileToCompile*(filename: string) =
proc addFileToCompile*(filename: string) =
appendStr(toCompile, filename)
proc resetCompilationLists* =
initLinkedList(toCompile)
## XXX: we must associate these with their originating module
# when the module is loaded/unloaded it adds/removes its items
# That's because we still need to CRC check the external files
# Maybe we can do that in checkDep on the other hand?
initLinkedList(externalToCompile)
initLinkedList(toLink)
proc footprint(filename: string): TCrc32 =
result = crcFromFile(filename) ><
platform.OS[targetOS].name ><
@ -405,11 +414,11 @@ proc externalFileChanged(filename: string): bool =
f.writeln($currentCrc)
close(f)
proc addExternalFileToCompile*(filename: string) =
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)
# BUGFIX: was ``appendStr``
@ -540,7 +549,7 @@ proc CompileCFile(list: TLinkedList, script: var PRope, cmds: var TStringSeq,
app(script, tnl)
it = PStrEntry(it.next)
proc CallCCompiler*(projectfile: string) =
proc CallCCompiler*(projectfile: string) =
var
linkCmd, buildgui, builddll: string
if gGlobalOptions * {optCompileOnly, optGenScript} == {optCompileOnly}: