diff --git a/external/scons-plus-plus/SConscript b/external/scons-plus-plus/SConscript index 7efb974..2faeb4f 100644 --- a/external/scons-plus-plus/SConscript +++ b/external/scons-plus-plus/SConscript @@ -36,12 +36,12 @@ def _main() -> Environment: spp_repository = config.get('SPP_REPOSITORY', _SPP_DEFAULT_REPOSITORY) spp_branch = config.get('SPP_BRANCH', _SPP_DEFAULT_BRANCH) - print(f'Using SCons++ root at: {spp_root}') + _printinfo(f'Using SCons++ root at: {spp_root}') if not spp_root.exists(): - print('SCons++ does not yet exist, downloading it.') + _printinfo('SCons++ does not yet exist, downloading it.') _install_spp() - + spp_script = spp_root / 'SConscript' if not spp_script.exists(): _printerr(f'SCons++ main script not found at {spp_script}!') @@ -60,7 +60,7 @@ def _get_default_spp_root() -> Path: elif os.name == 'nt': # just use LocalAppData, which should always be set on Windows return Path(os.environ['LocalAppData'], _SPP_FOLDER_NAME) - print(f'Could not detect SCons++ root directory, falling back to ./{_SPP_FOLDER_NAME}.') + _printinfo(f'Could not detect SCons++ root directory, falling back to ./{_SPP_FOLDER_NAME}.') return Path(_SPP_FOLDER_NAME) def _install_spp() -> None: @@ -73,6 +73,10 @@ def _install_spp() -> None: def _exec_checked(args: Sequence[str], **kwargs) -> None: subprocess.run(args, stdout=sys.stdout, stderr=sys.stderr, check=True, **kwargs) +if not GetOption('silent'): + _printinfo = print +else: + def _printinfo(*args): ... def _printerr(*args) -> None: print(*args, file=sys.stderr)