From: Yonghong Zhu Date: Wed, 3 May 2017 07:19:21 +0000 (+0800) Subject: BaseTools: PCD can only use single access method by source build X-Git-Tag: edk2-stable201903~4069 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=97cdb33b575a80ca5c20ad862331f3c6d9415575 BaseTools: PCD can only use single access method by source build Add the error check that A PCD can only use one type for all source modules. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 8075afc91d..205a75dc80 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -504,6 +504,22 @@ class WorkspaceAutoGen(AutoGen): SourcePcdDict['FixedAtBuild'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName)) else: pass + # + # A PCD can only use one type for all source modules + # + for i in SourcePcdDict_Keys: + for j in SourcePcdDict_Keys: + if i != j: + IntersectionList = list(set(SourcePcdDict[i]).intersection(set(SourcePcdDict[j]))) + if len(IntersectionList) > 0: + EdkLogger.error( + 'build', + FORMAT_INVALID, + "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), + ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in IntersectionList]) + ) + else: + pass # # intersection the BinaryPCD for Mixed PCD