Skip to content

Commit 925af7e

Browse files
tzarcrodrigob
authored andcommitted
Add ability for qmk mass-compile to build specified targets (qmk#20294)
1 parent 340c30d commit 925af7e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/python/qmk/cli/mass_compile.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from qmk.search import search_keymap_targets
1313

1414

15+
@cli.argument('builds', nargs='*', arg_only=True, help="List of builds in form <keyboard>:<keymap> to compile in parallel. Specifying this overrides all other target search options.")
1516
@cli.argument('-t', '--no-temp', arg_only=True, action='store_true', help="Remove temporary files during build.")
1617
@cli.argument('-j', '--parallel', type=int, default=1, help="Set the number of parallel make jobs; 0 means unlimited.")
1718
@cli.argument('-c', '--clean', arg_only=True, action='store_true', help="Remove object files before compiling.")
@@ -37,7 +38,11 @@ def mass_compile(cli):
3738
builddir = Path(QMK_FIRMWARE) / '.build'
3839
makefile = builddir / 'parallel_kb_builds.mk'
3940

40-
targets = search_keymap_targets(cli.args.keymap, cli.args.filter)
41+
if len(cli.args.builds) > 0:
42+
targets = [(e[0], e[1]) for e in [b.split(':') for b in cli.args.builds]]
43+
else:
44+
targets = search_keymap_targets(cli.args.keymap, cli.args.filter)
45+
4146
if len(targets) == 0:
4247
return
4348

@@ -71,9 +76,6 @@ def mass_compile(cli):
7176
f"""\
7277
@rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.elf" 2>/dev/null || true
7378
@rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.map" 2>/dev/null || true
74-
@rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.hex" 2>/dev/null || true
75-
@rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.bin" 2>/dev/null || true
76-
@rm -rf "{QMK_FIRMWARE}/.build/{keyboard_safe}_{keymap_name}.uf2" 2>/dev/null || true
7779
@rm -rf "{QMK_FIRMWARE}/.build/obj_{keyboard_safe}" || true
7880
@rm -rf "{QMK_FIRMWARE}/.build/obj_{keyboard_safe}_{keymap_name}" || true
7981
"""# noqa

0 commit comments

Comments
 (0)