(self, target_arch)
Returns a command (with arguments) to be used to set up the
    environment.
Returns a command (with arguments) to be used to set up the
    environment.
Returns a command ( with arguments ) to be used to set up the environment .
def SetupScript(self, target_arch):
    """Returns a command (with arguments) to be used to set up the
    environment."""
    # Check if we are running in the SDK command line environment and use
    # the setup script from the SDK if so. |target_arch| should be either
    # 'x86' or 'x64'.
    assert target_arch in ('x86', 'x64')
    sdk_dir = os.environ.get('WindowsSDKDir')
    if self.sdk_based and sdk_dir:
      return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')),
              '/' + target_arch]
    else:
      # We don't use VC/vcvarsall.bat for x86 because vcvarsall calls
      # vcvars32, which it can only find if VS??COMNTOOLS is set, which it
      # isn't always.
      if target_arch == 'x86':
        if self.short_name >= '2013' and self.short_name[-1] != 'e' and (
            os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
            os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
          # VS2013 and later, non-Express have a x64-x86 cross that we want
          # to prefer.
          return [os.path.normpath(
             os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86']
        # Otherwise, the standard x86 compiler.
        return [os.path.normpath(
          os.path.join(self.path, 'Common7/Tools/vsvars32.bat'))]
      else:
        assert target_arch == 'x64'
        arg = 'x86_amd64'
        # Use the 64-on-64 compiler if we're not using an express
        # edition and we're running on a 64bit OS.
        if self.short_name[-1] != 'e' and (
            os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
            os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
          arg = 'amd64'
        return [os.path.normpath(
            os.path.join(self.path, 'VC/vcvarsall.bat')), arg]
def SetupScript ( self , target_arch ) : # Check if we are running in the SDK command line environment and use # the setup script from the SDK if so. |target_arch| should be either # 'x86' or 'x64'. assert target_arch in ( 'x86' , 'x64' ) sdk_dir = os . environ . get ( 'WindowsSDKDir' ) if self . sdk_based and sdk_dir : return [ os . path . normpath ( os . path . join ( sdk_dir , 'Bin/SetEnv.Cmd' ) ) , '/' + target_arch ] else : # We don't use VC/vcvarsall.bat for x86 because vcvarsall calls # vcvars32, which it can only find if VS??COMNTOOLS is set, which it # isn't always. if target_arch == 'x86' : if self . short_name >= '2013' and self . short_name [ - 1 ] != 'e' and ( os . environ . get ( 'PROCESSOR_ARCHITECTURE' ) == 'AMD64' or os . environ . get ( 'PROCESSOR_ARCHITEW6432' ) == 'AMD64' ) : # VS2013 and later, non-Express have a x64-x86 cross that we want # to prefer. return [ os . path . normpath ( os . path . join ( self . path , 'VC/vcvarsall.bat' ) ) , 'amd64_x86' ] # Otherwise, the standard x86 compiler. return [ os . path . normpath ( os . path . join ( self . path , 'Common7/Tools/vsvars32.bat' ) ) ] else : assert target_arch == 'x64' arg = 'x86_amd64' # Use the 64-on-64 compiler if we're not using an express # edition and we're running on a 64bit OS. if self . short_name [ - 1 ] != 'e' and ( os . environ . get ( 'PROCESSOR_ARCHITECTURE' ) == 'AMD64' or os . environ . get ( 'PROCESSOR_ARCHITEW6432' ) == 'AMD64' ) : arg = 'amd64' return [ os . path . normpath ( os . path . join ( self . path , 'VC/vcvarsall.bat' ) ) , arg ]