parameters: (project, options, version, generator_flags)
return_statement: return missing_sources
docstring: Generates a .vcproj file.  It may create .rules and .user files too.
  
    Arguments:
      project: The project object we will generate the file for.
      options: Global options passed to the generator.
      version: The VisualStudioVersion object.
      generator_flags: dict of generator-specific flags.
docstring_summary: Generates a .vcproj file.  It may create .rules and .user files too.
docstring_tokens: Generates a . vcproj file . It may create . rules and . user files too .
function: def _GenerateMSVSProject(project, options, version, generator_flags):
      """Generates a .vcproj file.  It may create .rules and .user files too.
  
    Arguments:
      project: The project object we will generate the file for.
      options: Global options passed to the generator.
      version: The VisualStudioVersion object.
      generator_flags: dict of generator-specific flags.
    """
      spec = project.spec
      gyp.common.EnsureDirExists(project.path)
  
      platforms = _GetUniquePlatforms(spec)
      p = MSVSProject.Writer(
          project.path, version, spec["target_name"], project.guid, platforms
      )
  
      # Get directory project file is in.
      project_dir = os.path.split(project.path)[0]
      gyp_path = _NormalizedSource(project.build_file)
      relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir)
  
      config_type = _GetMSVSConfigurationType(spec, project.build_file)
      for config_name, config in spec["configurations"].items():
          _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config)
  
      # Prepare list of sources and excluded sources.
      gyp_file = os.path.split(project.build_file)[1]
      sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file)
  
      # Add rules.
      actions_to_add = {}
      _GenerateRulesForMSVS(
          p, project_dir, options, spec, sources, excluded_sources, actions_to_add
      )
      list_excluded = generator_flags.get("msvs_list_excluded_files", True)
      sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy(
          spec, options, project_dir, sources, excluded_sources, list_excluded, version
      )
  
      # Add in files.
      missing_sources = _VerifySourcesExist(sources, project_dir)
      p.AddFiles(sources)
  
      _AddToolFilesToMSVS(p, spec)
      _HandlePreCompiledHeaders(p, sources, spec)
      _AddActions(actions_to_add, spec, relative_path_of_gyp_file)
      _AddCopies(actions_to_add, spec)
      _WriteMSVSUserFile(project.path, version, spec)
  
      # NOTE: this stanza must appear after all actions have been decided.
      # Don't excluded sources with actions attached, or they won't run.
      excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add)
      _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded)
      _AddAccumulatedActionsToMSVS(p, spec, actions_to_add)
  
      # Write it out.
      p.WriteIfChanged()
  
      return missing_sources
function_tokens: def _GenerateMSVSProject ( project , options , version , generator_flags ) : spec = project . spec gyp . common . EnsureDirExists ( project . path ) platforms = _GetUniquePlatforms ( spec ) p = MSVSProject . Writer ( project . path , version , spec [ "target_name" ] , project . guid , platforms ) # Get directory project file is in. project_dir = os . path . split ( project . path ) [ 0 ] gyp_path = _NormalizedSource ( project . build_file ) relative_path_of_gyp_file = gyp . common . RelativePath ( gyp_path , project_dir ) config_type = _GetMSVSConfigurationType ( spec , project . build_file ) for config_name , config in spec [ "configurations" ] . items ( ) : _AddConfigurationToMSVSProject ( p , spec , config_type , config_name , config ) # Prepare list of sources and excluded sources. gyp_file = os . path . split ( project . build_file ) [ 1 ] sources , excluded_sources = _PrepareListOfSources ( spec , generator_flags , gyp_file ) # Add rules. actions_to_add = { } _GenerateRulesForMSVS ( p , project_dir , options , spec , sources , excluded_sources , actions_to_add ) list_excluded = generator_flags . get ( "msvs_list_excluded_files" , True ) sources , excluded_sources , excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy ( spec , options , project_dir , sources , excluded_sources , list_excluded , version ) # Add in files. missing_sources = _VerifySourcesExist ( sources , project_dir ) p . AddFiles ( sources ) _AddToolFilesToMSVS ( p , spec ) _HandlePreCompiledHeaders ( p , sources , spec ) _AddActions ( actions_to_add , spec , relative_path_of_gyp_file ) _AddCopies ( actions_to_add , spec ) _WriteMSVSUserFile ( project . path , version , spec ) # NOTE: this stanza must appear after all actions have been decided. # Don't excluded sources with actions attached, or they won't run. excluded_sources = _FilterActionsFromExcluded ( excluded_sources , actions_to_add ) _ExcludeFilesFromBeingBuilt ( p , spec , excluded_sources , excluded_idl , list_excluded ) _AddAccumulatedActionsToMSVS ( p , spec , actions_to_add ) # Write it out. p . WriteIfChanged ( ) return missing_sources