summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-05-03 15:19:21 +0800
committerGuo Mang <mang.guo@intel.com>2017-07-12 11:24:36 +0800
commitfde44e882c69f239384401ef73e41af1559bdb06 (patch)
treedbd07596da02bc7227b164f99c54c92fc8284e2f /BaseTools
parentebecee0a89978fedcc491781b1c1777300e1f4cc (diff)
downloadedk2-platforms-fde44e882c69f239384401ef73e41af1559bdb06.tar.xz
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 <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>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py16
1 files changed, 16 insertions, 0 deletions
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