From 40a9066439cbab235933525810f46f03806c6ef1 Mon Sep 17 00:00:00 2001 From: Bob Feng Date: Tue, 8 Jun 2021 10:31:55 +0800 Subject: BaseTools: Enable the flag to treat dynamic pcd as dynamicEx Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1688 In order to support binary build, build tool add a flag to convert type of Dynamic Pcd to DynamicEx Pcd User can append -D PCD_DYNAMIC_AS_DYNAMICEX to build command to enable this function. Also, user can add "PCD_DYNAMIC_AS_DYNAMICEX = TRUE/FALSE" to the defines section of Dsc file to enable this function. PCD_DYNAMIC_AS_DYNAMICEX is a new reserved key word for this function. Signed-off-by: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Michael D Kinney Cc: Nate DeSimone Reviewed-by: Liming Gao --- BaseTools/Source/Python/Workspace/DscBuildData.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/DscBuildData.py') diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 5f07d3e75c..4d5b1ad4d9 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -179,20 +179,6 @@ def GetDependencyList(FileStack, SearchPathList): return DependencyList class DscBuildData(PlatformBuildClassObject): - # dict used to convert PCD type in database to string used by build tool - _PCD_TYPE_STRING_ = { - MODEL_PCD_FIXED_AT_BUILD : TAB_PCDS_FIXED_AT_BUILD, - MODEL_PCD_PATCHABLE_IN_MODULE : TAB_PCDS_PATCHABLE_IN_MODULE, - MODEL_PCD_FEATURE_FLAG : TAB_PCDS_FEATURE_FLAG, - MODEL_PCD_DYNAMIC : TAB_PCDS_DYNAMIC, - MODEL_PCD_DYNAMIC_DEFAULT : TAB_PCDS_DYNAMIC, - MODEL_PCD_DYNAMIC_HII : TAB_PCDS_DYNAMIC_HII, - MODEL_PCD_DYNAMIC_VPD : TAB_PCDS_DYNAMIC_VPD, - MODEL_PCD_DYNAMIC_EX : TAB_PCDS_DYNAMIC_EX, - MODEL_PCD_DYNAMIC_EX_DEFAULT : TAB_PCDS_DYNAMIC_EX, - MODEL_PCD_DYNAMIC_EX_HII : TAB_PCDS_DYNAMIC_EX_HII, - MODEL_PCD_DYNAMIC_EX_VPD : TAB_PCDS_DYNAMIC_EX_VPD, - } # dict used to convert part of [Defines] to members of DscBuildData directly _PROPERTY_ = { @@ -242,7 +228,7 @@ class DscBuildData(PlatformBuildClassObject): self.WorkspaceDir = os.getenv("WORKSPACE") if os.getenv("WORKSPACE") else "" self.DefaultStores = None self.SkuIdMgr = SkuClass(self.SkuName, self.SkuIds) - + self.UpdatePcdTypeDict() @property def OutputPath(self): if os.getenv("WORKSPACE"): @@ -411,6 +397,9 @@ class DscBuildData(PlatformBuildClassObject): except: EdkLogger.error("build", FORMAT_INVALID, "Invalid GUID format for VPD_TOOL_GUID", File=self.MetaFile) self._VpdToolGuid = Record[2] + elif Name == TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX: + if TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX not in gCommandLineDefines: + gCommandLineDefines[TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX] = Record[2].strip() elif Name in self: self[Name] = Record[2] # set _Header to non-None in order to avoid database re-querying -- cgit v1.2.3