-\r
-def _ResolveLibraryReference(Module, Platform):\r
- LibraryConsumerList = [Module]\r
-\r
- # "CompilerStub" is a must for Edk modules\r
- if Module.Libraries:\r
- Module.Libraries.append("CompilerStub")\r
- LibraryList = []\r
- while len(LibraryConsumerList) > 0:\r
- M = LibraryConsumerList.pop()\r
- for LibraryName in M.Libraries:\r
- Library = Platform.LibraryClasses[LibraryName, ':dummy:']\r
- if Library is None:\r
- for Key in Platform.LibraryClasses.data.keys():\r
- if LibraryName.upper() == Key.upper():\r
- Library = Platform.LibraryClasses[Key, ':dummy:']\r
- break\r
- if Library is None:\r
- continue\r
-\r
- if Library not in LibraryList:\r
- LibraryList.append(Library)\r
- LibraryConsumerList.append(Library)\r
- return LibraryList\r