diff --git a/tools/make_distrib.py b/tools/make_distrib.py index 3e1089ee0..116755f74 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -178,7 +178,7 @@ def transfer_files(cef_dir, script_dir, transfer_cfg_dir, mode, output_dir, quie def combine_libs(build_dir, libs, dest_lib): """ Combine multiple static libraries into a single static library. """ - cmdline = 'msvs_env.bat python combine_libs.py -o "%s"' % dest_lib + cmdline = 'msvs_env.bat win%s python combine_libs.py -o "%s"' % (platform_arch, dest_lib) for lib in libs: lib_path = os.path.join(build_dir, lib) if not path_exists(lib_path): diff --git a/tools/msvs_env.bat b/tools/msvs_env.bat index 07b440691..e9091b498 100644 --- a/tools/msvs_env.bat +++ b/tools/msvs_env.bat @@ -9,35 +9,39 @@ set RC= setlocal -:: In case it's already provided via the environment. +:: 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. set vcvars="%CEF_VCVARS%" if exist %vcvars% goto found_vcvars -:: Hardcoded list of MSVS paths. -:: Alternatively we could 'reg query' this key: -:: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS;ProductDir -set vcvars="%PROGRAMFILES(X86)%\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat" +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" if exist %vcvars% goto found_vcvars -set vcvars="%PROGRAMFILES(X86)%\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat" -if exist %vcvars% goto found_vcvars -set vcvars="%PROGRAMFILES(X86)%\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat" -if exist %vcvars% goto found_vcvars -set vcvars="%PROGRAMFILES%\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat" -if exist %vcvars% goto found_vcvars -set vcvars="%PROGRAMFILES%\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat" -if exist %vcvars% goto found_vcvars -set vcvars="%PROGRAMFILES%\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat" -if exist %vcvars% goto found_vcvars -:: VS 2008 vcvars isn't standalone, it needs this env var. -set VS90COMNTOOLS=%PROGRAMFILES(X86)%\Microsoft Visual Studio 9.0\Common7\Tools\ -set vcvars="%PROGRAMFILES(X86)%\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" -if exist %vcvars% goto found_vcvars -set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\ -set vcvars="%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" +set vcvars="%PROGRAMFILES%\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat" if exist %vcvars% goto found_vcvars -set RC=1 -echo Failed to find vcvars +: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" +if exist %vcvars% goto found_vcvars +set vcvars="%PROGRAMFILES%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" +if exist %vcvars% goto found_vcvars +goto notfound_vcvars + +:notfound_vcvars +echo ERROR: Failed to find vcvars +set ERRORLEVEL=1 goto end :found_vcvars @@ -47,7 +51,12 @@ call %vcvars% echo PATH: echo %PATH% -%* + +:: 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% :end endlocal & set RC=%ERRORLEVEL%