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

add parallel flag into build options #173

Merged
Merged
Changes from 2 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
14 changes: 14 additions & 0 deletions build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ def __init__(self):
'--search-prefix', dest='search_prefix', type=str,
help='search prefix to pass to CMake'
)

'''Option to control resource usage when running on a Raspberry Pi'''
self.parser.add_argument(
'--parallel', dest='parallel', type=int,
help='Control the number of parallel build processes or threads'
)

'''Agent only'''
self.parser.add_argument(
Expand Down Expand Up @@ -422,6 +428,7 @@ def __init__(self, script_args):
self.static_analysis = self.script_args.static_analysis
self.build_for_snap = self.script_args.build_for_snap
self.search_prefix = self.script_args.search_prefix
self.parallel = self.script_args.parallel

@property
def platform(self):
Expand Down Expand Up @@ -462,6 +469,13 @@ def run(self):
def package(self):
subprocess.call(['/bin/bash', '-c', 'cd {} && cpack .'.format(self.build_path)])

@property
def build_options(self):
build_options_linux = super().build_options
if (self.parallel):
build_options_linux += ['--parallel', str(self.parallel)]
return build_options_linux

class WindowsBuildRunner(BuildRunnerBase):
"""Windows BuildRunner class."""

Expand Down