Skip to content
Open
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
8 changes: 8 additions & 0 deletions colcon_cmake/task/cmake/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def add_arguments(self, *, parser): # noqa: D102
'--cmake-force-configure',
action='store_true',
help='Force CMake configure step')
parser.add_argument(
"--cmake-build-args", metavar='*', type=str.lstrip,
nargs='*',
help='Pass arguments to cmake --build. '
'Arguments matching other options must be prefixed by a space,\n'
'e.g. --cmake-build-args " --parallel" 4')

async def build( # noqa: D102
self, *, additional_hooks=None, skip_hook_creation=False,
Expand Down Expand Up @@ -237,6 +243,8 @@ async def _build(self, args, env, *, additional_targets=None):
cmd += ['--clean-first']
if multi_configuration_generator:
cmd += ['--config', self._get_configuration(args)]
if args.cmake_build_args:
cmd += args.cmake_build_args
else:
job_args = self._get_make_arguments(env)
if job_args:
Expand Down