def _sort_targets(targets: "typing.List[str]", add_dependencies=False, skip_sdk=False) -> "typing.List[str]": targetManager.reset() # print(real_targets) config = get_global_config() real_targets = list(targetManager.get_target(t, None, config) for t in targets) config.includeDependencies = add_dependencies config.skipSdk = skip_sdk for t in real_targets: t.get_dependencies(config) # ensure they have been cached result = list(t.name for t in targetManager.get_all_targets(real_targets, config)) # print("result = ", result) return result
def _parse_arguments(args, *, config_file=Path("/this/does/not/exist")) -> DefaultCheriConfig: global _targets_registered # noinspection PyGlobalUndefined global _cheriConfig if not _targets_registered: allTargetNames = list(sorted(targetManager.targetNames)) + ["__run_everything__"] ConfigLoaderBase._cheriConfig = DefaultCheriConfig(_loader, allTargetNames) SimpleProject._configLoader = _loader targetManager.registerCommandLineOptions() _targets_registered = True targetManager.reset() ConfigLoaderBase._cheriConfig.loader._configPath = config_file sys.argv = ["cheribuild.py"] + args ConfigLoaderBase._cheriConfig.loader.reload() ConfigLoaderBase._cheriConfig.load() # pprint.pprint(vars(ret)) assert ConfigLoaderBase._cheriConfig return ConfigLoaderBase._cheriConfig
def _sort_targets(targets: "typing.List[str]", add_dependencies=False, skip_sdk=False) -> "typing.List[str]": targetManager.reset() # print(real_targets) config = get_global_config() real_targets = list( targetManager.get_target( t, CompilationTargets.NONE, config, caller="_sort_targets") for t in targets) config.includeDependencies = add_dependencies config.skipSdk = skip_sdk for t in real_targets: if t._project_class._crossCompileTarget is CompilationTargets.NONE: continue t.projectClass._cached_deps = None t.get_dependencies(config) # ensure they have been cached result = list(t.name for t in targetManager.get_all_targets(real_targets, config)) # print("result = ", result) return result