nicer 'CC' output messages

This commit is contained in:
Araq 2019-05-06 23:58:15 +02:00
commit 7804b5c558
2 changed files with 5 additions and 1 deletions

View file

@ -663,7 +663,7 @@ proc compileCFiles(conf: ConfigRef; list: CFileList, script: var Rope, cmds: var
if optCompileOnly notin conf.globalOptions: if optCompileOnly notin conf.globalOptions:
add(cmds, compileCmd) add(cmds, compileCmd)
let (_, name, _) = splitFile(it.cname) let (_, name, _) = splitFile(it.cname)
add(prettyCmds, if hintCC in conf.notes: "CC: " & name else: "") add(prettyCmds, if hintCC in conf.notes: "CC: " & demaglePackageName(name) else: "")
if optGenScript in conf.globalOptions: if optGenScript in conf.globalOptions:
add(script, compileCmd) add(script, compileCmd)
add(script, "\n") add(script, "\n")

View file

@ -43,6 +43,10 @@ proc fakePackageName*(conf: ConfigRef; path: AbsoluteFile): string =
result = relativeTo(path, conf.projectPath, '/').string.multiReplace( result = relativeTo(path, conf.projectPath, '/').string.multiReplace(
{"/": "7", "..": "_", "7": "77", "_": "__"}) {"/": "7", "..": "_", "7": "77", "_": "__"})
proc demaglePackageName*(path: string): string =
result = path.multiReplace(
{"77": "7", "__": "_", "_7": "../", "7": "/"})
proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile = proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
let x = getPackageName(conf, path.string) let x = getPackageName(conf, path.string)
if x.len == 0: if x.len == 0: