Skip to content

Commit

Permalink
[cbuild] Reduce default verbosity when using cbuild2cmake mode
Browse files Browse the repository at this point in the history
  • Loading branch information
brondani committed Jun 14, 2024
1 parent d74fe33 commit ac1cea2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pkg/builder/cbuildidx/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (b CbuildIdxBuilder) Build() error {
log.Debug("cbuild2cmake command: " + vars.Cbuild2cmakeBin + " " + strings.Join(args, " "))
}

_, err = b.Runner.ExecuteCommand(vars.Cbuild2cmakeBin, false, args...)
_, err = b.Runner.ExecuteCommand(vars.Cbuild2cmakeBin, !(b.Options.Debug || b.Options.Verbose), args...)
if err != nil {
return err
}
Expand Down Expand Up @@ -194,7 +194,7 @@ func (b CbuildIdxBuilder) Build() error {
log.Debug("cmake configuration command: " + vars.CmakeBin + " " + strings.Join(args, " "))
}

_, err = b.Runner.ExecuteCommand(vars.CmakeBin, b.Options.Quiet, args...)
_, err = b.Runner.ExecuteCommand(vars.CmakeBin, !(b.Options.Debug || b.Options.Verbose), args...)
if err != nil {
return err
}
Expand All @@ -212,6 +212,10 @@ func (b CbuildIdxBuilder) Build() error {
args = append(args, "--target", b.BuildContext+"-database")
}

if b.Options.Generator == "Ninja" && !(b.Options.Debug || b.Options.Verbose) {
args = append(args, "--", "--quiet")
}

if b.Options.Debug {
log.Debug("cmake build command: " + vars.CmakeBin + " " + strings.Join(args, " "))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/builder/csolution/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (b CSolutionBuilder) generateBuildFiles() (err error) {
args = append(args, "--quiet")
}

_, err = b.runCSolution(args, false)
_, err = b.runCSolution(args, !(b.Options.Debug || b.Options.Verbose))

// Execute this code exclusively upon invocation of the 'setup' command.
// Its purpose is to update layer information within the *.cbuild-idx.yml files.
Expand Down

0 comments on commit ac1cea2

Please sign in to comment.