From nobody Mon Dec 23 05:22:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1519908130520153.01357190090482; Thu, 1 Mar 2018 04:42:10 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id ED13722402E09; Thu, 1 Mar 2018 04:35:59 -0800 (PST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 4554222402DFA for ; Thu, 1 Mar 2018 04:35:57 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 04:42:05 -0800 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 01 Mar 2018 04:42:05 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Mar 2018 04:42:05 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Mar 2018 04:42:04 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.130]) with mapi id 14.03.0319.002; Thu, 1 Mar 2018 20:42:03 +0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,408,1515484800"; d="dat'59?scan'59,208,59";a="34660891" From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" Thread-Topic: [PATCH] BaseTools: Dsc/Fdf conditional statement parse issue Thread-Index: AdOxWlHN/PD4q0BNSPu15iylGL9xdg== Date: Thu, 1 Mar 2018 12:42:01 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC482C903@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC482C903@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: [edk2] [PATCH] BaseTools: Dsc/Fdf conditional statement parse issue 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: , Cc: "Gao, Liming" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Set PCD value with --pcd argument not replace DSC/Fdf PCD value. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/GenFds/FdfParser.py | 4 ++++ BaseTools/Source/Python/Workspace/MetaFileParser.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source= /Python/GenFds/FdfParser.py index 44a3564c7c..fc2b409847 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -923,10 +923,14 @@ class FdfParser: if ScopeMacro: MacroDict.update(ScopeMacro) =20 MacroDict.update(GlobalData.gGlobalDefines) MacroDict.update(GlobalData.gCommandLineDefines) + if GlobalData.BuildOptionPcd: + for Item in GlobalData.BuildOptionPcd: + PcdName, TmpValue =3D Item.split("=3D") + MacroDict[PcdName.strip()] =3D TmpValue # Highest priority =20 return MacroDict =20 def __EvaluateConditional(self, Expression, Line, Op =3D None, Value = =3D None): diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index 95ea6fb45a..6809003d98 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1241,10 +1241,14 @@ class DscParser(MetaFileParser): Macros.update(GlobalData.gPlatformDefines) Macros.update(GlobalData.gCommandLineDefines) # PCD cannot be referenced in macro definition if self._ItemType not in [MODEL_META_DATA_DEFINE, MODEL_META_DATA_= GLOBAL_DEFINE]: Macros.update(self._Symbols) + if GlobalData.BuildOptionPcd: + for Item in GlobalData.BuildOptionPcd: + PcdName, TmpValue =3D Item.split("=3D") + Macros[PcdName.strip()] =3D TmpValue return Macros =20 def _PostProcess(self): Processer =3D { MODEL_META_DATA_SECTION_HEADER : self.__Pro= cessSectionHeader, --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel