From nobody Mon Feb 9 00:01:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44973+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44973+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565151948; cv=none; d=zoho.com; s=zohoarc; b=F2XsAUWf0uq6m60hVL4rJE/zgIzAhVSebwpjHP32DSvZIkQW5Rtt5JQ/0u60mwRtCAQa6aiHYYfNMnto7acZZqNYPMFGDsDeoMJy8PMDxriJoCoyJbVaXKhvbV3bZmBf1AAZVBszlgiLTbf5F+ENib/BnPea04wi5QoB3nWAZcc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565151948; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=P6bSSlfwGltaRFT+wsc9cHjo9Oc7/+vnE+wNy+Efq+M=; b=chNgi4mU8csndOhdUT8mBdFwmdD3Y2cSxmCoLCuECYIzYGCsPbr2rLqjavG2pbQlHeHGO9uu/c/tM2cK6Pfa7pG57ioDFfGQUL28v1VWYBfdSSkEt73Zest9zO9ElUvgAWgR1AkLy0GTPQq+a/s/CXK0XlFoWW6DhhT6O8EFob8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44973+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1565151948115123.75697331205049; Tue, 6 Aug 2019 21:25:48 -0700 (PDT) Return-Path: X-Received: from mga05.intel.com (mga05.intel.com []) by groups.io with SMTP; Tue, 06 Aug 2019 21:25:47 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 21:25:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,356,1559545200"; d="scan'208";a="325839779" X-Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga004.jf.intel.com with ESMTP; 06 Aug 2019 21:25:46 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Bob Feng Subject: [edk2-devel] [Patch 03/10 V8] BaseTools: Add functions to get platform scope build options Date: Wed, 7 Aug 2019 12:25:30 +0800 Message-Id: <20190807042537.11928-4-bob.c.feng@intel.com> In-Reply-To: <20190807042537.11928-1-bob.c.feng@intel.com> References: <20190807042537.11928-1-bob.c.feng@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,bob.c.feng@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1565151947; bh=LNgXUoDGsH+qJpMCraEnoHnwDBs0IhYPIvdqN0i7KeI=; h=Cc:Date:From:Reply-To:Subject:To; b=CVHX4Y4cC7LQCxziEq/mvkrhJ7ymEqxvRmHtAYX2F+cIibCUzMmz6DTWgYRKKF4qpIf SdT07PF1uef7417hzyJP7TYgSg5xeAvh77igeR9DB9ghdANEf0FszQGnutGnSd7IZUinT jCBrYH5Ca2XY71FDBt+UIcgthesLG8DhzIQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1875 These functions are used for get platform scope build options. They will be used in later patches. Cc: Liming Gao Signed-off-by: Bob Feng --- BaseTools/Source/Python/AutoGen/AutoGen.py | 10 +++++++++- .../Source/Python/Workspace/DscBuildData.py | 20 +++++++++++++++++++ .../Source/Python/Workspace/InfBuildData.py | 10 ++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 122696f5cebf..bb0da46d74a9 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -2484,11 +2484,19 @@ class PlatformAutoGen(AutoGen): if Attr !=3D 'PATH': BuildOptions[Tool][Attr] +=3D " " + Option= s[Key] else: BuildOptions[Tool][Attr] =3D Options[Key] return BuildOptions - + def GetGlobalBuildOptions(self,Module): + ModuleTypeOptions =3D self.Platform.GetBuildOptionsByPkg(Module, M= odule.ModuleType) + ModuleTypeOptions =3D self._ExpandBuildOption(ModuleTypeOptions) + if Module in self.Platform.Modules: + PlatformModule =3D self.Platform.Modules[str(Module)] + PlatformModuleOptions =3D self._ExpandBuildOption(PlatformModu= le.BuildOptions) + else: + PlatformModuleOptions =3D {} + return ModuleTypeOptions, PlatformModuleOptions ## Append build options in platform to a module # # @param Module The module to which the build options will be appe= nded # # @retval options The options appended with build options in pla= tform diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 987d9cf13eea..fa41e57c4f45 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1222,11 +1222,31 @@ class DscBuildData(PlatformBuildClassObject): self._BuildOptions[CurKey] =3D Option else: if ' ' + Option not in self._BuildOptions[CurKey]: self._BuildOptions[CurKey] +=3D ' ' + Option return self._BuildOptions + def GetBuildOptionsByPkg(self, Module, ModuleType): =20 + local_pkg =3D os.path.split(Module.LocalPkg())[0] + if self._ModuleTypeOptions is None: + self._ModuleTypeOptions =3D OrderedDict() + if ModuleType not in self._ModuleTypeOptions: + options =3D OrderedDict() + self._ModuleTypeOptions[ ModuleType] =3D options + RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION, sel= f._Arch] + for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3= , Dummy4, Dummy5 in RecordList: + if Dummy2 not in (TAB_COMMON,local_pkg.upper(),"EDKII"): + continue + Type =3D Dummy3 + if Type.upper() =3D=3D ModuleType.upper(): + Key =3D (ToolChainFamily, ToolChain) + if Key not in options or not ToolChain.endswith('_FLAG= S') or Option.startswith('=3D'): + options[Key] =3D Option + else: + if ' ' + Option not in options[Key]: + options[Key] +=3D ' ' + Option + return self._ModuleTypeOptions[ModuleType] def GetBuildOptionsByModuleType(self, Edk, ModuleType): if self._ModuleTypeOptions is None: self._ModuleTypeOptions =3D OrderedDict() if (Edk, ModuleType) not in self._ModuleTypeOptions: options =3D OrderedDict() diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/= Source/Python/Workspace/InfBuildData.py index 60970cd92836..da35391d3aff 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -817,11 +817,21 @@ class InfBuildData(ModuleBuildClassObject): for Token in TokenList: TemporaryDictionary[Arch, ModuleType] =3D TemporaryDiction= ary[Arch, ModuleType] + Token.strip() + ' ' for Arch, ModuleType in TemporaryDictionary: RetVal[Arch, ModuleType] =3D TemporaryDictionary[Arch, ModuleT= ype] return RetVal + def LocalPkg(self): + module_path =3D self.MetaFile.File + subdir =3D os.path.split(module_path)[0] + TopDir =3D "" + while subdir: + subdir,TopDir =3D os.path.split(subdir) =20 + for file_name in os.listdir(os.path.join(self.MetaFile.Root,TopDir= )): + if file_name.upper().endswith("DEC"): + pkg =3D os.path.join(TopDir,file_name) + return pkg @cached_class_function def GetGuidsUsedByPcd(self): self.Pcds return self._GuidsUsedByPcd =20 --=20 2.20.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44973): https://edk2.groups.io/g/devel/message/44973 Mute This Topic: https://groups.io/mt/32779329/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-