## @file\r
# This file is used to create a database used by build tool\r
#\r
-# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
from Common.DataType import *\r
from Common.Misc import *\r
from types import *\r
+from collections import OrderedDict\r
\r
from Workspace.BuildClassObject import PackageBuildClassObject, StructurePcd, PcdClassObject\r
\r
self._Ppis = None\r
self._Guids = None\r
self._Includes = None\r
+ self._CommonIncludes = None\r
self._LibraryClasses = None\r
self._Pcds = None\r
self.__Macros = None\r
\r
## Retrieve public include paths declared in this package\r
def _GetInclude(self):\r
- if self._Includes == None:\r
+ if self._Includes == None or self._CommonIncludes is None:\r
+ self._CommonIncludes = []\r
self._Includes = []\r
self._PrivateIncludes = []\r
PublicInclues = []\r
PublicInclues.append(File)\r
if File in self._PrivateIncludes:\r
EdkLogger.error('build', OPTION_CONFLICT, "Can't determine %s's attribute, it is both defined as Private and non-Private attribute in DEC file." % File, File=self.MetaFile, Line=LineNo)\r
-\r
+ if Record[3] == "COMMON":\r
+ self._CommonIncludes.append(File)\r
return self._Includes\r
\r
## Retrieve library class declarations (not used in build at present)\r
\r
\r
def ProcessStructurePcd(self, StructurePcdRawDataSet):\r
- s_pcd_set = dict()\r
+ s_pcd_set = OrderedDict()\r
for s_pcd,LineNo in StructurePcdRawDataSet:\r
if s_pcd.TokenSpaceGuidCName not in s_pcd_set:\r
s_pcd_set[s_pcd.TokenSpaceGuidCName] = []\r
struct_pcd = StructurePcd()\r
for item,LineNo in s_pcd_set[pcdname]:\r
if "<HeaderFiles>" in item.TokenCName:\r
- struct_pcd.StructuredPcdIncludeFile = item.DefaultValue\r
+ struct_pcd.StructuredPcdIncludeFile.append(item.DefaultValue)\r
elif "<Packages>" in item.TokenCName:\r
dep_pkgs.append(item.DefaultValue)\r
elif item.DatumType == item.TokenCName:\r
struct_pcd.copy(item)\r
struct_pcd.TokenValue = struct_pcd.TokenValue.strip("{").strip()\r
struct_pcd.TokenSpaceGuidCName, struct_pcd.TokenCName = pcdname.split(".")\r
+ struct_pcd.PcdDefineLineNo = LineNo\r
+ struct_pcd.PkgPath = self.MetaFile.File\r
+ struct_pcd.SetDecDefaultValue(item.DefaultValue)\r
else:\r
struct_pcd.AddDefaultValue(item.TokenCName, item.DefaultValue,self.MetaFile.File,LineNo)\r
\r
struct_pcd.PackageDecs = dep_pkgs\r
+ if not struct_pcd.StructuredPcdIncludeFile:\r
+ EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "The structure Pcd %s.%s header file is not found in %s line %s \n" % (struct_pcd.TokenSpaceGuidCName, struct_pcd.TokenCName,self.MetaFile.File,LineNo ))\r
\r
str_pcd_set.append(struct_pcd)\r
\r
Pcds[pcd.TokenCName, pcd.TokenSpaceGuidCName, self._PCD_TYPE_STRING_[Type]] = pcd\r
\r
return Pcds\r
+ @property\r
+ def CommonIncludes(self):\r
+ if self._CommonIncludes is None:\r
+ self.Includes\r
+ return self._CommonIncludes\r
\r
\r
_Macros = property(_GetMacros)\r