From 7051ba84984b20676ef2de07349e56b0d7bdfa8c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 14 May 2020 08:49:47 +0200 Subject: [PATCH] Build script: Add option for passing arguments to build command So one can pass e.g. -j3 when locally testing while still doing other things Change-Id: I7a528884f19698290e49c372eb31030afe609d23 Reviewed-by: Eike Ziller --- scripts/build.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/build.py b/scripts/build.py index 8102224cd8b..e7e414f5087 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -87,6 +87,8 @@ def get_arguments(): action='store_true', default=False) parser.add_argument('--no-zip', help='Skip creation of 7zip files for install and developer package', action='store_true', default=False) + parser.add_argument('--add-make-arg', help='Passes the argument to the make tool.', + action='append', dest='make_args', default=[]) return parser.parse_args() def build_qtcreator(args, paths): @@ -137,7 +139,10 @@ def build_qtcreator(args, paths): '-DIDE_REVISION_URL=https://code.qt.io/cgit/qt-creator/qt-creator.git/log/?id=' + ide_revision] common.check_print_call(cmake_args + [paths.src], paths.build) - common.check_print_call(['cmake', '--build', '.'], paths.build) + build_args = ['cmake', '--build', '.'] + if args.make_args: + build_args += ['--'] + args.make_args + common.check_print_call(build_args, paths.build) if not args.no_docs: common.check_print_call(['cmake', '--build', '.', '--target', 'docs'], paths.build)