parameters: (target_list, target_dicts, vars)
return_statement: return (target_list, target_dicts)
docstring: Insert a shim target that forces the linker to use 4KB pagesize PDBs.
  
    This is a workaround for targets with PDBs greater than 1GB in size, the
    limit for the 1KB pagesize PDBs created by the linker by default.
  
    Arguments:
      target_list: List of target pairs: 'base/base.gyp:base'.
      target_dicts: Dict of target properties keyed on target pair.
      vars: A dictionary of common GYP variables with generator-specific values.
    Returns:
      Tuple of the shimmed version of the inputs.
docstring_summary: Insert a shim target that forces the linker to use 4KB pagesize PDBs.
docstring_tokens: Insert a shim target that forces the linker to use 4KB pagesize PDBs .
function: def InsertLargePdbShims(target_list, target_dicts, vars):
    """Insert a shim target that forces the linker to use 4KB pagesize PDBs.
  
    This is a workaround for targets with PDBs greater than 1GB in size, the
    limit for the 1KB pagesize PDBs created by the linker by default.
  
    Arguments:
      target_list: List of target pairs: 'base/base.gyp:base'.
      target_dicts: Dict of target properties keyed on target pair.
      vars: A dictionary of common GYP variables with generator-specific values.
    Returns:
      Tuple of the shimmed version of the inputs.
    """
    # Determine which targets need shimming.
    targets_to_shim = []
    for t in target_dicts:
      target_dict = target_dicts[t]
  
      # We only want to shim targets that have msvs_large_pdb enabled.
      if not int(target_dict.get('msvs_large_pdb', 0)):
        continue
      # This is intended for executable, shared_library and loadable_module
      # targets where every configuration is set up to produce a PDB output.
      # If any of these conditions is not true then the shim logic will fail
      # below.
      targets_to_shim.append(t)
  
    large_pdb_shim_cc = _GetLargePdbShimCcPath()
  
    for t in targets_to_shim:
      target_dict = target_dicts[t]
      target_name = target_dict.get('target_name')
  
      base_dict = _DeepCopySomeKeys(target_dict,
            ['configurations', 'default_configuration', 'toolset'])
  
      # This is the dict for copying the source file (part of the GYP tree)
      # to the intermediate directory of the project. This is necessary because
      # we can't always build a relative path to the shim source file (on Windows
      # GYP and the project may be on different drives), and Ninja hates absolute
      # paths (it ends up generating the .obj and .obj.d alongside the source
      # file, polluting GYPs tree).
      copy_suffix = 'large_pdb_copy'
      copy_target_name = target_name + '_' + copy_suffix
      full_copy_target_name = _SuffixName(t, copy_suffix)
      shim_cc_basename = os.path.basename(large_pdb_shim_cc)
      shim_cc_dir = vars['SHARED_INTERMEDIATE_DIR'] + '/' + copy_target_name
      shim_cc_path = shim_cc_dir + '/' + shim_cc_basename
      copy_dict = copy.deepcopy(base_dict)
      copy_dict['target_name'] = copy_target_name
      copy_dict['type'] = 'none'
      copy_dict['sources'] = [ large_pdb_shim_cc ]
      copy_dict['copies'] = [{
        'destination': shim_cc_dir,
        'files': [ large_pdb_shim_cc ]
      }]
  
      # This is the dict for the PDB generating shim target. It depends on the
      # copy target.
      shim_suffix = 'large_pdb_shim'
      shim_target_name = target_name + '_' + shim_suffix
      full_shim_target_name = _SuffixName(t, shim_suffix)
      shim_dict = copy.deepcopy(base_dict)
      shim_dict['target_name'] = shim_target_name
      shim_dict['type'] = 'static_library'
      shim_dict['sources'] = [ shim_cc_path ]
      shim_dict['dependencies'] = [ full_copy_target_name ]
  
      # Set up the shim to output its PDB to the same location as the final linker
      # target.
      for config_name, config in shim_dict.get('configurations').iteritems():
        pdb_path = _GetPdbPath(target_dict, config_name, vars)
  
        # A few keys that we don't want to propagate.
        for key in ['msvs_precompiled_header', 'msvs_precompiled_source', 'test']:
          config.pop(key, None)
  
        msvs = config.setdefault('msvs_settings', {})
  
        # Update the compiler directives in the shim target.
        compiler = msvs.setdefault('VCCLCompilerTool', {})
        compiler['DebugInformationFormat'] = '3'
        compiler['ProgramDataBaseFileName'] = pdb_path
  
        # Set the explicit PDB path in the appropriate configuration of the
        # original target.
        config = target_dict['configurations'][config_name]
        msvs = config.setdefault('msvs_settings', {})
        linker = msvs.setdefault('VCLinkerTool', {})
        linker['GenerateDebugInformation'] = 'true'
        linker['ProgramDatabaseFile'] = pdb_path
  
      # Add the new targets. They must go to the beginning of the list so that
      # the dependency generation works as expected in ninja.
      target_list.insert(0, full_copy_target_name)
      target_list.insert(0, full_shim_target_name)
      target_dicts[full_copy_target_name] = copy_dict
      target_dicts[full_shim_target_name] = shim_dict
  
      # Update the original target to depend on the shim target.
      target_dict.setdefault('dependencies', []).append(full_shim_target_name)
  
    return (target_list, target_dicts)
function_tokens: def InsertLargePdbShims ( target_list , target_dicts , vars ) : # Determine which targets need shimming. targets_to_shim = [ ] for t in target_dicts : target_dict = target_dicts [ t ] # We only want to shim targets that have msvs_large_pdb enabled. if not int ( target_dict . get ( 'msvs_large_pdb' , 0 ) ) : continue # This is intended for executable, shared_library and loadable_module # targets where every configuration is set up to produce a PDB output. # If any of these conditions is not true then the shim logic will fail # below. targets_to_shim . append ( t ) large_pdb_shim_cc = _GetLargePdbShimCcPath ( ) for t in targets_to_shim : target_dict = target_dicts [ t ] target_name = target_dict . get ( 'target_name' ) base_dict = _DeepCopySomeKeys ( target_dict , [ 'configurations' , 'default_configuration' , 'toolset' ] ) # This is the dict for copying the source file (part of the GYP tree) # to the intermediate directory of the project. This is necessary because # we can't always build a relative path to the shim source file (on Windows # GYP and the project may be on different drives), and Ninja hates absolute # paths (it ends up generating the .obj and .obj.d alongside the source # file, polluting GYPs tree). copy_suffix = 'large_pdb_copy' copy_target_name = target_name + '_' + copy_suffix full_copy_target_name = _SuffixName ( t , copy_suffix ) shim_cc_basename = os . path . basename ( large_pdb_shim_cc ) shim_cc_dir = vars [ 'SHARED_INTERMEDIATE_DIR' ] + '/' + copy_target_name shim_cc_path = shim_cc_dir + '/' + shim_cc_basename copy_dict = copy . deepcopy ( base_dict ) copy_dict [ 'target_name' ] = copy_target_name copy_dict [ 'type' ] = 'none' copy_dict [ 'sources' ] = [ large_pdb_shim_cc ] copy_dict [ 'copies' ] = [ { 'destination' : shim_cc_dir , 'files' : [ large_pdb_shim_cc ] } ] # This is the dict for the PDB generating shim target. It depends on the # copy target. shim_suffix = 'large_pdb_shim' shim_target_name = target_name + '_' + shim_suffix full_shim_target_name = _SuffixName ( t , shim_suffix ) shim_dict = copy . deepcopy ( base_dict ) shim_dict [ 'target_name' ] = shim_target_name shim_dict [ 'type' ] = 'static_library' shim_dict [ 'sources' ] = [ shim_cc_path ] shim_dict [ 'dependencies' ] = [ full_copy_target_name ] # Set up the shim to output its PDB to the same location as the final linker # target. for config_name , config in shim_dict . get ( 'configurations' ) . iteritems ( ) : pdb_path = _GetPdbPath ( target_dict , config_name , vars ) # A few keys that we don't want to propagate. for key in [ 'msvs_precompiled_header' , 'msvs_precompiled_source' , 'test' ] : config . pop ( key , None ) msvs = config . setdefault ( 'msvs_settings' , { } ) # Update the compiler directives in the shim target. compiler = msvs . setdefault ( 'VCCLCompilerTool' , { } ) compiler [ 'DebugInformationFormat' ] = '3' compiler [ 'ProgramDataBaseFileName' ] = pdb_path # Set the explicit PDB path in the appropriate configuration of the # original target. config = target_dict [ 'configurations' ] [ config_name ] msvs = config . setdefault ( 'msvs_settings' , { } ) linker = msvs . setdefault ( 'VCLinkerTool' , { } ) linker [ 'GenerateDebugInformation' ] = 'true' linker [ 'ProgramDatabaseFile' ] = pdb_path # Add the new targets. They must go to the beginning of the list so that # the dependency generation works as expected in ninja. target_list . insert ( 0 , full_copy_target_name ) target_list . insert ( 0 , full_shim_target_name ) target_dicts [ full_copy_target_name ] = copy_dict target_dicts [ full_shim_target_name ] = shim_dict # Update the original target to depend on the shim target. target_dict . setdefault ( 'dependencies' , [ ] ) . append ( full_shim_target_name ) return ( target_list , target_dicts )