summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-10-13 10:47:24 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2017-10-16 16:41:40 +0800
commit97058144294759ffb64005a8543d5dd9a5bdc1fc (patch)
treeb912de5b129fd1d0f7c7c454c91230d9dc50a6d8 /BaseTools
parent9c8c4478cfcacaf5fd60b75ff78d26732d93a5b8 (diff)
downloadedk2-97058144294759ffb64005a8543d5dd9a5bdc1fc.tar.gz
edk2-97058144294759ffb64005a8543d5dd9a5bdc1fc.tar.bz2
edk2-97058144294759ffb64005a8543d5dd9a5bdc1fc.zip
BaseTools: Fix a bug Build directory should relative to WORKSPACE
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>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py1
-rw-r--r--BaseTools/Source/Python/Common/GlobalData.py1
-rw-r--r--BaseTools/Source/Python/Common/String.py2
3 files changed, 3 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 14eb1384c6..5317921cbe 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1798,6 +1798,7 @@ class PlatformAutoGen(AutoGen):
self.OutputDir,
self.BuildTarget + "_" + self.ToolChain,
)
+ GlobalData.gBuildDirectory = self._BuildDir
return self._BuildDir
## Return directory of platform makefile
diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py
index 45e7ea09b2..e348e9af2d 100644
--- a/BaseTools/Source/Python/Common/GlobalData.py
+++ b/BaseTools/Source/Python/Common/GlobalData.py
@@ -56,6 +56,7 @@ gAutoGenPhase = False
#
gConfDirectory = ''
+gBuildDirectory = ''
#
# The relative default database file path
#
diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Python/Common/String.py
index 81c053df27..4a8c03e88e 100644
--- a/BaseTools/Source/Python/Common/String.py
+++ b/BaseTools/Source/Python/Common/String.py
@@ -311,7 +311,7 @@ def NormPath(Path, Defines={}):
# To local path format
#
Path = os.path.normpath(Path)
- if Path.startswith(GlobalData.gWorkspace) and not os.path.exists(Path):
+ if Path.startswith(GlobalData.gWorkspace) and not Path.startswith(GlobalData.gBuildDirectory) and not os.path.exists(Path):
Path = Path[len (GlobalData.gWorkspace):]
if Path[0] == os.path.sep:
Path = Path[1:]