]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Support customized compiling command
authorBob Feng <bob.c.feng@intel.com>
Tue, 23 Apr 2019 03:21:22 +0000 (11:21 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Sun, 28 Apr 2019 01:11:27 +0000 (09:11 +0800)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1737
User may add other commands before CC command from build_rule.txt
for specific purpose. It worked fine before commit 05217d210e.

This patch is going to fix the bug in commit 05217d210e to
support customized CC command.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/GenMake.py

index 3e770ad7c425d1e6b8db3f49d4bccd9ed4905a3c..0e0f9fd9b09a58cb361292ad193756a68e531c39 100644 (file)
@@ -1023,7 +1023,7 @@ cleanlib:
             CommandList = T.Commands[:]\r
             for Item in CommandList[:]:\r
                 SingleCommandList = Item.split()\r
-                if len(SingleCommandList) > 0 and '$(CC)' in SingleCommandList[0]:\r
+                if len(SingleCommandList) > 0 and self.CheckCCCmd(SingleCommandList):\r
                     for Temp in SingleCommandList:\r
                         if Temp.startswith('/Fo'):\r
                             CmdSign = '%s%s' % (Temp.rsplit(TAB_SLASH, 1)[0], TAB_SLASH)\r
@@ -1043,6 +1043,11 @@ cleanlib:
                         T.Commands.pop(Index)\r
         return T, CmdSumDict, CmdTargetDict, CmdCppDict\r
 \r
+    def CheckCCCmd(self, CommandList):\r
+        for cmd in CommandList:\r
+            if '$(CC)' in cmd:\r
+                return True\r
+        return False\r
     ## For creating makefile targets for dependent libraries\r
     def ProcessDependentLibrary(self):\r
         for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:\r