summaryrefslogtreecommitdiff
path: root/BaseTools/toolsetup.bat
diff options
context:
space:
mode:
authorMatthew Carlson <matthewfcarlson@gmail.com>2021-02-09 08:50:33 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-02-09 03:56:37 +0000
commit1534b6228b0932d745bf6ec9fd4cb010800b92f2 (patch)
tree72fff77178550a5f65df459f1b639a09efa499f9 /BaseTools/toolsetup.bat
parentecc267fec55aecd9e36bf80caba732d5121a3428 (diff)
downloadedk2-1534b6228b0932d745bf6ec9fd4cb010800b92f2.zip
edk2-1534b6228b0932d745bf6ec9fd4cb010800b92f2.tar.gz
edk2-1534b6228b0932d745bf6ec9fd4cb010800b92f2.tar.bz2
BaseTools: Use pip module if available, CI uses it by default
Use the new edk2-basetools pip module. Includes a helpful message in setup to let users know which has been selected. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Yuwei <Chen<yuwei.chen@intel.com> Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com>
Diffstat (limited to 'BaseTools/toolsetup.bat')
-rwxr-xr-xBaseTools/toolsetup.bat19
1 files changed, 19 insertions, 0 deletions
diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
index 61ebf4a..4b5256a 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%