summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/AutoGen.py
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2017-12-22 20:46:15 +0800
committerLiming Gao <liming.gao@intel.com>2017-12-25 11:05:47 +0800
commit8518bf0b92a78938341a2752a0044f04336668cc (patch)
tree42cb756c581e15ff9a505c27f216d9f0331509de /BaseTools/Source/Python/AutoGen/AutoGen.py
parent34952f493c24c02f5eba6ae86ed758d3311cddb1 (diff)
downloadedk2-8518bf0b92a78938341a2752a0044f04336668cc.tar.gz
edk2-8518bf0b92a78938341a2752a0044f04336668cc.tar.bz2
edk2-8518bf0b92a78938341a2752a0044f04336668cc.zip
BaseTools: Support Structure PCD value inherit between the different SKUs
https://bugzilla.tianocore.org/show_bug.cgi?id=543 Structure PCD field value can inherit between the different SKUIds. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 783305c7cc..be6fecd9f3 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -44,7 +44,7 @@ from Common.MultipleWorkspace import MultipleWorkspace as mws
import InfSectionParser
import datetime
import hashlib
-from GenVar import Variable,var_info
+from GenVar import VariableMgr,var_info
## Regular expression for splitting Dependency Expression string into tokens
gDepexTokenPattern = re.compile("(\(|\)|\w+| \S+\.inf)")
@@ -1225,6 +1225,7 @@ class PlatformAutoGen(AutoGen):
self.AllPcdList = []
# get the original module/package/platform objects
self.BuildDatabase = Workspace.BuildDatabase
+ self.DscBuildDataObj = Workspace.Platform
# flag indicating if the makefile/C-code file has been created or not
self.IsMakeFileCreated = False
@@ -1354,23 +1355,21 @@ class PlatformAutoGen(AutoGen):
LibAuto.ConstPcd[key] = Pcd.DefaultValue
def CollectVariables(self, DynamicPcdSet):
- VariableInfo = Variable()
+ VariableInfo = VariableMgr(self.DscBuildDataObj._GetDefaultStores(),self.DscBuildDataObj._GetSkuIds())
Index = 0
for Pcd in DynamicPcdSet:
- if not hasattr(Pcd,"DefaultStoreName"):
- Pcd.DefaultStoreName = ['0']
- for StorageName in Pcd.DefaultStoreName:
- pcdname = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))
- for SkuName in Pcd.SkuInfoList:
- Sku = Pcd.SkuInfoList[SkuName]
- SkuId = Sku.SkuId
- if SkuId == None or SkuId == '':
- continue
- if len(Sku.VariableName) > 0:
- VariableGuidStructure = Sku.VariableGuidValue
- VariableGuid = GuidStructureStringToGuidString(VariableGuidStructure)
- if Pcd.Phase == "DXE":
- VariableInfo.append_variable(var_info(Index,pcdname,StorageName,SkuId, StringToArray(Sku.VariableName),VariableGuid, Sku.VariableAttribute , Pcd.DefaultValue,Sku.HiiDefaultValue,Pcd.DatumType))
+ pcdname = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))
+ for SkuName in Pcd.SkuInfoList:
+ Sku = Pcd.SkuInfoList[SkuName]
+ SkuId = Sku.SkuId
+ if SkuId == None or SkuId == '':
+ continue
+ if len(Sku.VariableName) > 0:
+ VariableGuidStructure = Sku.VariableGuidValue
+ VariableGuid = GuidStructureStringToGuidString(VariableGuidStructure)
+ if Pcd.Phase == "DXE":
+ for StorageName in Sku.DefaultStoreDict:
+ VariableInfo.append_variable(var_info(Index,pcdname,StorageName,SkuName, StringToArray(Sku.VariableName),VariableGuid, Sku.VariableAttribute , Pcd.DefaultValue,Sku.DefaultStoreDict[StorageName],Pcd.DatumType))
Index += 1
return VariableInfo
## Collect dynamic PCDs
@@ -2383,7 +2382,7 @@ class PlatformAutoGen(AutoGen):
else:
SkuName = 'DEFAULT'
ToPcd.SkuInfoList = {
- SkuName : SkuInfoClass(SkuName, self.Platform.SkuIds[SkuName], '', '', '', '', '', ToPcd.DefaultValue)
+ SkuName : SkuInfoClass(SkuName, self.Platform.SkuIds[SkuName][0], '', '', '', '', '', ToPcd.DefaultValue)
}
## Apply PCD setting defined platform to a module