Skip to content

Commit

Permalink
[cbuild2cmake support] Handle context-set flag
Browse files Browse the repository at this point in the history
  • Loading branch information
brondani committed Apr 25, 2024
1 parent 17a952c commit ed9ca6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/builder/cbuildidx/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ func (b CbuildIdxBuilder) Build() error {
}

args := []string{b.InputFile}
if b.Options.UseContextSet {
args = append(args, "--context-set")
}
if b.Options.Debug {
args = append(args, "--debug")
log.Debug("cbuild2cmake command: " + vars.Cbuild2cmakeBin + " " + strings.Join(args, " "))
Expand Down
7 changes: 7 additions & 0 deletions pkg/builder/cbuildidx/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ func TestBuildAllContexts(t *testing.T) {
assert.Nil(err)
})

t.Run("test build use context set", func(t *testing.T) {
b.Options.UseContextSet = true
err := b.Build()
assert.Nil(err)
b.Options.UseContextSet = false
})

t.Run("test setup", func(t *testing.T) {
b.Setup = true
err := b.Build()
Expand Down

0 comments on commit ed9ca6c

Please sign in to comment.