]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/toolsetup.bat
BaseTools: Use pip module if available, CI uses it by default
[mirror_edk2.git] / BaseTools / toolsetup.bat
index 61ebf4ae09bc64fc67d03f9bb22215d8270da46e..4b5256ab6e93eda8787f4ad0ecc5b5b090d764fd 100755 (executable)
@@ -393,12 +393,31 @@ goto end
     goto check_freezer_path\r
   )\r
 \r
+\r
+\r
 :check_freezer_path\r
   endlocal\r
+\r
+  %PYTHON_COMMAND% -c "import edk2basetools" >NUL 2>NUL\r
+  if %ERRORLEVEL% EQU 0 (\r
+    goto use_pip_basetools\r
+  ) else (\r
+    goto use_builtin_basetools\r
+  )\r
+\r
+:use_builtin_basetools\r
+  @echo Using EDK2 in-source Basetools\r
   if defined BASETOOLS_PYTHON_SOURCE goto print_python_info\r
   set "PATH=%BASE_TOOLS_PATH%\BinWrappers\WindowsLike;%PATH%"\r
   set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python\r
   set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%\r
+  goto print_python_info\r
+\r
+:use_pip_basetools\r
+  @echo Using Pip Basetools\r
+  set "PATH=%BASE_TOOLS_PATH%\BinPipWrappers\WindowsLike;%PATH%"\r
+  set BASETOOLS_PYTHON_SOURCE=edk2basetools\r
+  goto print_python_info\r
 \r
 :print_python_info\r
   echo                PATH = %PATH%\r