]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/BuildEnv
BaseTools: Use pip module if available, CI uses it by default
[mirror_edk2.git] / BaseTools / BuildEnv
index 5943bb9ef90890dacddad57cc8877756e16fb316..8d283e10c01518022c4704d93432a6c40e181c9f 100755 (executable)
@@ -46,7 +46,7 @@ RestorePreviousConfiguration() {
       done
     fi
   fi
-  
+\r
   PREVIOUS_CONF_FILE=$CONF_PATH/BuildEnv.sh
   if [ -e $PREVIOUS_CONF_FILE ]
   then
@@ -198,7 +198,17 @@ AddEdkToolsToPath() {
 
   EDK_TOOLS_PATH_BIN=`GetEdkToolsPathBinDirectory`
 
-  AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike
+  # check if the edk2basetools pip package is available\r
+  if $PYTHON_COMMAND -c "import edk2basetools" &> /dev/null; then\r
+    # if it is, use the pip version of the wrappers\r
+    echo "Using Pip Basetools"\r
+    AddDirToStartOfPath $EDK_TOOLS_PATH/BinPipWrappers/PosixLike\r
+  else\r
+    echo "Using EDK2 in-source Basetools"\r
+    AddDirToStartOfPath $EDK_TOOLS_PATH/BinWrappers/PosixLike\r
+  fi\r
+\r
+\r
   AddDirToStartOfPath $EDK_TOOLS_PATH_BIN
 
 }