]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix a bug use 'COMMON' as CodeBase in BuildOptions section
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 17 Aug 2016 10:52:51 +0000 (18:52 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 19 Aug 2016 07:39:36 +0000 (15:39 +0800)
Current BaseTools query the BuildOptions not cover the case that use
'COMMON' as CodeBase, while DSC spec allow this usage. This Patch add
support for such 'common.DXE_RUNTIME_DRIVER' as the Scope2 in the query
Condition.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Kurt Kennett <Kurt.Kennett@microsoft.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>
BaseTools/Source/Python/Workspace/MetaFileTable.py
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py

index ab1807046e49b25087f7105139741b6c8253319d..aedcacada199d094047e7c599630be88cabb0d54 100644 (file)
@@ -341,7 +341,13 @@ class PlatformTable(MetaFileTable):
         if Scope1 != None and Scope1 != 'COMMON':\r
             ConditionString += " AND (Scope1='%s' OR Scope1='COMMON')" % Scope1\r
         if Scope2 != None and Scope2 != 'COMMON':\r
-            ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2\r
+            # Cover the case that CodeBase is 'COMMON' for BuildOptions section\r
+            if '.' in Scope2:\r
+                Index = Scope2.index('.')\r
+                NewScope = 'COMMON'+ Scope2[Index:]\r
+                ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT' OR Scope2='%s')" % (Scope2, NewScope)\r
+            else:\r
+                ConditionString += " AND (Scope2='%s' OR Scope2='COMMON' OR Scope2='DEFAULT')" % Scope2\r
 \r
         if BelongsToItem != None:\r
             ConditionString += " AND BelongsToItem=%s" % BelongsToItem\r
index 86d8c3256cbddc068c5bbac07f36325b3efcdaa3..ceaa4b8e0aa36ae16adeb306c2132b2b8a19abc6 100644 (file)
@@ -802,9 +802,10 @@ class DscBuildData(PlatformBuildClassObject):
             options = sdict()\r
             self._ModuleTypeOptions[Edk, ModuleType] = options\r
             DriverType = '%s.%s' % (Edk, ModuleType)\r
+            CommonDriverType = '%s.%s' % ('COMMON', ModuleType)\r
             RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, DriverType]\r
             for ToolChainFamily, ToolChain, Option, Arch, Type, Dummy3, Dummy4 in RecordList:\r
-                if Type == DriverType:\r
+                if Type == DriverType or Type == CommonDriverType:\r
                     Key = (ToolChainFamily, ToolChain, Edk)\r
                     if Key not in options or not ToolChain.endswith('_FLAGS') or Option.startswith('='):\r
                         options[Key] = Option\r