diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2015-10-26 03:26:55 +0000 |
---|---|---|
committer | yzhu52 <yzhu52@Edk2> | 2015-10-26 03:26:55 +0000 |
commit | 7beed8a3dac971d424adcb2d2139b87b0865950d (patch) | |
tree | d34d34645b68015337392e5053f311919f3c0ccf /BaseTools/Source | |
parent | 9382b53a23d210162008e3f434590de830a25698 (diff) | |
download | edk2-platforms-7beed8a3dac971d424adcb2d2139b87b0865950d.tar.xz |
BaseTools:added extern protocol/PPI/GUID definition in AutoGen for Library
We already added the extern declaration for protocols/PPI/GUID in AutoGen.h
file for driver, but missing this feature for the Library. so this patch
add it.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18661 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenC.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py index 77de1657f0..45fb9899f2 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -1384,22 +1384,21 @@ def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH): # @param AutoGenH The TemplateString object for header file
#
def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
GuidType = "GUID"
else:
GuidType = "EFI_GUID"
if Info.GuidList:
- AutoGenC.Append("\n// Guids\n")
+ if not Info.IsLibrary:
+ AutoGenC.Append("\n// Guids\n")
AutoGenH.Append("\n// Guids\n")
#
# GUIDs
#
for Key in Info.GuidList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.GuidList[Key]))
+ if not Info.IsLibrary:
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.GuidList[Key]))
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
## Create code for protocol
@@ -1409,22 +1408,21 @@ def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH): # @param AutoGenH The TemplateString object for header file
#
def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
GuidType = "GUID"
else:
GuidType = "EFI_GUID"
if Info.ProtocolList:
- AutoGenC.Append("\n// Protocols\n")
+ if not Info.IsLibrary:
+ AutoGenC.Append("\n// Protocols\n")
AutoGenH.Append("\n// Protocols\n")
#
# Protocol GUIDs
#
for Key in Info.ProtocolList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.ProtocolList[Key]))
+ if not Info.IsLibrary:
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.ProtocolList[Key]))
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
## Create code for PPI
@@ -1434,22 +1432,21 @@ def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH): # @param AutoGenH The TemplateString object for header file
#
def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
GuidType = "GUID"
else:
GuidType = "EFI_GUID"
if Info.PpiList:
- AutoGenC.Append("\n// PPIs\n")
+ if not Info.IsLibrary:
+ AutoGenC.Append("\n// PPIs\n")
AutoGenH.Append("\n// PPIs\n")
#
# PPI GUIDs
#
for Key in Info.PpiList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.PpiList[Key]))
+ if not Info.IsLibrary:
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.PpiList[Key]))
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
## Create code for PCD
|