From 2b1c08acfceb94326c67b7d8f9fe5d8ab4cb7f61 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Wed, 13 Apr 2016 16:27:05 +0800 Subject: 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/MultipleWorkspace.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'BaseTools') diff --git a/BaseTools/Source/Python/Common/MultipleWorkspace.py b/BaseTools/Source/Python/Common/MultipleWorkspace.py index feb1f8d5eb..4e4c37ae13 100644 --- a/BaseTools/Source/Python/Common/MultipleWorkspace.py +++ b/BaseTools/Source/Python/Common/MultipleWorkspace.py @@ -4,7 +4,7 @@ # This file is required to make Python interpreter treat the directory # as containing package. # -# Copyright (c) 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
# This program and the accompanying materials # 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 @@ -128,12 +128,17 @@ class MultipleWorkspace(object): @classmethod def handleWsMacro(cls, PathStr): if TAB_WORKSPACE in PathStr: - Path = PathStr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip() - if not os.path.exists(Path): - for Pkg in cls.PACKAGES_PATH: - Path = PathStr.replace(TAB_WORKSPACE, Pkg).strip() - if os.path.exists(Path): - return Path + PathList = PathStr.split() + if PathList: + for i, str in enumerate(PathList): + if str.find(TAB_WORKSPACE) != -1: + MacroStartPos = str.find(TAB_WORKSPACE) + 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 ## getPkgPath() -- cgit v1.2.3