From d40b2ee60ef161044bcaf05a8b36aa60eac633cc Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 9 Nov 2011 04:32:08 +0000 Subject: Sync BaseTool trunk (version r2397) into EDKII BaseTools. The change mainly includes 1. Fix the issue that root directory of disk can’t be used as WORKSPACE. 2. Update AutoGen code style to pass C++ compiler. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lgao4 Reviewed-by: jsu1 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12676 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py') diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 2def474b17..700b689a54 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -2184,13 +2184,19 @@ class ModuleAutoGen(AutoGen): def _GetBuildOptionIncPathList(self): if self._BuildOptionIncPathList == None: # - # Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC + # Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC/RVCT # is the former use /I , the Latter used -I to specify include directories # if self.PlatformInfo.ToolChainFamily in ('MSFT'): gBuildOptIncludePattern = re.compile(r"(?:.*?)/I[ \t]*([^ ]*)", re.MULTILINE|re.DOTALL) - elif self.PlatformInfo.ToolChainFamily in ('INTEL', 'GCC'): + elif self.PlatformInfo.ToolChainFamily in ('INTEL', 'GCC', 'RVCT'): gBuildOptIncludePattern = re.compile(r"(?:.*?)-I[ \t]*([^ ]*)", re.MULTILINE|re.DOTALL) + else: + # + # New ToolChainFamily, don't known whether there is option to specify include directories + # + self._BuildOptionIncPathList = [] + return self._BuildOptionIncPathList BuildOptionIncPathList = [] for Tool in ('CC', 'PP', 'VFRPP', 'ASLPP', 'ASLCC', 'APP', 'ASM'): @@ -2200,7 +2206,17 @@ class ModuleAutoGen(AutoGen): except KeyError: FlagOption = '' - IncPathList = [NormPath(Path, self.Macros) for Path in gBuildOptIncludePattern.findall(FlagOption)] + if self.PlatformInfo.ToolChainFamily != 'RVCT': + IncPathList = [NormPath(Path, self.Macros) for Path in gBuildOptIncludePattern.findall(FlagOption)] + else: + # + # RVCT may specify a list of directory seperated by commas + # + IncPathList = [] + for Path in gBuildOptIncludePattern.findall(FlagOption): + PathList = GetSplitList(Path, TAB_COMMA_SPLIT) + IncPathList += [NormPath(PathEntry, self.Macros) for PathEntry in PathList] + # # EDK II modules must not reference header files outside of the packages they depend on or # within the module's directory tree. Report error if violation. -- cgit v1.2.3