Fix IGNORE_APPS forcing link stage

This commit is contained in:
Corentin 2021-07-07 04:11:13 +09:00
commit f5965cc91e

View file

@ -13,6 +13,7 @@ import sys
class Config: class Config:
CC = 'g++' # Compiler to call CC = 'g++' # Compiler to call
APPS = ['app_name'] # Output binaries (need to be found as .cpp directly in SOURCE_DIR) 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) JOB_COUNT = int(os.cpu_count() * 0.8) # Concurent jobs (multi-processing)
BIN_DIR = Path('bin') # Output directory (binaries) BIN_DIR = Path('bin') # Output directory (binaries)
@ -65,6 +66,8 @@ def make(config: Config):
if config.PRE_COMPILE_FUNCTION is not None: if config.PRE_COMPILE_FUNCTION is not None:
config.PRE_COMPILE_FUNCTION() config.PRE_COMPILE_FUNCTION()
if 'IGNORE_APPS' in config.__dict__ :
config.IGNORE_APPS = []
# Update flags and directories for mode debug/release # Update flags and directories for mode debug/release
if arguments.type == 'debug': if arguments.type == 'debug':
@ -124,7 +127,8 @@ def make(config: Config):
todo_list.append((source_path, cmd)) todo_list.append((source_path, cmd))
continue 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) print(ConsoleColor.GREEN + 'Nothing to do' + ConsoleColor.ENDCOLOR)
return return
@ -181,7 +185,7 @@ def make(config: Config):
if arguments.j > 1: # Multi-process if arguments.j > 1: # Multi-process
jobs: list[tuple[Path, subprocess.Popen]] = [] jobs: list[tuple[Path, subprocess.Popen]] = []
for app_path, app_object_path in zip(config.APPS, all_app_objects): 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 continue
bin_path = config.BIN_DIR / app_path bin_path = config.BIN_DIR / app_path
if not bin_path.parent.exists(): 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())) error_paths.append((source_path, job.stdout.read() + job.stderr.read()))
else: # Single-process else: # Single-process
for app_path, app_object_path in zip(config.APPS, all_app_objects): 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 continue
bin_path = config.BIN_DIR / app_path bin_path = config.BIN_DIR / app_path
if not bin_path.parent.exists(): if not bin_path.parent.exists():