From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EB0D021D1B2A4 for ; Wed, 31 Jan 2018 04:13:48 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 04:19:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,440,1511856000"; d="scan'208";a="200225870" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 31 Jan 2018 04:19:24 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 31 Jan 2018 04:19:24 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 31 Jan 2018 04:19:24 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.145]) with mapi id 14.03.0319.002; Wed, 31 Jan 2018 20:19:22 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Support multiple .h file Thread-Index: AQHTmMfC9GLIEQjDOkW+0L+y/gzqe6ON6eAw Date: Wed, 31 Jan 2018 12:19:22 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1BA07D@SHSMSX104.ccr.corp.intel.com> References: <20180129060936.19884-1-bob.c.feng@intel.com> In-Reply-To: <20180129060936.19884-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Support multiple .h file X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2018 12:13:49 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Monday, January 29, 2018 2:10 PM >To: edk2-devel@lists.01.org >Cc: Feng, Bob C ; Gao, Liming >Subject: [Patch] BaseTools: Support multiple .h file > >for structure Pcd declaration in DEC file. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Bob Feng >Cc: Liming Gao >--- > BaseTools/Source/Python/Workspace/BuildClassObject.py | 2 +- > BaseTools/Source/Python/Workspace/DecBuildData.py | 2 +- > BaseTools/Source/Python/Workspace/DscBuildData.py | 8 ++++---- > BaseTools/Source/Python/Workspace/MetaFileParser.py | 4 +++- > 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 >@@ -113,11 +113,11 @@ class StructurePcd(PcdClassObject): > if SkuInfoList is None: SkuInfoList=3D{} > if validateranges is None: validateranges=3D[] > if validlists is None: validlists=3D[] > if expressions is None : expressions=3D[] > super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, V= alue, >Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validateranges, >validlists, expressions) >- self.StructuredPcdIncludeFile =3D StructuredPcdIncludeFile >+ self.StructuredPcdIncludeFile =3D [] if StructuredPcdIncludeFile = is None >else StructuredPcdIncludeFile > self.PackageDecs =3D Packages > self.DefaultStoreName =3D [default_store] > self.DefaultValues =3D collections.OrderedDict({}) > self.PcdMode =3D None > self.SkuOverrideValues =3D 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 >@@ -374,11 +374,11 @@ class DecBuildData(PackageBuildClassObject): > for pcdname in s_pcd_set: > dep_pkgs =3D [] > struct_pcd =3D StructurePcd() > for item,LineNo in s_pcd_set[pcdname]: > if "" in item.TokenCName: >- struct_pcd.StructuredPcdIncludeFile =3D item.DefaultV= alue >+ struct_pcd.StructuredPcdIncludeFile.append(item.Defau= ltValue) > elif "" in item.TokenCName: > dep_pkgs.append(item.DefaultValue) > elif item.DatumType =3D=3D item.TokenCName: > struct_pcd.copy(item) > struct_pcd.TokenValue =3D struct_pcd.TokenValue.strip= ("{").strip() >diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py >b/BaseTools/Source/Python/Workspace/DscBuildData.py >index 256fdd6875..0384b96997 100644 >--- a/BaseTools/Source/Python/Workspace/DscBuildData.py >+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py >@@ -1669,14 +1669,14 @@ class DscBuildData(PlatformBuildClassObject): > CApp =3D PcdMainCHeader > > Includes =3D {} > for PcdName in StructuredPcds: > Pcd =3D StructuredPcds[PcdName] >- IncludeFile =3D Pcd.StructuredPcdIncludeFile >- if IncludeFile not in Includes: >- Includes[IncludeFile] =3D True >- CApp =3D CApp + '#include <%s>\n' % (IncludeFile) >+ for IncludeFile in Pcd.StructuredPcdIncludeFile: >+ if IncludeFile not in Includes: >+ Includes[IncludeFile] =3D True >+ CApp =3D CApp + '#include <%s>\n' % (IncludeFile) > CApp =3D CApp + '\n' > > for PcdName in StructuredPcds: > Pcd =3D StructuredPcds[PcdName] > if not Pcd.SkuOverrideValues: >diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py >b/BaseTools/Source/Python/Workspace/MetaFileParser.py >index 8f4b5e5cc1..4359ba4b33 100644 >--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py >+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py >@@ -1889,26 +1889,28 @@ class DecParser(MetaFileParser): > self._ValueList[0] =3D self._CurrentStructurePcdName > > if "|" not in self._CurrentLine: > if "" =3D=3D self._CurrentLine: > self._include_flag =3D True >+ self._package_flag =3D False > self._ValueList =3D None > return > if "" =3D=3D self._CurrentLine: > self._package_flag =3D True > self._ValueList =3D None >+ self._include_flag =3D False > return > > if self._include_flag: > self._ValueList[1] =3D "_" + >md5.new(self._CurrentLine).hexdigest() > self._ValueList[2] =3D self._CurrentLine >- self._include_flag =3D False > if self._package_flag and "}" !=3D self._CurrentLine: > self._ValueList[1] =3D "_" + >md5.new(self._CurrentLine).hexdigest() > self._ValueList[2] =3D self._CurrentLine > if self._CurrentLine =3D=3D "}": > self._package_flag =3D False >+ self._include_flag =3D False > self._ValueList =3D None > return > else: > PcdTockens =3D self._CurrentLine.split(TAB_VALUE_SPLIT) > PcdNames =3D PcdTockens[0].split(TAB_SPLIT) >-- >2.14.3.windows.1