summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/AutoGen/AutoGen.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-05-10 17:58:26 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-13 09:33:13 +0800
commitec4152cf87002e8dd4ad4d054dc9baa2c886efba (patch)
treef417ff499caebe0ce3a653500cf4eb6e1ca5f88b /BaseTools/Source/Python/AutoGen/AutoGen.py
parentddb0d8609449c0b84a7c76e18758e896aa741744 (diff)
downloadedk2-platforms-ec4152cf87002e8dd4ad4d054dc9baa2c886efba.tar.xz
BaseTools: support private package definition
EDKII build spec and DEC spec updated to support private package definition. If GUID, Protocol or PPI is listed in a DEC file, where the Private modifier is used in the section tag ([Guids.common.Private] for example), only modules within the package are permitted to use the GUID, Protocol or PPI. If a module or library instance outside of the package attempts to use the item, the build must fail with an appropriate error message. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit c28d2e1047816164ffec552e4a3375122cbcc6b6)
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 0664101008..8da441f6b9 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -2174,7 +2174,7 @@ class PlatformAutoGen(AutoGen):
for SkuId in PcdInModule.SkuInfoList:
Sku = PcdInModule.SkuInfoList[SkuId]
if Sku.VariableGuid == '': continue
- Sku.VariableGuidValue = GuidValue(Sku.VariableGuid, self.PackageList)
+ Sku.VariableGuidValue = GuidValue(Sku.VariableGuid, self.PackageList, self.MetaFile.Path)
if Sku.VariableGuidValue == None:
PackageList = "\n\t".join([str(P) for P in self.PackageList])
EdkLogger.error(
@@ -3395,7 +3395,11 @@ class ModuleAutoGen(AutoGen):
PackageDir = mws.join(self.WorkspaceDir, Package.MetaFile.Dir)
if PackageDir not in self._IncludePathList:
self._IncludePathList.append(PackageDir)
- for Inc in Package.Includes:
+ IncludesList = Package.Includes
+ if Package._PrivateIncludes:
+ if not self.MetaFile.Path.startswith(PackageDir):
+ IncludesList = list(set(Package.Includes).difference(set(Package._PrivateIncludes)))
+ for Inc in IncludesList:
if Inc not in self._IncludePathList:
self._IncludePathList.append(str(Inc))
return self._IncludePathList
@@ -3462,7 +3466,7 @@ class ModuleAutoGen(AutoGen):
for SkuName in Pcd.SkuInfoList:
SkuInfo = Pcd.SkuInfoList[SkuName]
Name = ConvertStringToByteArray(SkuInfo.VariableName)
- Value = GuidValue(SkuInfo.VariableGuid, self.PlatformInfo.PackageList)
+ Value = GuidValue(SkuInfo.VariableGuid, self.PlatformInfo.PackageList, self.MetaFile.Path)
if not Value:
continue
Guid = GuidStructureStringToGuidString(Value)