X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2Ftoolsetup.bat;fp=BaseTools%2Ftoolsetup.bat;h=395694fa090a949a51dde8611c9cd430f16c2624;hp=999f3b39847a32116e11e1487ec678202f395d3f;hb=6759212fa69d5d266c2854ea6de44bfd3f7e370b;hpb=541d6017e2d1f3a3a9e016c0ce03704e57f7ceb1 diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 999f3b3984..395694fa09 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -11,6 +11,7 @@ @echo off pushd . +set SCRIPT_ERROR=0 @REM ############################################################## @REM # You should not have to modify anything below this line @@ -41,6 +42,30 @@ if /I "%1"=="/?" goto Usage set FORCE_REBUILD=TRUE goto loop ) + if /I "%1"=="VS2017" ( + shift + set VS2017=TRUE + set VSTool=VS2017 + goto loop + ) + if /I "%1"=="VS2015" ( + shift + set VS2015=TRUE + set VSTool=VS2015 + goto loop + ) + if /I "%1"=="VS2013" ( + shift + set VS2013=TRUE + set VSTool=VS2013 + goto loop + ) + if /I "%1"=="VS2012" ( + shift + set VS2012=TRUE + set VSTool=VS2012 + goto loop + ) if "%1"=="" goto setup_workspace if exist %1 ( if not defined BASE_TOOLS_PATH ( @@ -151,7 +176,27 @@ IF NOT exist "%EDK_TOOLS_PATH%\set_vsprefix_envs.bat" ( @echo. goto end ) -call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat +if defined VS2017 ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2017 +) else if defined VS2015 ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2015 + call %EDK_TOOLS_PATH%\get_vsvars.bat VS2015 +) else if defined VS2013 ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2013 + call %EDK_TOOLS_PATH%\get_vsvars.bat VS2013 +) else if defined VS2012 ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2012 + call %EDK_TOOLS_PATH%\get_vsvars.bat VS2012 +) else ( + call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat + call %EDK_TOOLS_PATH%\get_vsvars.bat +) +if %SCRIPT_ERROR% NEQ 0 ( + @echo. + @echo !!! ERROR !!! %VSTool% is not installed !!! + @echo. + goto end +) if not defined CONF_PATH ( set CONF_PATH=%WORKSPACE%\Conf @@ -365,7 +410,7 @@ goto end goto end ) ) - call "%EDK_TOOLS_PATH%\get_vsvars.bat" + if not defined VCINSTALLDIR ( @echo. @echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!! @@ -399,7 +444,7 @@ goto end :Usage @echo. - echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]" + echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2017] [VS2015] [VS2013] [VS2012]" @echo. @echo base_tools_path BaseTools project path, BASE_TOOLS_PATH will be set to this path. @echo edk_tools_path EDK_TOOLS_PATH will be set to this path. @@ -408,11 +453,20 @@ goto end @echo ForceRebuild If sources are available, rebuild all tools regardless of @echo whether they have been updated or not. @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt. + @echo VS2012 Set the env for VS2012 build. + @echo VS2013 Set the env for VS2013 build. + @echo VS2015 Set the env for VS2015 build. + @echo VS2017 Set the env for VS2017 build. @echo. :end set REBUILD= set FORCE_REBUILD= set RECONFIG= +set VS2017= +set VS2015= +set VS2013= +set VS2012= +set VSTool= popd