diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-20 23:51:35 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-05-02 14:56:34 +0800 |
commit | ee1ca53df6547a3d1339dc905c8ec6df51e00f05 (patch) | |
tree | bb2922fe0dedb2da46e6790aee2f4f0b818b507f /BaseTools/Source/Python/Workspace | |
parent | 88c6c1b64ca51f67fa9c524f3ab5efcad2e6ba22 (diff) | |
download | edk2-ee1ca53df6547a3d1339dc905c8ec6df51e00f05.tar.gz edk2-ee1ca53df6547a3d1339dc905c8ec6df51e00f05.tar.bz2 edk2-ee1ca53df6547a3d1339dc905c8ec6df51e00f05.zip |
BaseTools: Share a dictionary instead of keeping multiples
Move a dictionary to a shared location and use from there
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace')
-rw-r--r-- | BaseTools/Source/Python/Workspace/InfBuildData.py | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py index f2d36d0ee0..d64a281a98 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -66,26 +66,6 @@ class InfBuildData(ModuleBuildClassObject): TAB_COMPONENTS_SOURCE_OVERRIDE_PATH : "_SourceOverridePath",
}
- # dict used to convert Component type to Module type
- _MODULE_TYPE_ = {
- "LIBRARY" : SUP_MODULE_BASE,
- "SECURITY_CORE" : SUP_MODULE_SEC,
- SUP_MODULE_PEI_CORE : SUP_MODULE_PEI_CORE,
- "COMBINED_PEIM_DRIVER" : SUP_MODULE_PEIM,
- "PIC_PEIM" : SUP_MODULE_PEIM,
- "RELOCATABLE_PEIM" : SUP_MODULE_PEIM,
- "PE32_PEIM" : SUP_MODULE_PEIM,
- "BS_DRIVER" : SUP_MODULE_DXE_DRIVER,
- "RT_DRIVER" : SUP_MODULE_DXE_RUNTIME_DRIVER,
- "SAL_RT_DRIVER" : SUP_MODULE_DXE_SAL_DRIVER,
- SUP_MODULE_DXE_SMM_DRIVER : SUP_MODULE_DXE_SMM_DRIVER,
- # "SMM_DRIVER" : SUP_MODULE_DXE_SMM_DRIVER,
- # "BS_DRIVER" : SUP_MODULE_DXE_SMM_DRIVER,
- # "BS_DRIVER" : SUP_MODULE_UEFI_DRIVER,
- "APPLICATION" : SUP_MODULE_UEFI_APPLICATION,
- "LOGO" : SUP_MODULE_BASE,
- }
-
# regular expression for converting XXX_FLAGS in [nmake] section to new type
_NMAKE_FLAG_PATTERN_ = re.compile("(?:EBC_)?([A-Z]+)_(?:STD_|PROJ_|ARCH_)?FLAGS(?:_DLL|_ASL|_EXE)?", re.UNICODE)
# dict used to convert old tool name used in [nmake] section to new ones
@@ -362,8 +342,8 @@ class InfBuildData(ModuleBuildClassObject): EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,
"COMPONENT_TYPE is not given", File=self.MetaFile)
self._BuildType = self._ComponentType.upper()
- if self._ComponentType in self._MODULE_TYPE_:
- self._ModuleType = self._MODULE_TYPE_[self._ComponentType]
+ if self._ComponentType in COMPONENT_TO_MODULE_MAP_DICT:
+ self._ModuleType = COMPONENT_TO_MODULE_MAP_DICT[self._ComponentType]
if self._ComponentType == 'LIBRARY':
self._LibraryClass = [LibraryClassObject(self._BaseName, SUP_MODULE_LIST)]
# make use some [nmake] section macros
|