parameters: (p, spec, config_type, config_name, config)
docstring: Adds a configuration to the MSVS project.
  
    Many settings in a vcproj file are specific to a configuration.  This
    function the main part of the vcproj file that's configuration specific.
  
    Arguments:
      p: The target project being generated.
      spec: The target dictionary containing the properties of the target.
      config_type: The configuration type, a number as defined by Microsoft.
      config_name: The name of the configuration.
      config: The dictionary that defines the special processing to be done
              for this configuration.
docstring_summary: Adds a configuration to the MSVS project.
docstring_tokens: Adds a configuration to the MSVS project .
function: def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config):
    """Adds a configuration to the MSVS project.
  
    Many settings in a vcproj file are specific to a configuration.  This
    function the main part of the vcproj file that's configuration specific.
  
    Arguments:
      p: The target project being generated.
      spec: The target dictionary containing the properties of the target.
      config_type: The configuration type, a number as defined by Microsoft.
      config_name: The name of the configuration.
      config: The dictionary that defines the special processing to be done
              for this configuration.
    """
    # Get the information for this configuration
    include_dirs, midl_include_dirs, resource_include_dirs = \
        _GetIncludeDirs(config)
    libraries = _GetLibraries(spec)
    library_dirs = _GetLibraryDirs(config)
    out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False)
    defines = _GetDefines(config)
    defines = [_EscapeCppDefineForMSVS(d) for d in defines]
    disabled_warnings = _GetDisabledWarnings(config)
    prebuild = config.get('msvs_prebuild')
    postbuild = config.get('msvs_postbuild')
    def_file = _GetModuleDefinition(spec)
    precompiled_header = config.get('msvs_precompiled_header')
  
    # Prepare the list of tools as a dictionary.
    tools = dict()
    # Add in user specified msvs_settings.
    msvs_settings = config.get('msvs_settings', {})
    MSVSSettings.ValidateMSVSSettings(msvs_settings)
  
    # Prevent default library inheritance from the environment.
    _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', ['$(NOINHERIT)'])
  
    for tool in msvs_settings:
      settings = config['msvs_settings'][tool]
      for setting in settings:
        _ToolAppend(tools, tool, setting, settings[setting])
    # Add the information to the appropriate tool
    _ToolAppend(tools, 'VCCLCompilerTool',
                'AdditionalIncludeDirectories', include_dirs)
    _ToolAppend(tools, 'VCMIDLTool',
                'AdditionalIncludeDirectories', midl_include_dirs)
    _ToolAppend(tools, 'VCResourceCompilerTool',
                'AdditionalIncludeDirectories', resource_include_dirs)
    # Add in libraries.
    _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', libraries)
    _ToolAppend(tools, 'VCLinkerTool', 'AdditionalLibraryDirectories',
                library_dirs)
    if out_file:
      _ToolAppend(tools, vc_tool, 'OutputFile', out_file, only_if_unset=True)
    # Add defines.
    _ToolAppend(tools, 'VCCLCompilerTool', 'PreprocessorDefinitions', defines)
    _ToolAppend(tools, 'VCResourceCompilerTool', 'PreprocessorDefinitions',
                defines)
    # Change program database directory to prevent collisions.
    _ToolAppend(tools, 'VCCLCompilerTool', 'ProgramDataBaseFileName',
                '$(IntDir)$(ProjectName)\\vc80.pdb', only_if_unset=True)
    # Add disabled warnings.
    _ToolAppend(tools, 'VCCLCompilerTool',
                'DisableSpecificWarnings', disabled_warnings)
    # Add Pre-build.
    _ToolAppend(tools, 'VCPreBuildEventTool', 'CommandLine', prebuild)
    # Add Post-build.
    _ToolAppend(tools, 'VCPostBuildEventTool', 'CommandLine', postbuild)
    # Turn on precompiled headers if appropriate.
    if precompiled_header:
      precompiled_header = os.path.split(precompiled_header)[1]
      _ToolAppend(tools, 'VCCLCompilerTool', 'UsePrecompiledHeader', '2')
      _ToolAppend(tools, 'VCCLCompilerTool',
                  'PrecompiledHeaderThrough', precompiled_header)
      _ToolAppend(tools, 'VCCLCompilerTool',
                  'ForcedIncludeFiles', precompiled_header)
    # Loadable modules don't generate import libraries;
    # tell dependent projects to not expect one.
    if spec['type'] == 'loadable_module':
      _ToolAppend(tools, 'VCLinkerTool', 'IgnoreImportLibrary', 'true')
    # Set the module definition file if any.
    if def_file:
      _ToolAppend(tools, 'VCLinkerTool', 'ModuleDefinitionFile', def_file)
  
    _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name)
function_tokens: def _AddConfigurationToMSVSProject ( p , spec , config_type , config_name , config ) : # Get the information for this configuration include_dirs , midl_include_dirs , resource_include_dirs = _GetIncludeDirs ( config ) libraries = _GetLibraries ( spec ) library_dirs = _GetLibraryDirs ( config ) out_file , vc_tool , _ = _GetOutputFilePathAndTool ( spec , msbuild = False ) defines = _GetDefines ( config ) defines = [ _EscapeCppDefineForMSVS ( d ) for d in defines ] disabled_warnings = _GetDisabledWarnings ( config ) prebuild = config . get ( 'msvs_prebuild' ) postbuild = config . get ( 'msvs_postbuild' ) def_file = _GetModuleDefinition ( spec ) precompiled_header = config . get ( 'msvs_precompiled_header' ) # Prepare the list of tools as a dictionary. tools = dict ( ) # Add in user specified msvs_settings. msvs_settings = config . get ( 'msvs_settings' , { } ) MSVSSettings . ValidateMSVSSettings ( msvs_settings ) # Prevent default library inheritance from the environment. _ToolAppend ( tools , 'VCLinkerTool' , 'AdditionalDependencies' , [ '$(NOINHERIT)' ] ) for tool in msvs_settings : settings = config [ 'msvs_settings' ] [ tool ] for setting in settings : _ToolAppend ( tools , tool , setting , settings [ setting ] ) # Add the information to the appropriate tool _ToolAppend ( tools , 'VCCLCompilerTool' , 'AdditionalIncludeDirectories' , include_dirs ) _ToolAppend ( tools , 'VCMIDLTool' , 'AdditionalIncludeDirectories' , midl_include_dirs ) _ToolAppend ( tools , 'VCResourceCompilerTool' , 'AdditionalIncludeDirectories' , resource_include_dirs ) # Add in libraries. _ToolAppend ( tools , 'VCLinkerTool' , 'AdditionalDependencies' , libraries ) _ToolAppend ( tools , 'VCLinkerTool' , 'AdditionalLibraryDirectories' , library_dirs ) if out_file : _ToolAppend ( tools , vc_tool , 'OutputFile' , out_file , only_if_unset = True ) # Add defines. _ToolAppend ( tools , 'VCCLCompilerTool' , 'PreprocessorDefinitions' , defines ) _ToolAppend ( tools , 'VCResourceCompilerTool' , 'PreprocessorDefinitions' , defines ) # Change program database directory to prevent collisions. _ToolAppend ( tools , 'VCCLCompilerTool' , 'ProgramDataBaseFileName' , '$(IntDir)$(ProjectName)\\vc80.pdb' , only_if_unset = True ) # Add disabled warnings. _ToolAppend ( tools , 'VCCLCompilerTool' , 'DisableSpecificWarnings' , disabled_warnings ) # Add Pre-build. _ToolAppend ( tools , 'VCPreBuildEventTool' , 'CommandLine' , prebuild ) # Add Post-build. _ToolAppend ( tools , 'VCPostBuildEventTool' , 'CommandLine' , postbuild ) # Turn on precompiled headers if appropriate. if precompiled_header : precompiled_header = os . path . split ( precompiled_header ) [ 1 ] _ToolAppend ( tools , 'VCCLCompilerTool' , 'UsePrecompiledHeader' , '2' ) _ToolAppend ( tools , 'VCCLCompilerTool' , 'PrecompiledHeaderThrough' , precompiled_header ) _ToolAppend ( tools , 'VCCLCompilerTool' , 'ForcedIncludeFiles' , precompiled_header ) # Loadable modules don't generate import libraries; # tell dependent projects to not expect one. if spec [ 'type' ] == 'loadable_module' : _ToolAppend ( tools , 'VCLinkerTool' , 'IgnoreImportLibrary' , 'true' ) # Set the module definition file if any. if def_file : _ToolAppend ( tools , 'VCLinkerTool' , 'ModuleDefinitionFile' , def_file ) _AddConfigurationToMSVS ( p , spec , tools , config , config_type , config_name )