parameters: (target_dir, source_dir, target_cpu, debug)
docstring: Copy the VS runtime DLLs, only if the target doesn't exist, but the target
    directory does exist. Handles VS 2013 and VS 2015.
docstring_summary: Copy the VS runtime DLLs, only if the target doesn't exist, but the target
    directory does exist. Handles VS 2013 and VS 2015.
docstring_tokens: Copy the VS runtime DLLs only if the target doesn t exist but the target directory does exist . Handles VS 2013 and VS 2015 .
function: def _CopyRuntime(target_dir, source_dir, target_cpu, debug):
    """Copy the VS runtime DLLs, only if the target doesn't exist, but the target
    directory does exist. Handles VS 2013 and VS 2015."""
    suffix = "d.dll" if debug else ".dll"
    if GetVisualStudioVersion() == '2015':
      _CopyRuntime2015(target_dir, source_dir, '%s140' + suffix, suffix)
    else:
      _CopyRuntime2013(target_dir, source_dir, 'msvc%s120' + suffix)
  
    # Copy the PGO runtime library to the release directories.
    if not debug and os.environ.get('GYP_MSVS_OVERRIDE_PATH'):
      pgo_x86_runtime_dir = os.path.join(os.environ.get('GYP_MSVS_OVERRIDE_PATH'),
                                          'VC', 'bin')
      pgo_x64_runtime_dir = os.path.join(pgo_x86_runtime_dir, 'amd64')
      pgo_runtime_dll = 'pgort' + _VersionNumber() + '.dll'
      if target_cpu == "x86":
        source_x86 = os.path.join(pgo_x86_runtime_dir, pgo_runtime_dll)
        if os.path.exists(source_x86):
          _CopyRuntimeImpl(os.path.join(target_dir, pgo_runtime_dll), source_x86)
      elif target_cpu == "x64":
        source_x64 = os.path.join(pgo_x64_runtime_dir, pgo_runtime_dll)
        if os.path.exists(source_x64):
          _CopyRuntimeImpl(os.path.join(target_dir, pgo_runtime_dll),
                            source_x64)
      else:
        raise NotImplementedError("Unexpected target_cpu value:" + target_cpu)
function_tokens: def _CopyRuntime ( target_dir , source_dir , target_cpu , debug ) : suffix = "d.dll" if debug else ".dll" if GetVisualStudioVersion ( ) == '2015' : _CopyRuntime2015 ( target_dir , source_dir , '%s140' + suffix , suffix ) else : _CopyRuntime2013 ( target_dir , source_dir , 'msvc%s120' + suffix ) # Copy the PGO runtime library to the release directories. if not debug and os . environ . get ( 'GYP_MSVS_OVERRIDE_PATH' ) : pgo_x86_runtime_dir = os . path . join ( os . environ . get ( 'GYP_MSVS_OVERRIDE_PATH' ) , 'VC' , 'bin' ) pgo_x64_runtime_dir = os . path . join ( pgo_x86_runtime_dir , 'amd64' ) pgo_runtime_dll = 'pgort' + _VersionNumber ( ) + '.dll' if target_cpu == "x86" : source_x86 = os . path . join ( pgo_x86_runtime_dir , pgo_runtime_dll ) if os . path . exists ( source_x86 ) : _CopyRuntimeImpl ( os . path . join ( target_dir , pgo_runtime_dll ) , source_x86 ) elif target_cpu == "x64" : source_x64 = os . path . join ( pgo_x64_runtime_dir , pgo_runtime_dll ) if os . path . exists ( source_x64 ) : _CopyRuntimeImpl ( os . path . join ( target_dir , pgo_runtime_dll ) , source_x64 ) else : raise NotImplementedError ( "Unexpected target_cpu value:" + target_cpu )