parameters: (opts)
docstring: Apply post-processes for Windows binaries.
  
    Update the specified executable to be 'release quality' by
    - bind import functions by bind.exe
    - Set 'freeze' bit in the PE header.
    - Code signing.
    See the following issues for details.
      http://b/1504561, http://b/1507272, http://b/2289857, http://b/1893852
  
    Args:
      opts: build options to be used to update the executable.
docstring_summary: Apply post-processes for Windows binaries.
docstring_tokens: Apply post - processes for Windows binaries .
function: def PostProcessOnWindows(opts):
    """Apply post-processes for Windows binaries.
  
    Update the specified executable to be 'release quality' by
    - bind import functions by bind.exe
    - Set 'freeze' bit in the PE header.
    - Code signing.
    See the following issues for details.
      http://b/1504561, http://b/1507272, http://b/2289857, http://b/1893852
  
    Args:
      opts: build options to be used to update the executable.
    """
    abs_target_path = os.path.abspath(opts.targetpath)
    abs_touch_file_path = abs_target_path + '.postbuild'
  
    # If the target looks like a PE image, update it.
    (_, extension) = os.path.splitext(opts.targetpath)
    if extension.lower() in ['.exe', '.dll', '.ime']:
      # Protect it against further binding, which invalidates code signing.
      RunOrDie(['editbin.exe', '/ALLOWBIND:NO', '/RELEASE', abs_target_path])
  
    Codesign(abs_target_path)
  
    # Touch the timestamp file.
    if os.path.exists(abs_touch_file_path):
      os.utime(abs_touch_file_path, None)
    else:
      open(abs_touch_file_path, 'w').close()
function_tokens: def PostProcessOnWindows ( opts ) : abs_target_path = os . path . abspath ( opts . targetpath ) abs_touch_file_path = abs_target_path + '.postbuild' # If the target looks like a PE image, update it. ( _ , extension ) = os . path . splitext ( opts . targetpath ) if extension . lower ( ) in [ '.exe' , '.dll' , '.ime' ] : # Protect it against further binding, which invalidates code signing. RunOrDie ( [ 'editbin.exe' , '/ALLOWBIND:NO' , '/RELEASE' , abs_target_path ] ) Codesign ( abs_target_path ) # Touch the timestamp file. if os . path . exists ( abs_touch_file_path ) : os . utime ( abs_touch_file_path , None ) else : open ( abs_touch_file_path , 'w' ) . close ( )