add hintCC to optionally disable printing 'CC: filename' (#8479)
This commit is contained in:
parent
818d9be311
commit
9e37e3e5e8
2 changed files with 6 additions and 4 deletions
|
|
@ -645,7 +645,7 @@ proc compileCFile(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, "CC: " & name)
|
add(prettyCmds, if hintCC in conf.notes: "CC: " & name else: "")
|
||||||
if optGenScript in conf.globalOptions:
|
if optGenScript in conf.globalOptions:
|
||||||
add(script, compileCmd)
|
add(script, compileCmd)
|
||||||
add(script, "\n")
|
add(script, "\n")
|
||||||
|
|
@ -773,7 +773,8 @@ proc callCCompiler*(conf: ConfigRef; projectfile: string) =
|
||||||
var prettyCmds: TStringSeq = @[]
|
var prettyCmds: TStringSeq = @[]
|
||||||
let prettyCb = proc (idx: int) =
|
let prettyCb = proc (idx: int) =
|
||||||
when declared(echo):
|
when declared(echo):
|
||||||
echo prettyCmds[idx]
|
let cmd = prettyCmds[idx]
|
||||||
|
if cmd != "": echo cmd
|
||||||
compileCFile(conf, conf.toCompile, script, cmds, prettyCmds)
|
compileCFile(conf, conf.toCompile, script, cmds, prettyCmds)
|
||||||
if optCompileOnly notin conf.globalOptions:
|
if optCompileOnly notin conf.globalOptions:
|
||||||
execCmdsInParallel(conf, cmds, prettyCb)
|
execCmdsInParallel(conf, cmds, prettyCb)
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ type
|
||||||
warnProveInit, warnProveField, warnProveIndex, warnGcUnsafe, warnGcUnsafe2,
|
warnProveInit, warnProveField, warnProveIndex, warnGcUnsafe, warnGcUnsafe2,
|
||||||
warnUninit, warnGcMem, warnDestructor, warnLockLevel, warnResultShadowed,
|
warnUninit, warnGcMem, warnDestructor, warnLockLevel, warnResultShadowed,
|
||||||
warnInconsistentSpacing, warnUser,
|
warnInconsistentSpacing, warnUser,
|
||||||
hintSuccess, hintSuccessX,
|
hintSuccess, hintSuccessX, hintCC,
|
||||||
hintLineTooLong, hintXDeclaredButNotUsed, hintConvToBaseNotNeeded,
|
hintLineTooLong, hintXDeclaredButNotUsed, hintConvToBaseNotNeeded,
|
||||||
hintConvFromXtoItselfNotNeeded, hintExprAlwaysX, hintQuitCalled,
|
hintConvFromXtoItselfNotNeeded, hintExprAlwaysX, hintQuitCalled,
|
||||||
hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
|
hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
|
||||||
|
|
@ -94,6 +94,7 @@ const
|
||||||
warnUser: "$1",
|
warnUser: "$1",
|
||||||
hintSuccess: "operation successful",
|
hintSuccess: "operation successful",
|
||||||
hintSuccessX: "operation successful ($# lines compiled; $# sec total; $#; $#)",
|
hintSuccessX: "operation successful ($# lines compiled; $# sec total; $#; $#)",
|
||||||
|
hintCC: "CC: \'$1\'", # unused
|
||||||
hintLineTooLong: "line too long",
|
hintLineTooLong: "line too long",
|
||||||
hintXDeclaredButNotUsed: "'$1' is declared but not used",
|
hintXDeclaredButNotUsed: "'$1' is declared but not used",
|
||||||
hintConvToBaseNotNeeded: "conversion to base object is not needed",
|
hintConvToBaseNotNeeded: "conversion to base object is not needed",
|
||||||
|
|
@ -136,7 +137,7 @@ const
|
||||||
"Spacing", "User"]
|
"Spacing", "User"]
|
||||||
|
|
||||||
HintsToStr* = [
|
HintsToStr* = [
|
||||||
"Success", "SuccessX", "LineTooLong",
|
"Success", "SuccessX", "CC", "LineTooLong",
|
||||||
"XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded",
|
"XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded",
|
||||||
"ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf",
|
"ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf",
|
||||||
"Path", "CondTrue", "Name", "Pattern", "Exec", "Link", "Dependency",
|
"Path", "CondTrue", "Name", "Pattern", "Exec", "Link", "Dependency",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue