\r
# generate the SourcePcdDict and BinaryPcdDict\r
PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)\r
- for BuildData in PGen.BuildDatabase._CACHE_.values():\r
+ for BuildData in list(PGen.BuildDatabase._CACHE_.values()):\r
if BuildData.Arch != Arch:\r
continue\r
if BuildData.MetaFile.Ext == '.inf':\r
if NewPcd2 not in GlobalData.MixedPcd[item]:\r
GlobalData.MixedPcd[item].append(NewPcd2)\r
\r
- for BuildData in PGen.BuildDatabase._CACHE_.values():\r
+ for BuildData in list(PGen.BuildDatabase._CACHE_.values()):\r
if BuildData.Arch != Arch:\r
continue\r
for key in BuildData.Pcds:\r
#\r
@cached_class_function\r
def CreateCodeFile(self, CreateModuleCodeFile=False):\r
- # only module has code to be greated, so do nothing if CreateModuleCodeFile is False\r
+ # only module has code to be created, so do nothing if CreateModuleCodeFile is False\r
if not CreateModuleCodeFile:\r
return\r
\r
PcdName,PcdGuid = PcdNvStoreDfBuffer[0].TokenCName, PcdNvStoreDfBuffer[0].TokenSpaceGuidCName\r
if (PcdName,PcdGuid) in VpdSkuMap:\r
DefaultSku = PcdNvStoreDfBuffer[0].SkuInfoList.get(TAB_DEFAULT)\r
- VpdSkuMap[(PcdName,PcdGuid)] = {DefaultSku.DefaultValue:[DefaultSku]}\r
+ VpdSkuMap[(PcdName,PcdGuid)] = {DefaultSku.DefaultValue:[SkuObj for SkuObj in PcdNvStoreDfBuffer[0].SkuInfoList.values() ]}\r
\r
# Process VPD map file generated by third party BPDG tool\r
if NeedProcessVpdMapFile:\r
\r
## Get tool chain definition\r
#\r
- # Get each tool defition for given tool chain from tools_def.txt and platform\r
+ # Get each tool definition for given tool chain from tools_def.txt and platform\r
#\r
@cached_property\r
def ToolDefinition(self):\r
\r
## Override PCD setting (type, value, ...)\r
#\r
- # @param ToPcd The PCD to be overrided\r
- # @param FromPcd The PCD overrideing from\r
+ # @param ToPcd The PCD to be overridden\r
+ # @param FromPcd The PCD overriding from\r
#\r
def _OverridePcd(self, ToPcd, FromPcd, Module="", Msg="", Library=""):\r
#\r
\r
## Apply PCD setting defined platform to a module\r
#\r
- # @param Module The module from which the PCD setting will be overrided\r
+ # @param Module The module from which the PCD setting will be overridden\r
#\r
# @retval PCD_list The list PCDs with settings from platform\r
#\r
\r
## Append build options in platform to a module\r
#\r
- # @param Module The module to which the build options will be appened\r
+ # @param Module The module to which the build options will be appended\r
#\r
# @retval options The options appended with build options in platform\r
#\r
self.SourceDir = mws.relpath(self.SourceDir, self.WorkspaceDir)\r
\r
self.SourceOverrideDir = None\r
- # use overrided path defined in DSC file\r
+ # use overridden path defined in DSC file\r
if self.MetaFile.Key in GlobalData.gOverrideDir:\r
self.SourceOverrideDir = GlobalData.gOverrideDir[self.MetaFile.Key]\r
\r
def Guid(self):\r
#\r
# To build same module more than once, the module path with FILE_GUID overridden has\r
- # the file name FILE_GUIDmodule.inf, but the relative path (self.MetaFile.File) is the realy path\r
+ # the file name FILE_GUIDmodule.inf, but the relative path (self.MetaFile.File) is the real path\r
# in DSC. The overridden GUID can be retrieved from file name\r
#\r
if os.path.basename(self.MetaFile.File) != os.path.basename(self.MetaFile.Path):\r
self.MetaFile.BaseName\r
))\r
\r
- ## Return the directory to store the intermediate object files of the mdoule\r
+ ## Return the directory to store the intermediate object files of the module\r
@cached_property\r
def OutputDir(self):\r
return _MakeDir((self.BuildDir, "OUTPUT"))\r
return path.join(self.PlatformInfo.BuildDir, TAB_FV_DIRECTORY, "Ffs", self.Guid + self.Name)\r
return ''\r
\r
- ## Return the directory to store auto-gened source files of the mdoule\r
+ ## Return the directory to store auto-gened source files of the module\r
@cached_property\r
def DebugDir(self):\r
return _MakeDir((self.BuildDir, "DEBUG"))\r
\r
## Get the depex string\r
#\r
- # @return : a string contain all depex expresion.\r
+ # @return : a string contain all depex expression.\r
def _GetDepexExpresionString(self):\r
DepexStr = ''\r
DepexList = []\r
for M in [self.Module] + self.DependentLibraryList:\r
Filename = M.MetaFile.Path\r
InfObj = InfSectionParser.InfSectionParser(Filename)\r
- DepexExpresionList = InfObj.GetDepexExpresionList()\r
- for DepexExpresion in DepexExpresionList:\r
- for key in DepexExpresion:\r
+ DepexExpressionList = InfObj.GetDepexExpresionList()\r
+ for DepexExpression in DepexExpressionList:\r
+ for key in DepexExpression:\r
Arch, ModuleType = key\r
- DepexExpr = [x for x in DepexExpresion[key] if not str(x).startswith('#')]\r
+ DepexExpr = [x for x in DepexExpression[key] if not str(x).startswith('#')]\r
# the type of build module is USER_DEFINED.\r
# All different DEPEX section tags would be copied into the As Built INF file\r
# and there would be separate DEPEX section tags\r
\r
DepexList = []\r
#\r
- # Append depex from dependent libraries, if not "BEFORE", "AFTER" expresion\r
+ # Append depex from dependent libraries, if not "BEFORE", "AFTER" expression\r
#\r
for M in [self.Module] + self.DependentLibraryList:\r
Inherited = False\r
if '.' not in item:\r
NewList.append(item)\r
else:\r
- if item not in self.FixedVoidTypePcds:\r
+ FixedVoidTypePcds = {}\r
+ if item in self.FixedVoidTypePcds:\r
+ FixedVoidTypePcds = self.FixedVoidTypePcds\r
+ elif M in self.PlatformInfo.LibraryAutoGenList:\r
+ Index = self.PlatformInfo.LibraryAutoGenList.index(M)\r
+ FixedVoidTypePcds = self.PlatformInfo.LibraryAutoGenList[Index].FixedVoidTypePcds\r
+ if item not in FixedVoidTypePcds:\r
EdkLogger.error("build", FORMAT_INVALID, "{} used in [Depex] section should be used as FixedAtBuild type and VOID* datum type in the module.".format(item))\r
else:\r
- Value = self.FixedVoidTypePcds[item]\r
+ Value = FixedVoidTypePcds[item]\r
if len(Value.split(',')) != 16:\r
EdkLogger.error("build", FORMAT_INVALID,\r
"{} used in [Depex] section should be used as FixedAtBuild type and VOID* datum type and 16 bytes in the module.".format(item))\r
IdfGenBinBuffer.close()\r
return RetVal\r
\r
- ## Return the list of library modules explicitly or implicityly used by this module\r
+ ## Return the list of library modules explicitly or implicitly used by this module\r
@cached_property\r
def DependentLibraryList(self):\r
# only merge library classes and PCD for non-library module\r
AsBuiltInfDict['userextension_tianocore_item'] = UserExtStr\r
\r
# Generated depex expression section in comments.\r
- DepexExpresion = self._GetDepexExpresionString()\r
- AsBuiltInfDict['depexsection_item'] = DepexExpresion if DepexExpresion else ''\r
+ DepexExpression = self._GetDepexExpresionString()\r
+ AsBuiltInfDict['depexsection_item'] = DepexExpression if DepexExpression else ''\r
\r
AsBuiltInf = TemplateString()\r
AsBuiltInf.Append(gAsBuiltInfHeaderString.Replace(AsBuiltInfDict))\r