summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
diff options
context:
space:
mode:
authorFan, ZhijuX <zhijux.fan@intel.com>2019-02-19 18:46:41 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-02-20 13:16:56 +0800
commit838bc257bae3f9fc6723f41f3980f6cfbedb77e5 (patch)
treebf7054282d4b01e2d2e65d5c5123dd0e817dc16b /BaseTools/Source/Python/Workspace/WorkspaceCommon.py
parentf635b13853fd13003d563172ba73d026c9fc6f25 (diff)
downloadedk2-838bc257bae3f9fc6723f41f3980f6cfbedb77e5.tar.gz
edk2-838bc257bae3f9fc6723f41f3980f6cfbedb77e5.tar.bz2
edk2-838bc257bae3f9fc6723f41f3980f6cfbedb77e5.zip
BaseTools:BaseTools supports to the driver combination.
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1520 To save the image size without the compression, more than one drivers can be combined into single one. When more than one drivers are combined, their depex will be AND together. Below is the example to combine BootManagerPolicyDxe into DriverHealthManagerDxe. Besides this patch, BaseTools also needs to check the module type and make sure all module type are same. Otherwise, BaseTools will report the error. DRIVER INF has the parameter ENTRY_POINT LIBRARY INF has the parameter LIBRARY_CLASS Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/WorkspaceCommon.py')
-rw-r--r--BaseTools/Source/Python/Workspace/WorkspaceCommon.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
index b79280bc2e..22abda8743 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
@@ -20,6 +20,8 @@ from Workspace.BuildClassObject import StructurePcd
from Common.BuildToolError import RESOURCE_NOT_AVAILABLE
from Common.BuildToolError import OPTION_MISSING
from Common.BuildToolError import BUILD_ERROR
+from Common.BuildToolError import PREBUILD_ERROR
+import Common.EdkLogger as EdkLogError
class OrderedListDict(OrderedDict):
def __init__(self, *args, **kwargs):
@@ -138,6 +140,12 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, Toolcha
return []
LibraryModule = BuildDatabase[LibraryPath, Arch, Target, Toolchain]
+ if LibraryModule.ModuleEntryPointList and LibraryModule.ModuleType != Module.ModuleType:
+ EdkLogError.error(
+ "build", PREBUILD_ERROR,
+ "Driver's ModuleType must be consistent [%s]" % (str(Module)),
+ File=str(FileName),
+ ExtraData="consumed by [%s]" % str(LibraryModule))
# for those forced library instance (NULL library), add a fake library class
if LibraryClassName.startswith("NULL"):
LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, [ModuleType]))