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 file is required to make Python interpreter treat the directory\r
# as containing package.\r
#\r
# This file is required to make Python interpreter treat the directory\r
# as containing package.\r
#\r
-# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
@classmethod\r
def handleWsMacro(cls, PathStr):\r
if TAB_WORKSPACE in PathStr:\r
@classmethod\r
def handleWsMacro(cls, PathStr):\r
if TAB_WORKSPACE in PathStr:\r
- Path = PathStr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip()\r
- if not os.path.exists(Path):\r
- for Pkg in cls.PACKAGES_PATH:\r
- Path = PathStr.replace(TAB_WORKSPACE, Pkg).strip()\r
- if os.path.exists(Path):\r
- return Path\r
+ PathList = PathStr.split()\r
+ if PathList:\r
+ for i, str in enumerate(PathList):\r
+ if str.find(TAB_WORKSPACE) != -1:\r
+ MacroStartPos = str.find(TAB_WORKSPACE)\r
+ MacroEndPos = str.find(')', MacroStartPos)\r
+ Substr = str[MacroEndPos+1:]\r
+ if Substr.startswith('/') or Substr.startswith('\\'):\r
+ Substr = Substr[1:]\r
+ PathList[i] = str[0:MacroStartPos] + os.path.normpath(cls.join(cls.WORKSPACE, Substr))\r
+ PathStr = ' '.join(PathList)\r
return PathStr\r
\r
## getPkgPath()\r
return PathStr\r
\r
## getPkgPath()\r