path canonicalization for imported modules, relative paths written in rod files
This commit is contained in:
parent
de4b894541
commit
d171a8b36f
10 changed files with 73 additions and 58 deletions
|
|
@ -576,7 +576,9 @@ proc processRodFile(r: PRodReader, crc: TCrc32) =
|
|||
L = 0
|
||||
while r.s[r.pos] > '\x0A' and r.s[r.pos] != ')':
|
||||
setlen(r.files, L + 1)
|
||||
r.files[L] = decodeStr(r.s, r.pos)
|
||||
var relativePath = decodeStr(r.s, r.pos)
|
||||
var resolvedPath = relativePath.findModule
|
||||
r.files[L] = if resolvedPath.len > 0: resolvedPath else: relativePath
|
||||
inc(r.pos) # skip #10
|
||||
inc(r.line)
|
||||
inc(L)
|
||||
|
|
@ -628,7 +630,8 @@ proc processRodFile(r: PRodReader, crc: TCrc32) =
|
|||
r.initIdx = r.pos + 2 # "(\10"
|
||||
skipSection(r)
|
||||
else:
|
||||
MsgWriteln("skipping section: " & $r.pos)
|
||||
MsgWriteln("skipping section: " & section &
|
||||
" at " & $r.pos & " in " & r.filename)
|
||||
skipSection(r)
|
||||
if r.s[r.pos] == '\x0A':
|
||||
inc(r.pos)
|
||||
|
|
@ -792,7 +795,7 @@ proc getModuleIdx(filename: string): int =
|
|||
result = len(gMods)
|
||||
setlen(gMods, result + 1)
|
||||
|
||||
proc checkDep(filename: string): TReasonForRecompile =
|
||||
proc checkDep(filename: string): TReasonForRecompile =
|
||||
assert(not isNil(filename))
|
||||
var idx = getModuleIdx(filename)
|
||||
if gMods[idx].reason != rrEmpty:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue