2013-11-15 19:47:02 +01:00
|
|
|
@echo off
|
|
|
|
:: Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
|
|
|
:: reserved. Use of this source code is governed by a BSD-style license
|
|
|
|
:: that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
:: Set up the environment for use with MSVS tools and then execute whatever
|
|
|
|
:: was specified on the command-line.
|
|
|
|
|
|
|
|
set RC=
|
|
|
|
setlocal
|
|
|
|
|
2016-05-17 18:48:12 +02:00
|
|
|
:: Require that platform is passed as the first argument.
|
|
|
|
set ARGSOK=F
|
|
|
|
if "%1" == "win32" set ARGSOK=T
|
|
|
|
if "%1" == "win64" set ARGSOK=T
|
|
|
|
if "%ARGSOK%" == "F" (
|
|
|
|
echo ERROR: Please specify a target platform: win32 or win64
|
|
|
|
set ERRORLEVEL=1
|
|
|
|
goto end
|
|
|
|
)
|
|
|
|
|
|
|
|
:: In case vcvars is already provided via the environment.
|
2013-11-15 19:47:02 +01:00
|
|
|
set vcvars="%CEF_VCVARS%"
|
|
|
|
if exist %vcvars% goto found_vcvars
|
2016-05-29 03:58:53 +02:00
|
|
|
if %vcvars% == "none" goto found_vcvars
|
2013-11-15 19:47:02 +01:00
|
|
|
|
2016-05-17 18:48:12 +02:00
|
|
|
if "%1" == "win64" goto check_win64
|
|
|
|
|
|
|
|
:: Hardcoded list of MSVS paths for VS2015 32-bit builds.
|
|
|
|
set vcvars="%PROGRAMFILES(X86)%\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
|
2013-11-15 19:47:02 +01:00
|
|
|
if exist %vcvars% goto found_vcvars
|
2016-05-17 18:48:12 +02:00
|
|
|
set vcvars="%PROGRAMFILES%\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
|
2013-11-15 19:47:02 +01:00
|
|
|
if exist %vcvars% goto found_vcvars
|
2016-05-17 18:48:12 +02:00
|
|
|
|
|
|
|
:check_win64
|
|
|
|
:: Hardcoded list of MSVS paths for VS2015 64-bit builds.
|
|
|
|
set vcvars="%PROGRAMFILES(X86)%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
|
2013-11-15 19:47:02 +01:00
|
|
|
if exist %vcvars% goto found_vcvars
|
2016-05-17 18:48:12 +02:00
|
|
|
set vcvars="%PROGRAMFILES%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
|
2013-11-15 19:47:02 +01:00
|
|
|
if exist %vcvars% goto found_vcvars
|
2016-05-17 18:48:12 +02:00
|
|
|
goto notfound_vcvars
|
2013-11-15 19:47:02 +01:00
|
|
|
|
2016-05-17 18:48:12 +02:00
|
|
|
:notfound_vcvars
|
|
|
|
echo ERROR: Failed to find vcvars
|
|
|
|
set ERRORLEVEL=1
|
2013-11-15 19:47:02 +01:00
|
|
|
goto end
|
|
|
|
|
|
|
|
:found_vcvars
|
|
|
|
echo vcvars:
|
|
|
|
echo %vcvars%
|
2016-05-29 03:58:53 +02:00
|
|
|
if not %vcvars% == "none" call %vcvars%
|
2013-11-15 19:47:02 +01:00
|
|
|
|
|
|
|
echo PATH:
|
|
|
|
echo %PATH%
|
2016-05-17 18:48:12 +02:00
|
|
|
|
|
|
|
:: Remove the first argument and execute the command.
|
|
|
|
for /f "tokens=1,* delims= " %%a in ("%*") do set ALL_BUT_FIRST=%%b
|
|
|
|
echo command:
|
|
|
|
echo %ALL_BUT_FIRST%
|
|
|
|
%ALL_BUT_FIRST%
|
2013-11-15 19:47:02 +01:00
|
|
|
|
|
|
|
:end
|
|
|
|
endlocal & set RC=%ERRORLEVEL%
|
|
|
|
goto omega
|
|
|
|
|
|
|
|
:returncode
|
|
|
|
exit /B %RC%
|
|
|
|
|
|
|
|
:omega
|
|
|
|
call :returncode %RC%
|