diff options
author | Erwan Ameil <wan@idlewan.com> | 2014-10-13 01:54:44 +0200 |
---|---|---|
committer | Erwan Ameil <wan@idlewan.com> | 2014-10-13 01:54:44 +0200 |
commit | 06c32aab29b0e33653aa9c144bfe4994e706a84e (patch) | |
tree | 3798b5130c0de9a34ebf3417def4f252cd66a998 /compiler/extccomp.nim | |
parent | 679aefd89c6b0ba74270c5651f26d362935d31da (diff) | |
download | Nim-06c32aab29b0e33653aa9c144bfe4994e706a84e.tar.gz |
Tidy up the prettification of the default verbosity c compilation output
Diffstat (limited to 'compiler/extccomp.nim')
-rw-r--r-- | compiler/extccomp.nim | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index b5519216e..f19b3e7ce 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -596,21 +596,24 @@ proc callCCompiler*(projectfile: string) = var script: PRope = nil var cmds: TStringSeq = @[] var prettyCmds: TStringSeq = @[] + let prettyCb = proc (idx: int) = + echo prettyCmds[idx] compileCFile(toCompile, script, cmds, prettyCmds, false) compileCFile(externalToCompile, script, cmds, prettyCmds, true) - if gVerbosity != 1: - prettyCmds = @[] if optCompileOnly notin gGlobalOptions: if gNumberOfProcessors == 0: gNumberOfProcessors = countProcessors() var res = 0 if gNumberOfProcessors <= 1: for i in countup(0, high(cmds)): res = max(execCmd(cmds[i]), res) - elif optListCmd in gGlobalOptions or gVerbosity > 0: + elif optListCmd in gGlobalOptions or gVerbosity > 1: res = execProcesses(cmds, {poEchoCmd, poUseShell, poParentStreams}, - gNumberOfProcessors, prettyCmds) - else: + gNumberOfProcessors) + elif gVerbosity == 1: res = execProcesses(cmds, {poUseShell, poParentStreams}, - gNumberOfProcessors, prettyCmds) + gNumberOfProcessors, prettyCb) + else: + res = execProcesses(cmds, {poUseShell, poParentStreams}, + gNumberOfProcessors) if res != 0: if gNumberOfProcessors <= 1: rawMessage(errExecutionOfProgramFailed, []) |