parameters: (plugins, config)
docstring: Collects and prints the required build info from the given plugins.
docstring_summary: Collects and prints the required build info from the given plugins.
docstring_tokens: Collects and prints the required build info from the given plugins .
function: def _PrintBuildInfo(plugins, config):
    """Collects and prints the required build info from the given plugins."""
    libs = []
    sources = []
    include_dirs = []
    ldflags = []
    copy_files = []
  
    def Expand(path, base):
      return os.path.normpath(os.path.join(base, path % config))
    def Update(lst, path, base):
      # Append to the list if it doesn't already exist.  This supports the path
      # being a format string to create dynamic paths.
      path = Expand(path, base)
      if path not in lst:
        lst.append(path)
  
    for plugin in plugins:
      base = os.path.abspath(os.path.dirname(plugin['path']))
      for lib in plugin.get('libraries', []):
        path = Expand(lib, base)
        if lib.endswith('.framework'):
          ldflags += [
              '-F' + os.path.dirname(path),
              '-framework', os.path.basename(path).replace('.framework', ''),
          ]
          copy_files.append(path)
        else:
          if os.path.splitext(lib)[1] in {'.dll', '.dylib', '.so'}:
            copy_files.append(path)
          Update(libs, lib, base)
  
      for impl in plugin['implementations']:
        for src in impl.get('sources', []):
          Update(sources, src, base)
        for d in impl.get('include_dirs', []):
          Update(include_dirs, d, base)
  
    def PrintList(name, lst):
      body = ','.join('"%s"' % l for l in lst)
      print('%s = [ %s ]' % (name, body))
    PrintList('libs', libs)
    PrintList('sources', sources)
    PrintList('include_dirs', include_dirs)
    PrintList('ldflags', ldflags)
    PrintList('copy_files', copy_files)
function_tokens: def _PrintBuildInfo ( plugins , config ) : libs = [ ] sources = [ ] include_dirs = [ ] ldflags = [ ] copy_files = [ ] def Expand ( path , base ) : return os . path . normpath ( os . path . join ( base , path % config ) ) def Update ( lst , path , base ) : # Append to the list if it doesn't already exist.  This supports the path # being a format string to create dynamic paths. path = Expand ( path , base ) if path not in lst : lst . append ( path ) for plugin in plugins : base = os . path . abspath ( os . path . dirname ( plugin [ 'path' ] ) ) for lib in plugin . get ( 'libraries' , [ ] ) : path = Expand ( lib , base ) if lib . endswith ( '.framework' ) : ldflags += [ '-F' + os . path . dirname ( path ) , '-framework' , os . path . basename ( path ) . replace ( '.framework' , '' ) , ] copy_files . append ( path ) else : if os . path . splitext ( lib ) [ 1 ] in { '.dll' , '.dylib' , '.so' } : copy_files . append ( path ) Update ( libs , lib , base ) for impl in plugin [ 'implementations' ] : for src in impl . get ( 'sources' , [ ] ) : Update ( sources , src , base ) for d in impl . get ( 'include_dirs' , [ ] ) : Update ( include_dirs , d , base ) def PrintList ( name , lst ) : body = ',' . join ( '"%s"' % l for l in lst ) print ( '%s = [ %s ]' % ( name , body ) ) PrintList ( 'libs' , libs ) PrintList ( 'sources' , sources ) PrintList ( 'include_dirs' , include_dirs ) PrintList ( 'ldflags' , ldflags ) PrintList ( 'copy_files' , copy_files )