# Generate AutoGen.h, AutoGen.c and *.depex files\r
#\r
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>\r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
from Common.BuildToolError import *\r
from Common.DataType import *\r
from Common.Misc import *\r
-from Common.String import *\r
+from Common.StringUtils import *\r
import Common.GlobalData as GlobalData\r
from GenFds.FdfParser import *\r
from CommonDataClass.CommonClass import SkuInfoClass\r
import Common.VpdInfoFile as VpdInfoFile\r
from GenPcdDb import CreatePcdDatabaseCode\r
from Workspace.MetaFileCommentParser import UsageList\r
+from Workspace.WorkspaceCommon import GetModuleLibInstances\r
from Common.MultipleWorkspace import MultipleWorkspace as mws\r
import InfSectionParser\r
import datetime\r
if BuildData.Pcds[key].Pending:\r
if key in Platform.Pcds:\r
PcdInPlatform = Platform.Pcds[key]\r
- if PcdInPlatform.Type not in [None, '']:\r
+ if PcdInPlatform.Type:\r
BuildData.Pcds[key].Type = PcdInPlatform.Type\r
+ BuildData.Pcds[key].Pending = False\r
\r
if BuildData.MetaFile in Platform.Modules:\r
PlatformModule = Platform.Modules[str(BuildData.MetaFile)]\r
if key in PlatformModule.Pcds:\r
PcdInPlatform = PlatformModule.Pcds[key]\r
- if PcdInPlatform.Type not in [None, '']:\r
+ if PcdInPlatform.Type:\r
BuildData.Pcds[key].Type = PcdInPlatform.Type\r
+ BuildData.Pcds[key].Pending = False\r
+ else:\r
+ #Pcd used in Library, Pcd Type from reference module if Pcd Type is Pending\r
+ if BuildData.Pcds[key].Pending:\r
+ MGen = ModuleAutoGen(self, BuildData.MetaFile, Target, Toolchain, Arch, self.MetaFile)\r
+ if MGen and MGen.IsLibrary:\r
+ if MGen in PGen.LibraryAutoGenList:\r
+ ReferenceModules = MGen._ReferenceModules\r
+ for ReferenceModule in ReferenceModules:\r
+ if ReferenceModule.MetaFile in Platform.Modules:\r
+ RefPlatformModule = Platform.Modules[str(ReferenceModule.MetaFile)]\r
+ if key in RefPlatformModule.Pcds:\r
+ PcdInReferenceModule = RefPlatformModule.Pcds[key]\r
+ if PcdInReferenceModule.Type:\r
+ BuildData.Pcds[key].Type = PcdInReferenceModule.Type\r
+ BuildData.Pcds[key].Pending = False\r
+ break\r
\r
if TAB_PCDS_DYNAMIC_EX in BuildData.Pcds[key].Type:\r
if BuildData.IsBinaryModule:\r
'build',\r
FORMAT_INVALID,\r
"Building modules from source INFs, following PCD use %s and %s access method. It must be corrected to use only one access method." % (i, j),\r
- ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in Intersections])\r
+ ExtraData="%s" % '\n\t'.join(str(P[1]+'.'+P[0]) for P in Intersections)\r
)\r
\r
#\r
return True\r
\r
def _GenPkgLevelHash(self, Pkg):\r
+ if Pkg.PackageName in GlobalData.gPackageHash[Pkg.Arch]:\r
+ return\r
+\r
PkgDir = os.path.join(self.BuildDir, Pkg.Arch, Pkg.PackageName)\r
CreateDirectory(PkgDir)\r
HashFile = os.path.join(PkgDir, Pkg.PackageName + '.hash')\r
m.update(Content)\r
# Get include files hash value\r
if Pkg.Includes:\r
- for inc in Pkg.Includes:\r
+ for inc in sorted(Pkg.Includes, key=lambda x: str(x)):\r
for Root, Dirs, Files in os.walk(str(inc)):\r
- for File in Files:\r
+ for File in sorted(Files):\r
File_Path = os.path.join(Root, File)\r
f = open(File_Path, 'r')\r
Content = f.read()\r
f.close()\r
m.update(Content)\r
SaveFileOnChange(HashFile, m.hexdigest(), True)\r
- if Pkg.PackageName not in GlobalData.gPackageHash[Pkg.Arch]:\r
- GlobalData.gPackageHash[Pkg.Arch][Pkg.PackageName] = m.hexdigest()\r
+ GlobalData.gPackageHash[Pkg.Arch][Pkg.PackageName] = m.hexdigest()\r
\r
def _GetMetaFiles(self, Target, Toolchain, Arch):\r
AllWorkSpaceMetaFiles = set()\r
def _CheckPcdDefineAndType(self):\r
PcdTypeList = [\r
TAB_PCDS_FIXED_AT_BUILD, TAB_PCDS_PATCHABLE_IN_MODULE, TAB_PCDS_FEATURE_FLAG,\r
- TAB_PCDS_DYNAMIC, #"DynamicHii", "DynamicVpd",\r
- TAB_PCDS_DYNAMIC_EX, # "DynamicExHii", "DynamicExVpd"\r
+ TAB_PCDS_DYNAMIC, #TAB_PCDS_DYNAMIC_HII, TAB_PCDS_DYNAMIC_VPD,\r
+ TAB_PCDS_DYNAMIC_EX, # TAB_PCDS_DYNAMIC_EX_HII, TAB_PCDS_DYNAMIC_EX_VPD\r
]\r
\r
# This dict store PCDs which are not used by any modules with specified arches\r
## Return the directory to store FV files\r
def _GetFvDir(self):\r
if self._FvDir is None:\r
- self._FvDir = path.join(self.BuildDir, 'FV')\r
+ self._FvDir = path.join(self.BuildDir, TAB_FV_DIRECTORY)\r
return self._FvDir\r
\r
## Return the directory to store all intermediate and final files built\r
\r
def UpdateNVStoreMaxSize(self,OrgVpdFile):\r
if self.VariableInfo:\r
- VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)\r
+ VpdMapFilePath = os.path.join(self.BuildDir, TAB_FV_DIRECTORY, "%s.map" % self.Platform.VpdToolGuid)\r
PcdNvStoreDfBuffer = [item for item in self._DynamicPcdList if item.TokenCName == "PcdNvStoreDefaultValueBuffer" and item.TokenSpaceGuidCName == "gEfiMdeModulePkgTokenSpaceGuid"]\r
\r
if PcdNvStoreDfBuffer:\r
\r
for PcdFromModule in M.ModulePcdList + M.LibraryPcdList:\r
# make sure that the "VOID*" kind of datum has MaxDatumSize set\r
- if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:\r
+ if PcdFromModule.DatumType == TAB_VOID and not PcdFromModule.MaxDatumSize:\r
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, F))\r
\r
# Check the PCD from Binary INF or Source INF\r
ExtraData="\n\tExisted %s PCD %s in:\n\t\t%s\n"\r
% (PcdFromModule.Type, PcdFromModule.TokenCName, InfName))\r
# make sure that the "VOID*" kind of datum has MaxDatumSize set\r
- if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:\r
+ if PcdFromModule.DatumType == TAB_VOID and not PcdFromModule.MaxDatumSize:\r
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName))\r
if M.ModuleType in SUP_MODULE_SET_PEI:\r
PcdFromModule.Phase = "PEI"\r
\r
# Process VPD map file generated by third party BPDG tool\r
if NeedProcessVpdMapFile:\r
- VpdMapFilePath = os.path.join(self.BuildDir, "FV", "%s.map" % self.Platform.VpdToolGuid)\r
+ VpdMapFilePath = os.path.join(self.BuildDir, TAB_FV_DIRECTORY, "%s.map" % self.Platform.VpdToolGuid)\r
if os.path.exists(VpdMapFilePath):\r
VpdFile.Read(VpdMapFilePath)\r
\r
self.AllPcdList = self._NonDynamicPcdList + self._DynamicPcdList\r
\r
def FixVpdOffset(self,VpdFile ):\r
- FvPath = os.path.join(self.BuildDir, "FV")\r
+ FvPath = os.path.join(self.BuildDir, TAB_FV_DIRECTORY)\r
if not os.path.exists(FvPath):\r
try:\r
os.makedirs(FvPath)\r
# retrieve BPDG tool's path from tool_def.txt according to VPD_TOOL_GUID defined in DSC file.\r
BPDGToolName = None\r
for ToolDef in self.ToolDefinition.values():\r
- if ToolDef.has_key("GUID") and ToolDef["GUID"] == self.Platform.VpdToolGuid:\r
+ if ToolDef.has_key(TAB_GUID) and ToolDef[TAB_GUID] == self.Platform.VpdToolGuid:\r
if not ToolDef.has_key("PATH"):\r
EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "PATH attribute was not provided for BPDG guid tool %s in tools_def.txt" % self.Platform.VpdToolGuid)\r
BPDGToolName = ToolDef["PATH"]\r
BuildRuleFile = None\r
if TAB_TAT_DEFINES_BUILD_RULE_CONF in self.Workspace.TargetTxt.TargetTxtDictionary:\r
BuildRuleFile = self.Workspace.TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_BUILD_RULE_CONF]\r
- if BuildRuleFile in [None, '']:\r
+ if not BuildRuleFile:\r
BuildRuleFile = gDefaultBuildRuleFile\r
self._BuildRule = BuildRule(BuildRuleFile)\r
if self._BuildRule._FileVersion == "":\r
if str(Module) not in self.Platform.Modules:\r
return []\r
\r
- ModuleType = Module.ModuleType\r
-\r
- # for overridding library instances with module specific setting\r
- PlatformModule = self.Platform.Modules[str(Module)]\r
-\r
- # add forced library instances (specified under LibraryClasses sections)\r
- #\r
- # If a module has a MODULE_TYPE of USER_DEFINED,\r
- # do not link in NULL library class instances from the global [LibraryClasses.*] sections.\r
- #\r
- if Module.ModuleType != SUP_MODULE_USER_DEFINED:\r
- for LibraryClass in self.Platform.LibraryClasses.GetKeys():\r
- if LibraryClass.startswith("NULL") and self.Platform.LibraryClasses[LibraryClass, Module.ModuleType]:\r
- Module.LibraryClasses[LibraryClass] = self.Platform.LibraryClasses[LibraryClass, Module.ModuleType]\r
-\r
- # add forced library instances (specified in module overrides)\r
- for LibraryClass in PlatformModule.LibraryClasses:\r
- if LibraryClass.startswith("NULL"):\r
- Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]\r
-\r
- # EdkII module\r
- LibraryConsumerList = [Module]\r
- Constructor = []\r
- ConsumedByList = OrderedDict()\r
- LibraryInstance = OrderedDict()\r
-\r
- EdkLogger.verbose("")\r
- EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), self.Arch))\r
- while len(LibraryConsumerList) > 0:\r
- M = LibraryConsumerList.pop()\r
- for LibraryClassName in M.LibraryClasses:\r
- if LibraryClassName not in LibraryInstance:\r
- # override library instance for this module\r
- if LibraryClassName in PlatformModule.LibraryClasses:\r
- LibraryPath = PlatformModule.LibraryClasses[LibraryClassName]\r
- else:\r
- LibraryPath = self.Platform.LibraryClasses[LibraryClassName, ModuleType]\r
- if LibraryPath is None or LibraryPath == "":\r
- LibraryPath = M.LibraryClasses[LibraryClassName]\r
- if LibraryPath is None or LibraryPath == "":\r
- EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,\r
- "Instance of library class [%s] is not found" % LibraryClassName,\r
- File=self.MetaFile,\r
- ExtraData="in [%s] [%s]\n\tconsumed by module [%s]" % (str(M), self.Arch, str(Module)))\r
-\r
- LibraryModule = self.BuildDatabase[LibraryPath, self.Arch, self.BuildTarget, self.ToolChain]\r
- # for those forced library instance (NULL library), add a fake library class\r
- if LibraryClassName.startswith("NULL"):\r
- LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType]))\r
- elif LibraryModule.LibraryClass is None \\r
- or len(LibraryModule.LibraryClass) == 0 \\r
- or (ModuleType != SUP_MODULE_USER_DEFINED\r
- and ModuleType not in LibraryModule.LibraryClass[0].SupModList):\r
- # only USER_DEFINED can link against any library instance despite of its SupModList\r
- EdkLogger.error("build", OPTION_MISSING,\r
- "Module type [%s] is not supported by library instance [%s]" \\r
- % (ModuleType, LibraryPath), File=self.MetaFile,\r
- ExtraData="consumed by [%s]" % str(Module))\r
-\r
- LibraryInstance[LibraryClassName] = LibraryModule\r
- LibraryConsumerList.append(LibraryModule)\r
- EdkLogger.verbose("\t" + str(LibraryClassName) + " : " + str(LibraryModule))\r
- else:\r
- LibraryModule = LibraryInstance[LibraryClassName]\r
-\r
- if LibraryModule is None:\r
- continue\r
-\r
- if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:\r
- Constructor.append(LibraryModule)\r
-\r
- if LibraryModule not in ConsumedByList:\r
- ConsumedByList[LibraryModule] = []\r
- # don't add current module itself to consumer list\r
- if M != Module:\r
- if M in ConsumedByList[LibraryModule]:\r
- continue\r
- ConsumedByList[LibraryModule].append(M)\r
- #\r
- # Initialize the sorted output list to the empty set\r
- #\r
- SortedLibraryList = []\r
- #\r
- # Q <- Set of all nodes with no incoming edges\r
- #\r
- LibraryList = [] #LibraryInstance.values()\r
- Q = []\r
- for LibraryClassName in LibraryInstance:\r
- M = LibraryInstance[LibraryClassName]\r
- LibraryList.append(M)\r
- if ConsumedByList[M] == []:\r
- Q.append(M)\r
-\r
- #\r
- # start the DAG algorithm\r
- #\r
- while True:\r
- EdgeRemoved = True\r
- while Q == [] and EdgeRemoved:\r
- EdgeRemoved = False\r
- # for each node Item with a Constructor\r
- for Item in LibraryList:\r
- if Item not in Constructor:\r
- continue\r
- # for each Node without a constructor with an edge e from Item to Node\r
- for Node in ConsumedByList[Item]:\r
- if Node in Constructor:\r
- continue\r
- # remove edge e from the graph if Node has no constructor\r
- ConsumedByList[Item].remove(Node)\r
- EdgeRemoved = True\r
- if ConsumedByList[Item] == []:\r
- # insert Item into Q\r
- Q.insert(0, Item)\r
- break\r
- if Q != []:\r
- break\r
- # DAG is done if there's no more incoming edge for all nodes\r
- if Q == []:\r
- break\r
-\r
- # remove node from Q\r
- Node = Q.pop()\r
- # output Node\r
- SortedLibraryList.append(Node)\r
-\r
- # for each node Item with an edge e from Node to Item do\r
- for Item in LibraryList:\r
- if Node not in ConsumedByList[Item]:\r
- continue\r
- # remove edge e from the graph\r
- ConsumedByList[Item].remove(Node)\r
-\r
- if ConsumedByList[Item] != []:\r
- continue\r
- # insert Item into Q, if Item has no other incoming edges\r
- Q.insert(0, Item)\r
-\r
- #\r
- # if any remaining node Item in the graph has a constructor and an incoming edge, then the graph has a cycle\r
- #\r
- for Item in LibraryList:\r
- if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:\r
- ErrorMessage = "\tconsumed by " + "\n\tconsumed by ".join([str(L) for L in ConsumedByList[Item]])\r
- EdkLogger.error("build", BUILD_ERROR, 'Library [%s] with constructors has a cycle' % str(Item),\r
- ExtraData=ErrorMessage, File=self.MetaFile)\r
- if Item not in SortedLibraryList:\r
- SortedLibraryList.append(Item)\r
-\r
- #\r
- # Build the list of constructor and destructir names\r
- # The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order\r
- #\r
- SortedLibraryList.reverse()\r
- return SortedLibraryList\r
-\r
+ return GetModuleLibInstances(Module,\r
+ self.Platform,\r
+ self.BuildDatabase,\r
+ self.Arch,\r
+ self.BuildTarget,\r
+ self.ToolChain,\r
+ self.MetaFile,\r
+ EdkLogger)\r
\r
## Override PCD setting (type, value, ...)\r
#\r
# @param ToPcd The PCD to be overrided\r
# @param FromPcd The PCD overrideing from\r
#\r
- def _OverridePcd(self, ToPcd, FromPcd, Module=""):\r
+ def _OverridePcd(self, ToPcd, FromPcd, Module="", Msg="", Library=""):\r
#\r
# in case there's PCDs coming from FDF file, which have no type given.\r
# at this point, ToPcd.Type has the type found from dependent\r
TokenCName = PcdItem[0]\r
break\r
if FromPcd is not None:\r
- if ToPcd.Pending and FromPcd.Type not in [None, '']:\r
+ if ToPcd.Pending and FromPcd.Type:\r
ToPcd.Type = FromPcd.Type\r
- elif (ToPcd.Type not in [None, '']) and (FromPcd.Type not in [None, ''])\\r
+ elif (ToPcd.Type) and (FromPcd.Type)\\r
and (ToPcd.Type != FromPcd.Type) and (ToPcd.Type in FromPcd.Type):\r
if ToPcd.Type.strip() == TAB_PCDS_DYNAMIC_EX:\r
ToPcd.Type = FromPcd.Type\r
- elif ToPcd.Type not in [None, ''] and FromPcd.Type not in [None, ''] \\r
+ elif ToPcd.Type and FromPcd.Type \\r
and ToPcd.Type != FromPcd.Type:\r
+ if Library:\r
+ Module = str(Module) + " 's library file (" + str(Library) + ")"\r
EdkLogger.error("build", OPTION_CONFLICT, "Mismatched PCD type",\r
- ExtraData="%s.%s is defined as [%s] in module %s, but as [%s] in platform."\\r
+ ExtraData="%s.%s is used as [%s] in module %s, but as [%s] in %s."\\r
% (ToPcd.TokenSpaceGuidCName, TokenCName,\r
- ToPcd.Type, Module, FromPcd.Type),\r
+ ToPcd.Type, Module, FromPcd.Type, Msg),\r
File=self.MetaFile)\r
\r
if FromPcd.MaxDatumSize:\r
ToPcd.validlists = FromPcd.validlists\r
ToPcd.expressions = FromPcd.expressions\r
\r
- if FromPcd is not None and ToPcd.DatumType == TAB_VOID and ToPcd.MaxDatumSize in ['', None]:\r
+ if FromPcd is not None and ToPcd.DatumType == TAB_VOID and not ToPcd.MaxDatumSize:\r
EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified for PCD %s.%s" \\r
% (ToPcd.TokenSpaceGuidCName, TokenCName))\r
Value = ToPcd.DefaultValue\r
- if Value in [None, '']:\r
+ if not Value:\r
ToPcd.MaxDatumSize = '1'\r
elif Value[0] == 'L':\r
ToPcd.MaxDatumSize = str((len(Value) - 2) * 2)\r
\r
# apply default SKU for dynamic PCDS if specified one is not available\r
if (ToPcd.Type in PCD_DYNAMIC_TYPE_SET or ToPcd.Type in PCD_DYNAMIC_EX_TYPE_SET) \\r
- and ToPcd.SkuInfoList in [None, {}, '']:\r
+ and not ToPcd.SkuInfoList:\r
if self.Platform.SkuName in self.Platform.SkuIds:\r
SkuName = self.Platform.SkuName\r
else:\r
#\r
# @retval PCD_list The list PCDs with settings from platform\r
#\r
- def ApplyPcdSetting(self, Module, Pcds):\r
+ def ApplyPcdSetting(self, Module, Pcds, Library=""):\r
# for each PCD in module\r
for Name, Guid in Pcds:\r
PcdInModule = Pcds[Name, Guid]\r
else:\r
PcdInPlatform = None\r
# then override the settings if any\r
- self._OverridePcd(PcdInModule, PcdInPlatform, Module)\r
+ self._OverridePcd(PcdInModule, PcdInPlatform, Module, Msg="DSC PCD sections", Library=Library)\r
# resolve the VariableGuid value\r
for SkuId in PcdInModule.SkuInfoList:\r
Sku = PcdInModule.SkuInfoList[SkuId]\r
if Sku.VariableGuid == '': continue\r
Sku.VariableGuidValue = GuidValue(Sku.VariableGuid, self.PackageList, self.MetaFile.Path)\r
if Sku.VariableGuidValue is None:\r
- PackageList = "\n\t".join([str(P) for P in self.PackageList])\r
+ PackageList = "\n\t".join(str(P) for P in self.PackageList)\r
EdkLogger.error(\r
'build',\r
RESOURCE_NOT_AVAILABLE,\r
Flag = True\r
break\r
if Flag:\r
- self._OverridePcd(ToPcd, PlatformModule.Pcds[Key], Module)\r
+ self._OverridePcd(ToPcd, PlatformModule.Pcds[Key], Module, Msg="DSC Components Module scoped PCD section", Library=Library)\r
# use PCD value to calculate the MaxDatumSize when it is not specified\r
for Name, Guid in Pcds:\r
Pcd = Pcds[Name, Guid]\r
- if Pcd.DatumType == TAB_VOID and Pcd.MaxDatumSize in ['', None]:\r
+ if Pcd.DatumType == TAB_VOID and not Pcd.MaxDatumSize:\r
Pcd.MaxSizeUserSet = None\r
Value = Pcd.DefaultValue\r
- if Value in [None, '']:\r
+ if not Value:\r
Pcd.MaxDatumSize = '1'\r
elif Value[0] == 'L':\r
Pcd.MaxDatumSize = str((len(Value) - 2) * 2)\r
def _GetFfsOutputDir(self):\r
if self._FfsOutputDir is None:\r
if GlobalData.gFdfParser is not None:\r
- self._FfsOutputDir = path.join(self.PlatformInfo.BuildDir, "FV", "Ffs", self.Guid + self.Name)\r
+ self._FfsOutputDir = path.join(self.PlatformInfo.BuildDir, TAB_FV_DIRECTORY, "Ffs", self.Guid + self.Name)\r
else:\r
self._FfsOutputDir = ''\r
return self._FfsOutputDir\r
for Depex in DepexList:\r
for key in Depex:\r
DepexStr += '[Depex.%s.%s]\n' % key\r
- DepexStr += '\n'.join(['# '+ val for val in Depex[key]])\r
+ DepexStr += '\n'.join('# '+ val for val in Depex[key])\r
DepexStr += '\n\n'\r
if not DepexStr:\r
return '[Depex.%s]\n' % self.Arch\r
DepexStr += ' AND '\r
DepexStr += '('\r
for D in Depex.values():\r
- DepexStr += ' '.join([val for val in D])\r
+ DepexStr += ' '.join(val for val in D)\r
Index = DepexStr.find('END')\r
if Index > -1 and Index == len(DepexStr) - 3:\r
DepexStr = DepexStr[:-3]\r
Pcds = OrderedDict()\r
if not self.IsLibrary:\r
# get PCDs from dependent libraries\r
+ self._LibraryPcdList = []\r
for Library in self.DependentLibraryList:\r
+ PcdsInLibrary = OrderedDict()\r
self.UpdateComments(self._PcdComments, Library.PcdComments)\r
for Key in Library.Pcds:\r
# skip duplicated PCDs\r
if Key in self.Module.Pcds or Key in Pcds:\r
continue\r
Pcds[Key] = copy.copy(Library.Pcds[Key])\r
- # apply PCD settings from platform\r
- self._LibraryPcdList = self.PlatformInfo.ApplyPcdSetting(self.Module, Pcds)\r
+ PcdsInLibrary[Key] = Pcds[Key]\r
+ self._LibraryPcdList.extend(self.PlatformInfo.ApplyPcdSetting(self.Module, PcdsInLibrary, Library=Library))\r
else:\r
self._LibraryPcdList = []\r
return self._LibraryPcdList\r
m.update(GlobalData.gPlatformHash)\r
# Add Package level hash\r
if self.DependentPackageList:\r
- for Pkg in self.DependentPackageList:\r
+ for Pkg in sorted(self.DependentPackageList, key=lambda x: x.PackageName):\r
if Pkg.PackageName in GlobalData.gPackageHash[self.Arch]:\r
m.update(GlobalData.gPackageHash[self.Arch][Pkg.PackageName])\r
\r
# Add Library hash\r
if self.LibraryAutoGenList:\r
- for Lib in self.LibraryAutoGenList:\r
+ for Lib in sorted(self.LibraryAutoGenList, key=lambda x: x.Name):\r
if Lib.Name not in GlobalData.gModuleHash[self.Arch]:\r
Lib.GenModuleHash()\r
m.update(GlobalData.gModuleHash[self.Arch][Lib.Name])\r
m.update(Content)\r
# Add Module's source files\r
if self.SourceFileList:\r
- for File in self.SourceFileList:\r
+ for File in sorted(self.SourceFileList, key=lambda x: str(x)):\r
f = open(str(File), 'r')\r
Content = f.read()\r
f.close()\r