@@ -244,8 +244,7 @@ def do_run_common(command, user_args, user_runner_args, domain_file=None):
244
244
)
245
245
246
246
build_dir = get_build_dir (user_args )
247
- if not user_args .skip_rebuild :
248
- rebuild (command , build_dir , user_args )
247
+ rebuild (command , build_dir , user_args )
249
248
250
249
domains = get_domains_to_process (build_dir , user_args , domain_file )
251
250
@@ -568,6 +567,13 @@ def load_cmake_cache(build_dir, args):
568
567
log .die (f'no CMake cache found (expected one at { cache_file } )' )
569
568
570
569
def rebuild (command , build_dir , args ):
570
+ # Check if skip-rebuild is configured globally
571
+ skip_rebuild_config = config .get ('flash' , 'skip-rebuild' , fallback = 'false' )
572
+ skip_rebuild = args .skip_rebuild or (skip_rebuild_config .lower () == 'true' )
573
+
574
+ if skip_rebuild :
575
+ return
576
+
571
577
_banner (f'west { command .name } : rebuilding' )
572
578
try :
573
579
zcmake .run_build (build_dir )
@@ -723,7 +729,7 @@ def dump_context(command, args, unknown_args):
723
729
get_all_domain = True
724
730
725
731
# Re-build unless asked not to, to make sure the output is up to date.
726
- if build_dir and not args . skip_rebuild :
732
+ if build_dir :
727
733
rebuild (command , build_dir , args )
728
734
729
735
domains = get_domains_to_process (build_dir , args , None , get_all_domain )
0 commit comments