X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FAutoGen.py;h=6711880f60372f2781f8a6a03183de4abe95690f;hp=3261892bc55dbdcf8c9f883b716dbfc4cb7bdda1;hb=4afd3d042215afe68d00b9ab8c32f063a3a1c03f;hpb=a365eed476687881ce0ed49af7d483fd3cb0c491 diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 3261892bc5..6711880f60 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -293,12 +293,13 @@ class WorkspaceAutoGen(AutoGen): Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain] DecPcds = {} + DecPcdsKey = set() PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch) Pkgs = PGen.PackageList for Pkg in Pkgs: for Pcd in Pkg.Pcds: DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd] - Platform.IsPlatformPcdDeclared(DecPcds) + DecPcdsKey.add((Pcd[0], Pcd[1], Pcd[2])) Platform.SkuName = self.SkuId for Name, Guid in PcdSet: @@ -310,7 +311,21 @@ class WorkspaceAutoGen(AutoGen): File = self.FdfProfile.PcdFileLineDict[Name, Guid][0], Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1] ) - Platform.AddPcd(Name, Guid, PcdSet[Name, Guid]) + else: + # Check whether Dynamic or DynamicEx PCD used in FDF file. If used, build break and give a error message. + if (Name, Guid, TAB_PCDS_FIXED_AT_BUILD) in DecPcdsKey \ + or (Name, Guid, TAB_PCDS_PATCHABLE_IN_MODULE) in DecPcdsKey \ + or (Name, Guid, TAB_PCDS_FEATURE_FLAG) in DecPcdsKey: + Platform.AddPcd(Name, Guid, PcdSet[Name, Guid]) + continue + elif (Name, Guid, TAB_PCDS_DYNAMIC) in DecPcdsKey or (Name, Guid, TAB_PCDS_DYNAMIC_EX) in DecPcdsKey: + EdkLogger.error( + 'build', + PARSER_ERROR, + "Using Dynamic or DynamicEx type of PCD [%s.%s] in FDF file is not allowed." % (Guid, Name), + File = self.FdfProfile.PcdFileLineDict[Name, Guid][0], + Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1] + ) Pa = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch) #