mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
Fixed c filenames mangling (#12161)
This commit is contained in:
committed by
Andreas Rumpf
parent
e134a722de
commit
5783cd67a8
@@ -39,11 +39,11 @@ proc getPackageName*(conf: ConfigRef; path: string): string =
|
||||
if parents <= 0: break
|
||||
|
||||
proc fakePackageName*(conf: ConfigRef; path: AbsoluteFile): string =
|
||||
# foo/../bar becomes foo@..@bar
|
||||
result = relativeTo(path, conf.projectPath, '/').string.multiReplace({"/": "@", "@": "@@"})
|
||||
# foo-#head/../bar becomes @foo-@hhead@s..@sbar
|
||||
result = "@" & relativeTo(path, conf.projectPath, '/').string.multiReplace({"/": "@s", "#": "@h", "@": "@@"})
|
||||
|
||||
proc demanglePackageName*(path: string): string =
|
||||
result = path.multiReplace({"@@": "@", "@": "/"})
|
||||
result = path[1 .. ^1].multiReplace({"@@": "@", "@h": "#", "@s": "/"})
|
||||
|
||||
proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
|
||||
let x = getPackageName(conf, path.string)
|
||||
|
||||
@@ -332,7 +332,7 @@ proc generatedFile(test: TTest, target: TTarget): string =
|
||||
else:
|
||||
let (_, name, _) = test.name.splitFile
|
||||
let ext = targetToExt[target]
|
||||
result = nimcacheDir(test.name, test.options, target) / name.changeFileExt(ext)
|
||||
result = nimcacheDir(test.name, test.options, target) / "@" & name.changeFileExt(ext)
|
||||
|
||||
proc needsCodegenCheck(spec: TSpec): bool =
|
||||
result = spec.maxCodeSize > 0 or spec.ccodeCheck.len > 0
|
||||
|
||||
Reference in New Issue
Block a user