public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] meson.eclass: add meson_feature function
@ 2019-03-04  8:38 Mart Raudsepp
  2019-03-11 15:41 ` William Hubbs
  0 siblings, 1 reply; 2+ messages in thread
From: Mart Raudsepp @ 2019-03-04  8:38 UTC (permalink / raw
  To: gentoo-dev

This can be used to simplify controlling meson_options.txt entries
of type 'feature'.

Signed-off-by: Mart Raudsepp <leio@gentoo.org>
---
 eclass/meson.eclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 75291d7bdd1..65b09932a7a 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -188,6 +188,19 @@ meson_use() {
 	usex "$1" "-D${2-$1}=true" "-D${2-$1}=false"
 }
 
+# @FUNCTION: meson_feature
+# @USAGE: <USE flag> [option name]
+# @DESCRIPTION:
+# Given a USE flag and meson project option, outputs a string like:
+#
+#   -Doption=enabled
+#   -Doption=disabled
+#
+# If the project option is unspecified, it defaults to the USE flag.
+meson_feature() {
+	usex "$1" "-D${2-$1}=enabled" "-D${2-$1}=disabled"
+}
+
 # @FUNCTION: meson_src_configure
 # @USAGE: [extra meson arguments]
 # @DESCRIPTION:



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-dev] [PATCH] meson.eclass: add meson_feature function
  2019-03-04  8:38 [gentoo-dev] [PATCH] meson.eclass: add meson_feature function Mart Raudsepp
@ 2019-03-11 15:41 ` William Hubbs
  0 siblings, 0 replies; 2+ messages in thread
From: William Hubbs @ 2019-03-11 15:41 UTC (permalink / raw
  To: gentoo-dev; +Cc: leio, floppym

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

On Mon, Mar 04, 2019 at 10:38:02AM +0200, Mart Raudsepp wrote:
> This can be used to simplify controlling meson_options.txt entries
> of type 'feature'.

I responded on irc a few days ago, but I'll go ahead and respond here.
This looks good to me.

Thanks,

William

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-11 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-04  8:38 [gentoo-dev] [PATCH] meson.eclass: add meson_feature function Mart Raudsepp
2019-03-11 15:41 ` William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox