Skip to content

Commit

Permalink
Let build tool handle default --jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc committed Jan 11, 2024
1 parent 18e1ec1 commit cd00bcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/fprime/fbuild/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ def add_target_parser(
parser.add_argument(
"-j",
"--jobs",
default=1,
type=int,
help="Parallel build job count. Default: %(default)s.",
help="Parallel build job count. Default: build tool default (make: 1, ninja: # of cores)",
)
parser, flags = existing[target.mnemonic]
new_flags = [flag for flag in target.flags if flag not in flags]
Expand Down
3 changes: 2 additions & 1 deletion src/fprime/util/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ def validate(parsed, unknown):
# Build type only for generate, jobs only for non-generate
elif parsed.command in [target.mnemonic for target in Target.get_all_targets()]:
parsed.settings = None # Force to load from cache if possible
make_args["--jobs"] = 1 if parsed.jobs <= 0 else parsed.jobs
if parsed.jobs:
make_args["--jobs"] = 1 if parsed.jobs <= 0 else parsed.jobs
# Check if any arguments are still unknown
if unknown:
runnable = f"{os.path.basename(sys.argv[0])} {parsed.command}"
Expand Down

0 comments on commit cd00bcc

Please sign in to comment.