parameters: (self, spec, arch=None)
docstring: Compute the path for the final output of the spec.
docstring_summary: Compute the path for the final output of the spec.
docstring_tokens: Compute the path for the final output of the spec .
function: def _ComputeOutput(self, spec, arch=None):
      """Compute the path for the final output of the spec."""
      typ = spec['type']
  
      if self.flavor == 'win':
        override = self.msvs_settings.GetOutputName(self.config_name, self._ExpandSpecial)
        if override:
          return override
  
      if arch is None and self.flavor == 'mac' and typ in (
          'static_library', 'executable', 'shared_library', 'loadable_module'):
        filename = self.xcode_settings.GetExecutablePath()
      else:
        filename = self.ComputeOutputFileName(spec, typ)
  
      if arch is None and 'product_dir' in spec:
        path = os.path.join(spec['product_dir'], filename)
        return self._ExpandSpecial(path)
  
      # Some products go into the output root, libraries go into shared library
      # dir, and everything else goes into the normal place.
      type_in_output_root = ['executable', 'loadable_module']
      if self.flavor == 'mac' and self.toolset == 'target':
        type_in_output_root += ['shared_library', 'static_library']
      elif self.flavor == 'win' and self.toolset == 'target':
        type_in_output_root += ['shared_library']
  
      if arch is not None:
        # Make sure partial executables don't end up in a bundle or the regular
        # output directory.
        archdir = 'arch'
        if self.toolset != 'target':
          archdir = os.path.join('arch', '%s' % self.toolset)
        return os.path.join(archdir, self._AddArch(filename, arch))
      elif typ in type_in_output_root or self.is_standalone_static_library:
        return filename
      elif typ == 'shared_library':
        libdir = 'lib'
        if self.toolset != 'target':
          libdir = os.path.join('lib', '%s' % self.toolset)
        return os.path.join(libdir, filename)
      else:
        return self._GypPathToUniqueOutput(filename, qualified=False)
function_tokens: def _ComputeOutput ( self , spec , arch = None ) : typ = spec [ 'type' ] if self . flavor == 'win' : override = self . msvs_settings . GetOutputName ( self . config_name , self . _ExpandSpecial ) if override : return override if arch is None and self . flavor == 'mac' and typ in ( 'static_library' , 'executable' , 'shared_library' , 'loadable_module' ) : filename = self . xcode_settings . GetExecutablePath ( ) else : filename = self . ComputeOutputFileName ( spec , typ ) if arch is None and 'product_dir' in spec : path = os . path . join ( spec [ 'product_dir' ] , filename ) return self . _ExpandSpecial ( path ) # Some products go into the output root, libraries go into shared library # dir, and everything else goes into the normal place. type_in_output_root = [ 'executable' , 'loadable_module' ] if self . flavor == 'mac' and self . toolset == 'target' : type_in_output_root += [ 'shared_library' , 'static_library' ] elif self . flavor == 'win' and self . toolset == 'target' : type_in_output_root += [ 'shared_library' ] if arch is not None : # Make sure partial executables don't end up in a bundle or the regular # output directory. archdir = 'arch' if self . toolset != 'target' : archdir = os . path . join ( 'arch' , '%s' % self . toolset ) return os . path . join ( archdir , self . _AddArch ( filename , arch ) ) elif typ in type_in_output_root or self . is_standalone_static_library : return filename elif typ == 'shared_library' : libdir = 'lib' if self . toolset != 'target' : libdir = os . path . join ( 'lib' , '%s' % self . toolset ) return os . path . join ( libdir , filename ) else : return self . _GypPathToUniqueOutput ( filename , qualified = False )