Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cbuild] Reduce default verbosity when using cbuild2cmake mode #236

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brondani Does this change mean
args = append(args, "--quiet")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it means -- --quiet is added to args.
So --quiet is passed to the underlying build system, in this case Ninja, for example:

cmake --build <directory> --target <target> -- --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