def __iter__(self): """Yield one InstalledCompiler for each role filled by any compiler in this installation.""" for role in CompilerRole.all(): try: yield self.preferred(role) except KeyError: pass
def compilers(self): """Get information about the compilers used by this target configuration. Returns: InstalledCompilerSet: Collection of installed compilers used by this target. """ eids = [] compilers = {} for role in CompilerRole.all(): try: compiler_command = self.populate(attribute=role.keyword) except KeyError: continue compilers[role.keyword] = compiler_command.info() eids.append(compiler_command.eid) missing = [role.keyword for role in CompilerRole.tau_required() if role.keyword not in compilers] if missing: raise InternalError("Target '%s' is missing required compilers: %s" % (self["name"], missing)) return InstalledCompilerSet("_".join([str(x) for x in eids]), **compilers)