diff options
author | Feng, Bob C <bob.c.feng@intel.com> | 2018-01-29 14:09:36 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-02-01 09:21:45 +0800 |
commit | 81add864f4af238a2dfb702904a6abec12738b9d (patch) | |
tree | 09c4e62ecbc1e16db17b125544fb2ac5e4d07c38 /BaseTools/Source/Python | |
parent | 5db9414cc1b9b449c70a974f0aa0d17b41d09629 (diff) | |
download | edk2-81add864f4af238a2dfb702904a6abec12738b9d.tar.gz edk2-81add864f4af238a2dfb702904a6abec12738b9d.tar.bz2 edk2-81add864f4af238a2dfb702904a6abec12738b9d.zip |
BaseTools: Support multiple .h file
for structure Pcd declaration in DEC file.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python')
4 files changed, 9 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTools/Source/Python/Workspace/BuildClassObject.py index 3afb27a9c0..0e1161c96f 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -115,7 +115,7 @@ class StructurePcd(PcdClassObject): if validlists is None: validlists=[]
if expressions is None : expressions=[]
super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validateranges, validlists, expressions)
- self.StructuredPcdIncludeFile = StructuredPcdIncludeFile
+ self.StructuredPcdIncludeFile = [] if StructuredPcdIncludeFile is None else StructuredPcdIncludeFile
self.PackageDecs = Packages
self.DefaultStoreName = [default_store]
self.DefaultValues = collections.OrderedDict({})
diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py b/BaseTools/Source/Python/Workspace/DecBuildData.py index f6b908dee6..2fd3820dcc 100644 --- a/BaseTools/Source/Python/Workspace/DecBuildData.py +++ b/BaseTools/Source/Python/Workspace/DecBuildData.py @@ -376,7 +376,7 @@ class DecBuildData(PackageBuildClassObject): struct_pcd = StructurePcd()
for item,LineNo in s_pcd_set[pcdname]:
if "<HeaderFiles>" in item.TokenCName:
- struct_pcd.StructuredPcdIncludeFile = item.DefaultValue
+ struct_pcd.StructuredPcdIncludeFile.append(item.DefaultValue)
elif "<Packages>" in item.TokenCName:
dep_pkgs.append(item.DefaultValue)
elif item.DatumType == item.TokenCName:
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 8c5afb5bf4..84f7b6a237 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1470,10 +1470,10 @@ class DscBuildData(PlatformBuildClassObject): Includes = {}
for PcdName in StructuredPcds:
Pcd = StructuredPcds[PcdName]
- IncludeFile = Pcd.StructuredPcdIncludeFile
- if IncludeFile not in Includes:
- Includes[IncludeFile] = True
- CApp = CApp + '#include <%s>\n' % (IncludeFile)
+ for IncludeFile in Pcd.StructuredPcdIncludeFile:
+ if IncludeFile not in Includes:
+ Includes[IncludeFile] = True
+ CApp = CApp + '#include <%s>\n' % (IncludeFile)
CApp = CApp + '\n'
for PcdName in StructuredPcds:
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index c928cef70f..57642de4ee 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1893,22 +1893,24 @@ class DecParser(MetaFileParser): if "|" not in self._CurrentLine:
if "<HeaderFiles>" == self._CurrentLine:
self._include_flag = True
+ self._package_flag = False
self._ValueList = None
return
if "<Packages>" == self._CurrentLine:
self._package_flag = True
self._ValueList = None
+ self._include_flag = False
return
if self._include_flag:
self._ValueList[1] = "<HeaderFiles>_" + md5.new(self._CurrentLine).hexdigest()
self._ValueList[2] = self._CurrentLine
- self._include_flag = False
if self._package_flag and "}" != self._CurrentLine:
self._ValueList[1] = "<Packages>_" + md5.new(self._CurrentLine).hexdigest()
self._ValueList[2] = self._CurrentLine
if self._CurrentLine == "}":
self._package_flag = False
+ self._include_flag = False
self._ValueList = None
return
else:
|