* [Patch] BaseTools: Remove the duplicate Pcd items
@ 2018-07-17 2:03 Yonghong Zhu
2018-07-18 2:53 ` Gao, Liming
0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-07-17 2:03 UTC (permalink / raw)
To: edk2-devel
The case is the Pcd item both used in 1 module inf and 1 lib inf, and
in the DSC component section, it override the Pcd value.
In the module, the pcd value is the override value, but in the lib inf
the pcd value is the value that in the DSC PCD section's value, then it
cause the Pcd value is different in the module and lib. but actually we
only need use the Pcd value in the module to decide whether it use the
same value.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 289309f..cf53c2b 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1289,11 +1289,11 @@ class PlatformAutoGen(AutoGen):
def CollectFixedAtBuildPcds(self):
for LibAuto in self.LibraryAutoGenList:
FixedAtBuildPcds = {}
ShareFixedAtBuildPcdsSameValue = {}
for Module in LibAuto._ReferenceModules:
- for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds:
+ for Pcd in set(Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds):
DefaultValue = Pcd.DefaultValue
# Cover the case: DSC component override the Pcd value and the Pcd only used in one Lib
if Pcd in Module.LibraryPcdList:
Index = Module.LibraryPcdList.index(Pcd)
DefaultValue = Module.LibraryPcdList[Index].DefaultValue
--
2.6.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] BaseTools: Remove the duplicate Pcd items
2018-07-17 2:03 [Patch] BaseTools: Remove the duplicate Pcd items Yonghong Zhu
@ 2018-07-18 2:53 ` Gao, Liming
0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2018-07-18 2:53 UTC (permalink / raw)
To: Zhu, Yonghong, edk2-devel@lists.01.org
Reviewed-by: Liming Gao <liming.gao@intel.com>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yonghong Zhu
> Sent: Tuesday, July 17, 2018 10:04 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Remove the duplicate Pcd items
>
> The case is the Pcd item both used in 1 module inf and 1 lib inf, and
> in the DSC component section, it override the Pcd value.
> In the module, the pcd value is the override value, but in the lib inf
> the pcd value is the value that in the DSC PCD section's value, then it
> cause the Pcd value is different in the module and lib. but actually we
> only need use the Pcd value in the module to decide whether it use the
> same value.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
> BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index 289309f..cf53c2b 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -1289,11 +1289,11 @@ class PlatformAutoGen(AutoGen):
> def CollectFixedAtBuildPcds(self):
> for LibAuto in self.LibraryAutoGenList:
> FixedAtBuildPcds = {}
> ShareFixedAtBuildPcdsSameValue = {}
> for Module in LibAuto._ReferenceModules:
> - for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds:
> + for Pcd in set(Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds):
> DefaultValue = Pcd.DefaultValue
> # Cover the case: DSC component override the Pcd value and the Pcd only used in one Lib
> if Pcd in Module.LibraryPcdList:
> Index = Module.LibraryPcdList.index(Pcd)
> DefaultValue = Module.LibraryPcdList[Index].DefaultValue
> --
> 2.6.1.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-18 2:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-17 2:03 [Patch] BaseTools: Remove the duplicate Pcd items Yonghong Zhu
2018-07-18 2:53 ` Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox