mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +02:00
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
This commit is contained in:
parent
9382b53a23
commit
7beed8a3da
@ -1384,22 +1384,21 @@ def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH):
|
|||||||
# @param AutoGenH The TemplateString object for header file
|
# @param AutoGenH The TemplateString object for header file
|
||||||
#
|
#
|
||||||
def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):
|
def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):
|
||||||
if Info.IsLibrary:
|
|
||||||
return
|
|
||||||
|
|
||||||
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
|
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
|
||||||
GuidType = "GUID"
|
GuidType = "GUID"
|
||||||
else:
|
else:
|
||||||
GuidType = "EFI_GUID"
|
GuidType = "EFI_GUID"
|
||||||
|
|
||||||
if Info.GuidList:
|
if Info.GuidList:
|
||||||
AutoGenC.Append("\n// Guids\n")
|
if not Info.IsLibrary:
|
||||||
|
AutoGenC.Append("\n// Guids\n")
|
||||||
AutoGenH.Append("\n// Guids\n")
|
AutoGenH.Append("\n// Guids\n")
|
||||||
#
|
#
|
||||||
# GUIDs
|
# GUIDs
|
||||||
#
|
#
|
||||||
for Key in Info.GuidList:
|
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))
|
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
|
||||||
|
|
||||||
## Create code for protocol
|
## Create code for protocol
|
||||||
@ -1409,22 +1408,21 @@ def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):
|
|||||||
# @param AutoGenH The TemplateString object for header file
|
# @param AutoGenH The TemplateString object for header file
|
||||||
#
|
#
|
||||||
def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):
|
def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):
|
||||||
if Info.IsLibrary:
|
|
||||||
return
|
|
||||||
|
|
||||||
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
|
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
|
||||||
GuidType = "GUID"
|
GuidType = "GUID"
|
||||||
else:
|
else:
|
||||||
GuidType = "EFI_GUID"
|
GuidType = "EFI_GUID"
|
||||||
|
|
||||||
if Info.ProtocolList:
|
if Info.ProtocolList:
|
||||||
AutoGenC.Append("\n// Protocols\n")
|
if not Info.IsLibrary:
|
||||||
|
AutoGenC.Append("\n// Protocols\n")
|
||||||
AutoGenH.Append("\n// Protocols\n")
|
AutoGenH.Append("\n// Protocols\n")
|
||||||
#
|
#
|
||||||
# Protocol GUIDs
|
# Protocol GUIDs
|
||||||
#
|
#
|
||||||
for Key in Info.ProtocolList:
|
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))
|
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
|
||||||
|
|
||||||
## Create code for PPI
|
## Create code for PPI
|
||||||
@ -1434,22 +1432,21 @@ def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):
|
|||||||
# @param AutoGenH The TemplateString object for header file
|
# @param AutoGenH The TemplateString object for header file
|
||||||
#
|
#
|
||||||
def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):
|
def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):
|
||||||
if Info.IsLibrary:
|
|
||||||
return
|
|
||||||
|
|
||||||
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
|
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
|
||||||
GuidType = "GUID"
|
GuidType = "GUID"
|
||||||
else:
|
else:
|
||||||
GuidType = "EFI_GUID"
|
GuidType = "EFI_GUID"
|
||||||
|
|
||||||
if Info.PpiList:
|
if Info.PpiList:
|
||||||
AutoGenC.Append("\n// PPIs\n")
|
if not Info.IsLibrary:
|
||||||
|
AutoGenC.Append("\n// PPIs\n")
|
||||||
AutoGenH.Append("\n// PPIs\n")
|
AutoGenH.Append("\n// PPIs\n")
|
||||||
#
|
#
|
||||||
# PPI GUIDs
|
# PPI GUIDs
|
||||||
#
|
#
|
||||||
for Key in Info.PpiList:
|
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))
|
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
|
||||||
|
|
||||||
## Create code for PCD
|
## Create code for PCD
|
||||||
|
Loading…
x
Reference in New Issue
Block a user