]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
Sync BaseTool trunk (version r2397) into EDKII BaseTools. The change mainly includes
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index 2def474b17997bbd00b73ff1ee797267579d3ffc..700b689a54fbda3f57c14a32498eecd4c4defd7f 100644 (file)
@@ -2184,13 +2184,19 @@ class ModuleAutoGen(AutoGen):
     def _GetBuildOptionIncPathList(self):\r
         if self._BuildOptionIncPathList == None:\r
             #\r
-            # Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC\r
+            # Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC/RVCT\r
             # is the former use /I , the Latter used -I to specify include directories\r
             #\r
             if self.PlatformInfo.ToolChainFamily in ('MSFT'):\r
                 gBuildOptIncludePattern = re.compile(r"(?:.*?)/I[ \t]*([^ ]*)", re.MULTILINE|re.DOTALL)\r
-            elif self.PlatformInfo.ToolChainFamily in ('INTEL', 'GCC'):\r
+            elif self.PlatformInfo.ToolChainFamily in ('INTEL', 'GCC', 'RVCT'):\r
                 gBuildOptIncludePattern = re.compile(r"(?:.*?)-I[ \t]*([^ ]*)", re.MULTILINE|re.DOTALL)\r
+            else:\r
+                #\r
+                # New ToolChainFamily, don't known whether there is option to specify include directories\r
+                #\r
+                self._BuildOptionIncPathList = []\r
+                return self._BuildOptionIncPathList\r
             \r
             BuildOptionIncPathList = []\r
             for Tool in ('CC', 'PP', 'VFRPP', 'ASLPP', 'ASLCC', 'APP', 'ASM'):\r
@@ -2200,7 +2206,17 @@ class ModuleAutoGen(AutoGen):
                 except KeyError:\r
                     FlagOption = ''\r
                 \r
-                IncPathList = [NormPath(Path, self.Macros) for Path in gBuildOptIncludePattern.findall(FlagOption)]\r
+                if self.PlatformInfo.ToolChainFamily != 'RVCT':\r
+                    IncPathList = [NormPath(Path, self.Macros) for Path in gBuildOptIncludePattern.findall(FlagOption)]\r
+                else:\r
+                    #\r
+                    # RVCT may specify a list of directory seperated by commas\r
+                    #\r
+                    IncPathList = []\r
+                    for Path in gBuildOptIncludePattern.findall(FlagOption):\r
+                        PathList = GetSplitList(Path, TAB_COMMA_SPLIT)\r
+                        IncPathList += [NormPath(PathEntry, self.Macros) for PathEntry in PathList]\r
+\r
                 #\r
                 # EDK II modules must not reference header files outside of the packages they depend on or \r
                 # within the module's directory tree. Report error if violation.\r