diff options
Diffstat (limited to 'BaseTools/toolsetup.bat')
-rwxr-xr-x | BaseTools/toolsetup.bat | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index 61ebf4ae09..4b5256ab6e 100755 --- a/BaseTools/toolsetup.bat +++ b/BaseTools/toolsetup.bat @@ -393,12 +393,31 @@ goto end goto check_freezer_path
)
+
+
:check_freezer_path
endlocal
+
+ %PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL
+ if %ERRORLEVEL% EQU 0 (
+ goto use_pip_basetools
+ ) else (
+ goto use_builtin_basetools
+ )
+
+:use_builtin_basetools
+ @echo Using EDK2 in-source Basetools
if defined BASETOOLS_PYTHON_SOURCE goto print_python_info
set "PATH=%BASE_TOOLS_PATH%\BinWrappers\WindowsLike;%PATH%"
set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python
set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%
+ goto print_python_info
+
+:use_pip_basetools
+ @echo Using Pip Basetools
+ set "PATH=%BASE_TOOLS_PATH%\BinPipWrappers\WindowsLike;%PATH%"
+ set BASETOOLS_PYTHON_SOURCE=edk2basetools
+ goto print_python_info
:print_python_info
echo PATH = %PATH%
|