diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-04-12 10:31:55 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-04-20 09:24:46 +0800 |
commit | 2a29017e3e305a10ee1003354c0d0c037923341d (patch) | |
tree | 2890a5b03585f6883ac045a2e98c82b261acd436 /BaseTools/Source/Python/Workspace/WorkspaceCommon.py | |
parent | 90bb4c577d055e7ac6f0488b21885f65617eec82 (diff) | |
download | edk2-platforms-2a29017e3e305a10ee1003354c0d0c037923341d.tar.xz |
BaseTools: Add mixed PCD support feature
Problem statement:
The current build system requires that a PCD must use the same access
method for all modules. A Binary Module may use a different PCD access
method than: 1.A source tree build it is integrated into. 2.Other Binary
Modules in platform build that use the same PCD.
Solution:
1. Source build:
No change. PCDs must use the same access method for building all Source
Modules.
2. Mixed Source & Binary Builds or Binary Only Builds:
1) Source Modules - No changes
2) Module that is interpreted as a Binary Module
a.DSC file may optionally override default value of PatchableInModule
PCDs in scope of Binary Module.
b.DSC file must declare DynamicEx PCD subtype for all DynamicEx PCDs
from Binary Modules.
c.FDF file must list Binary Module INF
Build update:
1. PCDs in a binary module are permitted to use the PatchableInModule
or DynamicEx access methods (the Binary INF clearly identifies the PCD
access method for each PCD). The build must support binary modules that
use the same or different PCD access method than the Source INFs or
other Binary INFs.
2. Build report list PCDs that have mixed PCD access methods.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@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.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py index 60acc914e9..c224b8e0e6 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py @@ -1,7 +1,7 @@ ## @file
# Common routines used by workspace
#
-# Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -14,6 +14,7 @@ from Common.Misc import sdict
from Common.DataType import SUP_MODULE_USER_DEFINED
from BuildClassObject import LibraryClassObject
+import Common.GlobalData as GlobalData
## Get all packages from platform for specified arch, target and toolchain
#
@@ -47,7 +48,15 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain): DecPcds = {}
for Pkg in PkgList:
for Pcd in Pkg.Pcds:
- DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]
+ PcdCName = Pcd[0]
+ PcdTokenName = Pcd[1]
+ if GlobalData.MixedPcd:
+ for PcdItem in GlobalData.MixedPcd.keys():
+ if (PcdCName, PcdTokenName) in GlobalData.MixedPcd[PcdItem]:
+ PcdCName = PcdItem[0]
+ break
+ if (PcdCName, PcdTokenName) not in DecPcds.keys():
+ DecPcds[PcdCName, PcdTokenName] = Pkg.Pcds[Pcd]
return DecPcds
## Get all dependent libraries for a module
|