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