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>
This commit is contained in:
@ -1798,6 +1798,7 @@ class PlatformAutoGen(AutoGen):
|
|||||||
self.OutputDir,
|
self.OutputDir,
|
||||||
self.BuildTarget + "_" + self.ToolChain,
|
self.BuildTarget + "_" + self.ToolChain,
|
||||||
)
|
)
|
||||||
|
GlobalData.gBuildDirectory = self._BuildDir
|
||||||
return self._BuildDir
|
return self._BuildDir
|
||||||
|
|
||||||
## Return directory of platform makefile
|
## Return directory of platform makefile
|
||||||
|
@ -56,6 +56,7 @@ gAutoGenPhase = False
|
|||||||
#
|
#
|
||||||
gConfDirectory = ''
|
gConfDirectory = ''
|
||||||
|
|
||||||
|
gBuildDirectory = ''
|
||||||
#
|
#
|
||||||
# The relative default database file path
|
# The relative default database file path
|
||||||
#
|
#
|
||||||
|
@ -311,7 +311,7 @@ def NormPath(Path, Defines={}):
|
|||||||
# To local path format
|
# To local path format
|
||||||
#
|
#
|
||||||
Path = os.path.normpath(Path)
|
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):]
|
Path = Path[len (GlobalData.gWorkspace):]
|
||||||
if Path[0] == os.path.sep:
|
if Path[0] == os.path.sep:
|
||||||
Path = Path[1:]
|
Path = Path[1:]
|
||||||
|
Reference in New Issue
Block a user