BaseTools: fix the bug for [BuildOptions] of multiple workspace support
when enable Multiple workspace and there have other option(eg: -I) before $(WORKSPACE), handleWsMacro cannot return correct which cause the ArmVirtPkg build failure. example: [BuildOptions] *_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmVirtPkg/Include Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
# This file is required to make Python interpreter treat the directory
|
# This file is required to make Python interpreter treat the directory
|
||||||
# as containing package.
|
# as containing package.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -128,12 +128,17 @@ class MultipleWorkspace(object):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def handleWsMacro(cls, PathStr):
|
def handleWsMacro(cls, PathStr):
|
||||||
if TAB_WORKSPACE in PathStr:
|
if TAB_WORKSPACE in PathStr:
|
||||||
Path = PathStr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip()
|
PathList = PathStr.split()
|
||||||
if not os.path.exists(Path):
|
if PathList:
|
||||||
for Pkg in cls.PACKAGES_PATH:
|
for i, str in enumerate(PathList):
|
||||||
Path = PathStr.replace(TAB_WORKSPACE, Pkg).strip()
|
if str.find(TAB_WORKSPACE) != -1:
|
||||||
if os.path.exists(Path):
|
MacroStartPos = str.find(TAB_WORKSPACE)
|
||||||
return Path
|
MacroEndPos = str.find(')', MacroStartPos)
|
||||||
|
Substr = str[MacroEndPos+1:]
|
||||||
|
if Substr.startswith('/') or Substr.startswith('\\'):
|
||||||
|
Substr = Substr[1:]
|
||||||
|
PathList[i] = str[0:MacroStartPos] + os.path.normpath(cls.join(cls.WORKSPACE, Substr))
|
||||||
|
PathStr = ' '.join(PathList)
|
||||||
return PathStr
|
return PathStr
|
||||||
|
|
||||||
## getPkgPath()
|
## getPkgPath()
|
||||||
|
Reference in New Issue
Block a user