]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix a bug Build directory should relative to WORKSPACE
authorYonghong Zhu <yonghong.zhu@intel.com>
Fri, 13 Oct 2017 02:47:24 +0000 (10:47 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Mon, 16 Oct 2017 08:41:40 +0000 (16:41 +0800)
The bug is for build output files it still use mws.join function, it
cause maybe we will get the build output files in the PACKAGES_PATH
because mws.join will try WORKSPACE first, if the file doesn't exist
then try PACKAGES_PATH. But for build output, we expected it should
relative to WORKSPACE.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/Common/GlobalData.py
BaseTools/Source/Python/Common/String.py

index 14eb1384c6c738cd102b54d9e4aca029d4085210..5317921cbe20cb2f184066fefa23f51661d43759 100644 (file)
@@ -1798,6 +1798,7 @@ class PlatformAutoGen(AutoGen):
                                             self.OutputDir,\r
                                             self.BuildTarget + "_" + self.ToolChain,\r
                                             )\r
+            GlobalData.gBuildDirectory = self._BuildDir\r
         return self._BuildDir\r
 \r
     ## Return directory of platform makefile\r
index 45e7ea09b2ba17cffa8cd0ab7e44d15764f85c37..e348e9af2d58ecd8b74ac278fd4335ba2eeb1776 100644 (file)
@@ -56,6 +56,7 @@ gAutoGenPhase = False
 #\r
 gConfDirectory = ''\r
 \r
+gBuildDirectory = ''\r
 #\r
 # The relative default database file path\r
 #\r
index 81c053df27cdc8eda177410ad8a77fe744439060..4a8c03e88e28297e7c158fc27a420f0851e22d62 100644 (file)
@@ -311,7 +311,7 @@ def NormPath(Path, Defines={}):
         # To local path format\r
         #\r
         Path = os.path.normpath(Path)\r
-        if Path.startswith(GlobalData.gWorkspace) and not os.path.exists(Path):\r
+        if Path.startswith(GlobalData.gWorkspace) and not Path.startswith(GlobalData.gBuildDirectory) and not os.path.exists(Path):\r
             Path = Path[len (GlobalData.gWorkspace):]\r
             if Path[0] == os.path.sep:\r
                 Path = Path[1:]\r