def get_linker(function):
    try:
        return linkers[function]
    except KeyError:
        logger.warning('could not find a linker with the function `{}`.\n'
                'The available linkers are:\n  {}\n'
                'New linkers can be added using `add-linker`',
                function, '\n  '.join(str(comp) for comp in compilers.values()))
示例#2
0
 def __init__(self, interface_file, *dependencies):
     _Target.__init__(self, interface_file, *dependencies)
     self.interface_file = interface_file
     if interface_file[-2:] != ".i":
         logger.warning(
             "{} should be initialized with an interface file as the first argument; expected it to end " "with `.i`"
         )
     self.args = []
     self.cpp = False
     self.target_language = None
示例#3
0
def load(config_dict):
    '''Loads the compilers from a dict, which was read from a YAML stream.'''
    from bs import compilers_and_linkers
    global instances
    if 'builders' not in config_dict:
        logger.warning('No builders defined in configuration.\n{}', Add.help)
    else:
        for builder_function, builder_params in config_dict['builders'].items():
            builder = Builder(builder_function)
            
            builder.compiler = compilers_and_linkers.get_compiler(builder_params.get('compiler.function',
                builder_function))
            builder.linker = compilers_and_linkers.get_linker(builder_params.get('linker.function', builder_function))
def load(config_dict):
    '''Loads the compilers from a dict, which was read from a YAML stream.'''
    global instances
    if 'compilers' not in config_dict:
        logger.warning('No compilers defined in configuration.')
    else:
        comps = config_dict['compilers']
        for comp_name, comp_params in comps.items():
            compiler = Compiler(comp_params['function'], comp_params['command'])
            compiler.__dict__.update(comp_params)
    if 'linkers' not in config_dict:
        logger.warning('No linkers defined in configuration.')
    else:
        comps = config_dict['linkers']
        for comp_name, comp_params in comps.items():
            linker = Linker(comp_params['function'], comp_params['command'])
            linker.__dict__.update(comp_params)