servo/mach.bat
author Mike Hommey <mh+mozilla@glandium.org>
Thu, 20 Jul 2017 11:31:14 +0900
changeset 371012 ed4688fd119a5c6714e78e67466eefe16b8e0ce1
parent 352572 de39420cc624efdc9bfd620626211569d912ce2d
child 379950 d99e376e239caa2b86d219cad09f88cb4ddc439e
permissions -rw-r--r--
Bug 1382502 - Enable sccache on PGO builds. r=ted Note this will only enable it on try, autoland and mozilla-inbound, which are the only branches where sccache are enabled at the moment. Enabling on more builds (or not) is the subject of bug 1373460. Also note that bug 1181040, that ensured PGO builds weren't using sccache mentions that back then, link times went up when using sccache (with -Z7) vs. without, but that was presumably with MSVC 2013. Try suggests link times are the same using sccache now (still using -Z7, pending bug 1318370).

@echo off

IF EXIST "%ProgramFiles(x86)%" (
  set "ProgramFiles32=%ProgramFiles(x86)%"
) ELSE (
  set "ProgramFiles32=%ProgramFiles%"
)

set VC14VARS=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat
IF EXIST "%VC14VARS%" (
  set "VS_VCVARS=%VC14VARS%"
) ELSE (
  for %%e in (Enterprise Professional Community) do (
    IF EXIST "%ProgramFiles32%\Microsoft Visual Studio\2017\%%e\VC\Auxiliary\Build\vcvarsall.bat" (
      set "VS_VCVARS=%ProgramFiles32%\Microsoft Visual Studio\2017\%%e\VC\Auxiliary\Build\vcvarsall.bat"
    )
  )
)

IF EXIST "%VS_VCVARS%" (
  IF NOT DEFINED Platform (
    IF EXIST "%ProgramFiles(x86)%" (
      call "%VS_VCVARS%" x64
    ) ELSE (
      ECHO 32-bit Windows is currently unsupported.
      EXIT /B
    )
  )
) ELSE (
  ECHO Visual Studio 2015 or 2017 is not installed.
  ECHO Download and install Visual Studio 2015 or 2017 from https://www.visualstudio.com/
  EXIT /B
)

python mach %*