Skip to content

Commit

Permalink
Persist --jobs argument
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman committed Apr 1, 2024
1 parent 8f7e9fa commit 92312b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cupcake/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,17 +789,19 @@ def cmake_dir_(self, build_dir_, flavor_, cmake):

@cascade.command()
@cascade.option(
'--jobs', '-j', help='Maximum number of simultaneous jobs.'
'--jobs', '-j', type=int, help='Maximum number of simultaneous jobs.',
)
@cascade.argument('target', required=False)
def build(self, CMAKE, build_dir_, log_dir_, cmake_dir_, flavor_, cmake, jobs, target):
def build(self, config_, CMAKE, build_dir_, log_dir_, cmake_dir_, flavor_, cmake, jobs, target):
"""Build the selected flavor."""
jobs = confee.resolve(jobs, config_.jobs, None)
confee.write(config_)
command = [CMAKE, '--build', cmake_dir_, '--verbose']
if cmake.multiConfig():
command.extend(['--config', FLAVORS[flavor_]])
command.append('--parallel')
if jobs is not None:
command.append(jobs)
command.append(str(jobs))
if target is not None:
command.extend(['--target', target])
with (log_dir_ / 'build').open('wb') as stream:
Expand Down

0 comments on commit 92312b5

Please sign in to comment.