summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
authorLi, Yi1 <yi1.li@intel.com>2022-07-11 13:48:14 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-07-24 06:46:33 +0000
commitd32a84b5ad8eb5293710ca83dad2b4686479b653 (patch)
tree147f751fcca46262d5b6280630ecbe24b100e0f6 /BaseTools/Source/Python
parent6964b5c48c69e4961bad2dd9d6c02918f23c3be0 (diff)
downloadedk2-d32a84b5ad8eb5293710ca83dad2b4686479b653.tar.gz
edk2-d32a84b5ad8eb5293710ca83dad2b4686479b653.tar.bz2
edk2-d32a84b5ad8eb5293710ca83dad2b4686479b653.zip
BaseTools: INF should use latest Pcd value instead of default value
This patch is a bug fix about FeatureFlagExpression in INF file: INF [Source] section now unconditionally use Pcd default value in DEC when handling FeatureFlagExpression, it is wrong. If a Pcd value has been set in the DSC file, we should use latest value in DSC instead of default value. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yi Li <yi1.li@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r--BaseTools/Source/Python/Workspace/InfBuildData.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py
index 5b9b3d7b4f..e4ff1c6686 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -1084,7 +1084,9 @@ class InfBuildData(ModuleBuildClassObject):
else:
for Name, Guid in self.Pcds:
if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or self.Pcds[(Name, Guid)].Type == 'FixedAtBuild':
- Pcds['%s.%s' % (Guid, Name)] = self.Pcds[(Name, Guid)].DefaultValue
+ PcdFullName = '%s.%s' % (Guid, Name);
+ if not PcdFullName in Pcds:
+ Pcds[PcdFullName] = self.Pcds[(Name, Guid)].DefaultValue
try:
Value = ValueExpression(Instance, Pcds)()
if Value == True: