tools/generate_stubs/generate_stubs.py
def CreateWindowsLib(module_name, signatures, intermediate_dir, outdir_path,
                     machine):
  """Creates a Windows library file.

  Calling this function will create a lib file in the outdir_path that exports
  the signatures passed into the object.  A temporary def file will be created
  in the intermediate_dir.

  Args:
    module_name: The name of the module we are writing a stub for.
    signatures: The list of signature hashes, as produced by ParseSignatures,
                to create stubs for.
    intermediate_dir: The directory where the generated .def files should go.
    outdir_path: The directory where generated .lib files should go.
    machine: String holding the machine type, 'X86' or 'X64'.

  Raises:
    SubprocessError: If invoking the Windows "lib" tool fails, this is raised
                     with the error code.
  """
  def_file_path = os.path.join(intermediate_dir, module_name + '.def')
  lib_file_path = os.path.join(outdir_path, module_name + '.lib')
  outfile = open(def_file_path, 'w')
  try:
    WriteWindowsDefFile(module_name, signatures, outfile)
  finally:
    outfile.close()

  # Invoke the "lib" program on Windows to create stub .lib files for the
  # generated definitions.  These .lib files can then be used during
  # delay loading of the dynamic libraries.
  ret = QuietRun([
      'lib', '/nologo', '/machine:' + machine, '/def:' + def_file_path,
      '/out:' + lib_file_path
  ],
                 filter='   Creating library')
  if ret != 0:
    raise SubprocessError(
        'Failed creating %s for %s' % (lib_file_path, def_file_path), ret)
Creates a Windows library file.

  Calling this function will create a lib file in the outdir_path that exports
  the signatures passed into the object.  A temporary def file will be created
  in the intermediate_dir.

  Args:
    module_name: The name of the module we are writing a stub for.
    signatures: The list of signature hashes, as produced by ParseSignatures,
                to create stubs for.
    intermediate_dir: The directory where the generated .def files should go.
    outdir_path: The directory where generated .lib files should go.
    machine: String holding the machine type, 'X86' or 'X64'.

  Raises:
    SubprocessError: If invoking the Windows "lib" tool fails, this is raised
                     with the error code.
  
Creates a Windows library file.
Calling this function will create a lib file in the outdir_path that exports
the signatures passed into the object.  A temporary def file will be created
in the intermediate_dir.
Creates a Windows library file . Calling this function will create a lib file in the outdir_path that exports the signatures passed into the object . A temporary def file will be created in the intermediate_dir .
def CreateWindowsLib(module_name, signatures, intermediate_dir, outdir_path,
                     machine):
  def_file_path = os.path.join(intermediate_dir, module_name + '.def')
  lib_file_path = os.path.join(outdir_path, module_name + '.lib')
  outfile = open(def_file_path, 'w')
  try:
    WriteWindowsDefFile(module_name, signatures, outfile)
  finally:
    outfile.close()
  ret = QuietRun([
      'lib', '/nologo', '/machine:' + machine, '/def:' + def_file_path,
      '/out:' + lib_file_path
  ],
                 filter='   Creating library')
  if ret != 0:
    raise SubprocessError(
        'Failed creating %s for %s' % (lib_file_path, def_file_path), ret)
def CreateWindowsLib ( module_name , signatures , intermediate_dir , outdir_path , machine ) : def_file_path = os . path . join ( intermediate_dir , module_name + '.def' ) lib_file_path = os . path . join ( outdir_path , module_name + '.lib' ) outfile = open ( def_file_path , 'w' ) try : WriteWindowsDefFile ( module_name , signatures , outfile ) finally : outfile . close ( ) ret = QuietRun ( [ 'lib' , '/nologo' , '/machine:' + machine , '/def:' + def_file_path , '/out:' + lib_file_path ] , filter = '   Creating library' ) if ret != 0 : raise SubprocessError ( 'Failed creating %s for %s' % ( lib_file_path , def_file_path ) , ret )
Creates a Windows library file.
Creates a Windows library file .
"""Creates a Windows library file.

  Calling this function will create a lib file in the outdir_path that exports
  the signatures passed into the object.  A temporary def file will be created
  in the intermediate_dir.

  Args:
    module_name: The name of the module we are writing a stub for.
    signatures: The list of signature hashes, as produced by ParseSignatures,
                to create stubs for.
    intermediate_dir: The directory where the generated .def files should go.
    outdir_path: The directory where generated .lib files should go.
    machine: String holding the machine type, 'X86' or 'X64'.

  Raises:
    SubprocessError: If invoking the Windows "lib" tool fails, this is raised
                     with the error code.
  """ # Invoke the "lib" program on Windows to create stub .lib files for the # generated definitions.  These .lib files can then be used during # delay loading of the dynamic libraries.
If invoking the Windows "lib" tool fails, this is raised
with the error code.
If invoking the Windows " lib " tool fails this is raised with the error code .
SubprocessError
module_name
The name of the module we are writing a stub for.
The name of the module we are writing a stub for .
signatures
The list of signature hashes, as produced by ParseSignatures,
to create stubs for.
The list of signature hashes as produced by ParseSignatures to create stubs for .
intermediate_dir
The directory where the generated .def files should go.
The directory where the generated . def files should go .
outdir_path
The directory where generated .lib files should go.
The directory where generated . lib files should go .
machine
String holding the machine type, 'X86' or 'X64'.
String holding the machine type ' X86 ' or ' X64 ' .