summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-05-06 23:58:15 +0200
committerAraq <rumpf_a@web.de>2019-05-06 23:58:15 +0200
commit7804b5c55888717b35432c2670f4eef23afd583a (patch)
tree64aa8b653d122423416d3558a7c56a67850a1f48
parent2475d92c36e26e44372175c2cf4c21fbab084619 (diff)
downloadNim-7804b5c55888717b35432c2670f4eef23afd583a.tar.gz
nicer 'CC' output messages
-rw-r--r--compiler/extccomp.nim2
-rw-r--r--compiler/packagehandling.nim4
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim
index 9880ecf4f..dfbd2626a 100644
--- a/compiler/extccomp.nim
+++ b/compiler/extccomp.nim
@@ -663,7 +663,7 @@ proc compileCFiles(conf: ConfigRef; list: CFileList, script: var Rope, cmds: var
     if optCompileOnly notin conf.globalOptions:
       add(cmds, compileCmd)
       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:
       add(script, compileCmd)
       add(script, "\n")
diff --git a/compiler/packagehandling.nim b/compiler/packagehandling.nim
index d7c6b25ae..0e9331128 100644
--- a/compiler/packagehandling.nim
+++ b/compiler/packagehandling.nim
@@ -43,6 +43,10 @@ proc fakePackageName*(conf: ConfigRef; path: AbsoluteFile): string =
   result = relativeTo(path, conf.projectPath, '/').string.multiReplace(
     {"/": "7", "..": "_", "7": "77", "_": "__"})
 
+proc demaglePackageName*(path: string): string =
+  result = path.multiReplace(
+    {"77": "7", "__": "_", "_7": "../", "7": "/"})
+
 proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
   let x = getPackageName(conf, path.string)
   if x.len == 0: