From 97cdb33b575a80ca5c20ad862331f3c6d9415575 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Wed, 3 May 2017 15:19:21 +0800 Subject: [PATCH] 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 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- 2.39.2