mirror of https://github.com/acidanthera/audk.git
BaseTools: Fix incorrect %EDK_TOOLS_PATH%
For non-root folder, such as "X:\test", the EDK_TOOLS_PATH will resolve to "X:\test\edk2\BaseTools". This is OK. But if WORKSPACE is at a root folder, such as "X:\", the EDK_TOOLS_PATH will look like "X:\\BaseTools". The *double backslash* can fail the command like "del" and thus affect the %ERRORLEVEL% variable, which may break subsequent build processing. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
b6e48ec641
commit
40d1adb3eb
39
edksetup.bat
39
edksetup.bat
|
@ -59,22 +59,33 @@ if /I "%1"=="/help" goto Usage
|
|||
|
||||
if /I "%1"=="NewBuild" shift
|
||||
if not defined EDK_TOOLS_PATH (
|
||||
if exist %WORKSPACE%\BaseTools (
|
||||
set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
|
||||
) else (
|
||||
if defined PACKAGES_PATH (
|
||||
for %%i IN (%PACKAGES_PATH%) DO (
|
||||
if exist %%~fi\BaseTools (
|
||||
set EDK_TOOLS_PATH=%%~fi\BaseTools
|
||||
goto checkNt32Flag
|
||||
)
|
||||
goto SetEdkToolsPath
|
||||
) else (
|
||||
goto checkNt32Flag
|
||||
)
|
||||
|
||||
:SetEdkToolsPath
|
||||
if %WORKSPACE:~-1% EQU \ (
|
||||
@set EDK_BASETOOLS=%WORKSPACE%BaseTools
|
||||
) else (
|
||||
@set EDK_BASETOOLS=%WORKSPACE%\BaseTools
|
||||
)
|
||||
if exist %EDK_BASETOOLS% (
|
||||
set EDK_TOOLS_PATH=%EDK_BASETOOLS%
|
||||
set EDK_BASETOOLS=
|
||||
) else (
|
||||
if defined PACKAGES_PATH (
|
||||
for %%i IN (%PACKAGES_PATH%) DO (
|
||||
if exist %%~fi\BaseTools (
|
||||
set EDK_TOOLS_PATH=%%~fi\BaseTools
|
||||
goto checkNt32Flag
|
||||
)
|
||||
) else (
|
||||
echo.
|
||||
echo !!! ERROR !!! Cannot find BaseTools !!!
|
||||
echo.
|
||||
goto BadBaseTools
|
||||
)
|
||||
) else (
|
||||
echo.
|
||||
echo !!! ERROR !!! Cannot find BaseTools !!!
|
||||
echo.
|
||||
goto BadBaseTools
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue