]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: PCD can only use single access method by source build
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 3 May 2017 07:19:21 +0000 (15:19 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Sat, 6 May 2017 15:27:07 +0000 (23:27 +0800)
Add the error check that A PCD can only use one type for all source
modules.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py

index 8075afc91d643c1ce1d3fe9dabc2924e244124b8..205a75dc805104bdf46ff0cf54a276a98f8225a2 100644 (file)
@@ -504,6 +504,22 @@ class WorkspaceAutoGen(AutoGen):
                                 SourcePcdDict['FixedAtBuild'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName))\r
                 else:\r
                     pass\r
                                 SourcePcdDict['FixedAtBuild'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName))\r
                 else:\r
                     pass\r
+            #\r
+            # A PCD can only use one type for all source modules\r
+            #\r
+            for i in SourcePcdDict_Keys:\r
+                for j in SourcePcdDict_Keys:\r
+                    if i != j:\r
+                        IntersectionList = list(set(SourcePcdDict[i]).intersection(set(SourcePcdDict[j])))\r
+                        if len(IntersectionList) > 0:\r
+                            EdkLogger.error(\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 IntersectionList])\r
+                            )\r
+                    else:\r
+                        pass\r
 \r
             #\r
             # intersection the BinaryPCD for Mixed PCD\r
 \r
             #\r
             # intersection the BinaryPCD for Mixed PCD\r