Skip to content
Open
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
13 changes: 12 additions & 1 deletion cmd/gomobile/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,13 @@ func runBind(cmd *command) error {
case isAndroidPlatform(targets[0].platform):
return goAndroidBind(gobind, pkgs, targets)
case isApplePlatform(targets[0].platform):
if buildWorkerError := validateBuildWorkers(buildWorkers); buildWorkerError != nil {
return buildWorkerError
}
if !xcodeAvailable() {
return fmt.Errorf("-target=%q requires Xcode", buildTarget)
}
return goAppleBind(gobind, pkgs, targets)
return goAppleBind(gobind, pkgs, targets, buildWorkers)
default:
return fmt.Errorf(`invalid -target=%q`, buildTarget)
}
Expand Down Expand Up @@ -321,3 +324,11 @@ func areGoModulesUsed() (bool, error) {
}
return true, nil
}

func validateBuildWorkers(workers int) error {
if workers < 1 {
return fmt.Errorf("invalid workers %d: must be >= 1", workers)
} else {
return nil
}
}
Loading