]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools:Build fail if define [DEPEX] in library inf
authorFan, ZhijuX <zhijux.fan@intel.com>
Thu, 21 Feb 2019 01:33:55 +0000 (09:33 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Fri, 22 Feb 2019 07:47:14 +0000 (15:47 +0800)
When define [DEPEX] in lib inf to build, it will fail and report"
gUefiOvmfPkgTokenSpaceGuid.test1 used in [Depex] section should be
used as FixedAtBuild type and VOID* datum type in the module."
But we define this PCD to FixedAtBuild type and VOID* datum type indeed.

DEC:
[PcdsFixedAtBuild]
gUefiOvmfPkgTokenSpaceGuid.test1 |
{GUID("4096267b-da0a-42eb-b5eb-fef31d207cb4")}|VOID*|0x3c

DSC:
add pcd under lib inf as below:

NULL|TestPkg/TestLib/TestLib.inf
 <PcdsFixedAtBuild>
    gUefiOvmfPkgTokenSpaceGuid.test1 | {GUID(gUefiOvmfPkgTokenSpaceGuid)}

Lib inf:(TestPkg/TestLib/TestLib.inf)
[Depex]
gUefiOvmfPkgTokenSpaceGuid.test1
[FixedPcd]
gUefiOvmfPkgTokenSpaceGuid.test1

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py

index f71e08d7154dbff37595a63b4b3dd8d8732ca1f3..e7dbf66e2f2582154cff312d3775eda9e898267e 100644 (file)
@@ -2892,10 +2892,16 @@ class ModuleAutoGen(AutoGen):
                     if '.' not in item:\r
                         NewList.append(item)\r
                     else:\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
                             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
                             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