parameters: (target_list, target_dicts,
                               shared_intermediates_dir, config_name)
return_statement: return all_includes_list
docstring: Calculate the set of include directories to be used.
  
    Returns:
      A list including all the include_dir's specified for every target followed
      by any include directories that were added as cflag compiler options.
docstring_summary: Calculate the set of include directories to be used.
docstring_tokens: Calculate the set of include directories to be used .
function: def GetAllIncludeDirectories(target_list, target_dicts,
                               shared_intermediates_dir, config_name):
    """Calculate the set of include directories to be used.
  
    Returns:
      A list including all the include_dir's specified for every target followed
      by any include directories that were added as cflag compiler options.
    """
  
    gyp_includes_set = set()
    compiler_includes_list = []
  
    for target_name in target_list:
      target = target_dicts[target_name]
      if config_name in target['configurations']:
        config = target['configurations'][config_name]
  
        # Look for any include dirs that were explicitly added via cflags. This
        # may be done in gyp files to force certain includes to come at the end.
        # TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and
        # remove this.
        cflags = config['cflags']
        for cflag in cflags:
          include_dir = ''
          if cflag.startswith('-I'):
            include_dir = cflag[2:]
          if include_dir and not include_dir in compiler_includes_list:
            compiler_includes_list.append(include_dir)
  
        # Find standard gyp include dirs.
        if config.has_key('include_dirs'):
          include_dirs = config['include_dirs']
          for include_dir in include_dirs:
            include_dir = include_dir.replace('$SHARED_INTERMEDIATES_DIR',
                                              shared_intermediates_dir)
            if not os.path.isabs(include_dir):
              base_dir = os.path.dirname(target_name)
  
              include_dir = base_dir + '/' + include_dir
              include_dir = os.path.abspath(include_dir)
  
            if not include_dir in gyp_includes_set:
              gyp_includes_set.add(include_dir)
  
  
    # Generate a list that has all the include dirs.
    all_includes_list = list(gyp_includes_set)
    all_includes_list.sort()
    for compiler_include in compiler_includes_list:
      if not compiler_include in gyp_includes_set:
        all_includes_list.append(compiler_include)
  
    # All done.
    return all_includes_list
function_tokens: def GetAllIncludeDirectories ( target_list , target_dicts , shared_intermediates_dir , config_name ) : gyp_includes_set = set ( ) compiler_includes_list = [ ] for target_name in target_list : target = target_dicts [ target_name ] if config_name in target [ 'configurations' ] : config = target [ 'configurations' ] [ config_name ] # Look for any include dirs that were explicitly added via cflags. This # may be done in gyp files to force certain includes to come at the end. # TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and # remove this. cflags = config [ 'cflags' ] for cflag in cflags : include_dir = '' if cflag . startswith ( '-I' ) : include_dir = cflag [ 2 : ] if include_dir and not include_dir in compiler_includes_list : compiler_includes_list . append ( include_dir ) # Find standard gyp include dirs. if config . has_key ( 'include_dirs' ) : include_dirs = config [ 'include_dirs' ] for include_dir in include_dirs : include_dir = include_dir . replace ( '$SHARED_INTERMEDIATES_DIR' , shared_intermediates_dir ) if not os . path . isabs ( include_dir ) : base_dir = os . path . dirname ( target_name ) include_dir = base_dir + '/' + include_dir include_dir = os . path . abspath ( include_dir ) if not include_dir in gyp_includes_set : gyp_includes_set . add ( include_dir ) # Generate a list that has all the include dirs. all_includes_list = list ( gyp_includes_set ) all_includes_list . sort ( ) for compiler_include in compiler_includes_list : if not compiler_include in gyp_includes_set : all_includes_list . append ( compiler_include ) # All done. return all_includes_list