From f5965cc91e7eb27d1def78113301e7ec28fad54a Mon Sep 17 00:00:00 2001 From: Corentin Date: Wed, 7 Jul 2021 04:11:13 +0900 Subject: [PATCH] Fix IGNORE_APPS forcing link stage --- umake.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/umake.py b/umake.py index 3403616..de76773 100755 --- a/umake.py +++ b/umake.py @@ -13,6 +13,7 @@ import sys class Config: CC = 'g++' # Compiler to call APPS = ['app_name'] # Output binaries (need to be found as .cpp directly in SOURCE_DIR) + IGNORE_APPS = [] JOB_COUNT = int(os.cpu_count() * 0.8) # Concurent jobs (multi-processing) BIN_DIR = Path('bin') # Output directory (binaries) @@ -65,6 +66,8 @@ def make(config: Config): if config.PRE_COMPILE_FUNCTION is not None: config.PRE_COMPILE_FUNCTION() + if 'IGNORE_APPS' in config.__dict__ : + config.IGNORE_APPS = [] # Update flags and directories for mode debug/release if arguments.type == 'debug': @@ -124,7 +127,8 @@ def make(config: Config): todo_list.append((source_path, cmd)) continue - if not todo_list and all([(config.BIN_DIR / app_path).exists() for app_path in config.APPS]): + if not todo_list and all([(config.BIN_DIR / app_path).exists() for app_path in config.APPS + if app_path not in config.IGNORE_APPS]): print(ConsoleColor.GREEN + 'Nothing to do' + ConsoleColor.ENDCOLOR) return @@ -181,7 +185,7 @@ def make(config: Config): if arguments.j > 1: # Multi-process jobs: list[tuple[Path, subprocess.Popen]] = [] for app_path, app_object_path in zip(config.APPS, all_app_objects): - if 'IGNORE_APPS' in config.__dict__ and app_path in config.IGNORE_APPS: + if app_path in config.IGNORE_APPS: continue bin_path = config.BIN_DIR / app_path if not bin_path.parent.exists(): @@ -206,7 +210,7 @@ def make(config: Config): error_paths.append((source_path, job.stdout.read() + job.stderr.read())) else: # Single-process for app_path, app_object_path in zip(config.APPS, all_app_objects): - if 'IGNORE_APPS' in config.__dict__ and app_path in config.IGNORE_APPS: + if app_path in config.IGNORE_APPS: continue bin_path = config.BIN_DIR / app_path if not bin_path.parent.exists():