parameters: ()
return_statement: return vs_runtime_dll_dirs
docstring: Sets up os.environ to use the depot_tools VS toolchain with gyp, and
    returns the location of the VS runtime DLLs so they can be copied into
    the output directory after gyp generation.
docstring_summary: Sets up os.environ to use the depot_tools VS toolchain with gyp, and
    returns the location of the VS runtime DLLs so they can be copied into
    the output directory after gyp generation.
docstring_tokens: Sets up os . environ to use the depot_tools VS toolchain with gyp and returns the location of the VS runtime DLLs so they can be copied into the output directory after gyp generation .
function: def SetEnvironmentAndGetRuntimeDllDirs():
    """Sets up os.environ to use the depot_tools VS toolchain with gyp, and
    returns the location of the VS runtime DLLs so they can be copied into
    the output directory after gyp generation.
    """
    vs_runtime_dll_dirs = None
    depot_tools_win_toolchain = \
        bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1')))
    if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain:
      if not os.path.exists(json_data_file):
        Update()
      with open(json_data_file, 'r') as tempf:
        toolchain_data = json.load(tempf)
  
      toolchain = toolchain_data['path']
      version = toolchain_data['version']
      win_sdk = toolchain_data.get('win_sdk')
      if not win_sdk:
        win_sdk = toolchain_data['win8sdk']
      wdk = toolchain_data['wdk']
      # TODO(scottmg): The order unfortunately matters in these. They should be
      # split into separate keys for x86 and x64. (See CopyVsRuntimeDlls call
      # below). http://crbug.com/345992
      vs_runtime_dll_dirs = toolchain_data['runtime_dirs']
  
      os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain
      os.environ['GYP_MSVS_VERSION'] = version
      # We need to make sure windows_sdk_path is set to the automated
      # toolchain values in GYP_DEFINES, but don't want to override any
      # otheroptions.express
      # values there.
      gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES'))
      gyp_defines_dict['windows_sdk_path'] = win_sdk
      os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v)))
          for k, v in gyp_defines_dict.iteritems())
      os.environ['WINDOWSSDKDIR'] = win_sdk
      os.environ['WDK_DIR'] = wdk
      # Include the VS runtime in the PATH in case it's not machine-installed.
      runtime_path = ';'.join(vs_runtime_dll_dirs)
      os.environ['PATH'] = runtime_path + ';' + os.environ['PATH']
    return vs_runtime_dll_dirs
function_tokens: def SetEnvironmentAndGetRuntimeDllDirs ( ) : vs_runtime_dll_dirs = None depot_tools_win_toolchain = bool ( int ( os . environ . get ( 'DEPOT_TOOLS_WIN_TOOLCHAIN' , '1' ) ) ) if sys . platform in ( 'win32' , 'cygwin' ) and depot_tools_win_toolchain : if not os . path . exists ( json_data_file ) : Update ( ) with open ( json_data_file , 'r' ) as tempf : toolchain_data = json . load ( tempf ) toolchain = toolchain_data [ 'path' ] version = toolchain_data [ 'version' ] win_sdk = toolchain_data . get ( 'win_sdk' ) if not win_sdk : win_sdk = toolchain_data [ 'win8sdk' ] wdk = toolchain_data [ 'wdk' ] # TODO(scottmg): The order unfortunately matters in these. They should be # split into separate keys for x86 and x64. (See CopyVsRuntimeDlls call # below). http://crbug.com/345992 vs_runtime_dll_dirs = toolchain_data [ 'runtime_dirs' ] os . environ [ 'GYP_MSVS_OVERRIDE_PATH' ] = toolchain os . environ [ 'GYP_MSVS_VERSION' ] = version # We need to make sure windows_sdk_path is set to the automated # toolchain values in GYP_DEFINES, but don't want to override any # otheroptions.express # values there. gyp_defines_dict = gyp . NameValueListToDict ( gyp . ShlexEnv ( 'GYP_DEFINES' ) ) gyp_defines_dict [ 'windows_sdk_path' ] = win_sdk os . environ [ 'GYP_DEFINES' ] = ' ' . join ( '%s=%s' % ( k , pipes . quote ( str ( v ) ) ) for k , v in gyp_defines_dict . iteritems ( ) ) os . environ [ 'WINDOWSSDKDIR' ] = win_sdk os . environ [ 'WDK_DIR' ] = wdk # Include the VS runtime in the PATH in case it's not machine-installed. runtime_path = ';' . join ( vs_runtime_dll_dirs ) os . environ [ 'PATH' ] = runtime_path + ';' + os . environ [ 'PATH' ] return vs_runtime_dll_dirs