compilation cache: improvement: switching from codegen to 'check only' does not trigger a recompilation
This commit is contained in:
parent
bec06a0649
commit
4c5cf88c16
1 changed files with 18 additions and 1 deletions
|
|
@ -515,6 +515,23 @@ proc processIndex(r: PRodReader, idx: var TIndex) =
|
||||||
inc(r.line)
|
inc(r.line)
|
||||||
if r.s[r.pos] == ')': inc(r.pos)
|
if r.s[r.pos] == ')': inc(r.pos)
|
||||||
|
|
||||||
|
proc cmdChangeTriggersRecompilation(old, new: TCommands): bool =
|
||||||
|
if old == new: return false
|
||||||
|
# we use a 'case' statement without 'else' so that addition of a
|
||||||
|
# new command forces us to consider it here :-)
|
||||||
|
case old
|
||||||
|
of cmdCompileToC, cmdCompileToCpp, cmdCompileToOC,
|
||||||
|
cmdCompileToEcmaScript, cmdCompileToLLVM:
|
||||||
|
if new in {cmdDoc, cmdCheck, cmdIdeTools, cmdPretty, cmdDef,
|
||||||
|
cmdInteractive}:
|
||||||
|
return false
|
||||||
|
of cmdNone, cmdDoc, cmdInterpret, cmdPretty, cmdGenDepend, cmdDump,
|
||||||
|
cmdCheck, cmdParse, cmdScan, cmdIdeTools, cmdDef,
|
||||||
|
cmdRst2html, cmdRst2tex, cmdInteractive, cmdRun:
|
||||||
|
nil
|
||||||
|
# else: trigger recompilation:
|
||||||
|
result = true
|
||||||
|
|
||||||
proc processRodFile(r: PRodReader, crc: TCrc32) =
|
proc processRodFile(r: PRodReader, crc: TCrc32) =
|
||||||
var
|
var
|
||||||
w: string
|
w: string
|
||||||
|
|
@ -542,7 +559,7 @@ proc processRodFile(r: PRodReader, crc: TCrc32) =
|
||||||
of "CMD":
|
of "CMD":
|
||||||
inc(r.pos) # skip ':'
|
inc(r.pos) # skip ':'
|
||||||
var dep = cast[TCommands](int32(decodeVInt(r.s, r.pos)))
|
var dep = cast[TCommands](int32(decodeVInt(r.s, r.pos)))
|
||||||
if gCmd != dep: r.reason = rrOptions
|
if cmdChangeTriggersRecompilation(dep, gCmd): r.reason = rrOptions
|
||||||
of "DEFINES":
|
of "DEFINES":
|
||||||
inc(r.pos) # skip ':'
|
inc(r.pos) # skip ':'
|
||||||
d = 0
|
d = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue