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.88; helo=mga01.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 B0763202E533C for ; Mon, 25 Jun 2018 02:42:48 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2018 02:42:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,269,1526367600"; d="scan'208";a="49681281" Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.110]) by fmsmga007.fm.intel.com with ESMTP; 25 Jun 2018 02:42:47 -0700 From: BobCF To: edk2-devel@lists.01.org Cc: Bob Feng , Liming Gao Date: Mon, 25 Jun 2018 17:42:43 +0800 Message-Id: <20180625094243.203044-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Subject: [Patch] BaseTools: Structure pcd value assignment X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 09:42:48 -0000 Enable Structure pcd value assigned by FixedPcd Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao --- .../Source/Python/Workspace/MetaFileParser.py | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py index 88c7bb374c..ac08f39c30 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1609,17 +1609,26 @@ class DscParser(MetaFileParser): ValList, Valid, Index = AnalyzeDscPcd(self._ValueList[2], self._ItemType) if not Valid: EdkLogger.error('build', FORMAT_INVALID, "Pcd format incorrect.", File=self._FileWithError, Line=self._LineIndex + 1, ExtraData="%s.%s|%s" % (self._ValueList[0], self._ValueList[1], self._ValueList[2])) PcdValue = ValList[Index] - if PcdValue and "." not in self._ValueList[0]: - try: - ValList[Index] = ValueExpression(PcdValue, self._Macros)(True) - except WrnExpression, Value: - ValList[Index] = Value.result - except: - pass + if PcdValue: + if "." not in self._ValueList[0]: + try: + ValList[Index] = ValueExpression(PcdValue, self._Macros)(True) + except WrnExpression, Value: + ValList[Index] = Value.result + except: + pass + else: + if PcdValue in self._Macros: + try: + ValList[Index] = ValueExpression(PcdValue, self._Macros)(True) + except WrnExpression, Value: + ValList[Index] = Value.result + except: + pass if ValList[Index] == 'True': ValList[Index] = '1' if ValList[Index] == 'False': ValList[Index] = '0' -- 2.16.2.windows.1