summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2019-03-04 10:38:02 +0200
committerMatt Turner <mattst88@gentoo.org>2019-03-17 12:17:00 -0700
commiteeb4c7afa12a3acb5773fbfdb4e6e1b1f626e731 (patch)
treeec5704b720683d8a8cbeea4b4e8d2b65d996e025 /eclass
parentpackage.mask: Last rite net-analyzer/netsniff-ng (diff)
downloadgentoo-eeb4c7afa12a3acb5773fbfdb4e6e1b1f626e731.tar.gz
gentoo-eeb4c7afa12a3acb5773fbfdb4e6e1b1f626e731.tar.bz2
gentoo-eeb4c7afa12a3acb5773fbfdb4e6e1b1f626e731.zip
meson.eclass: add meson_feature function
This can be used to simplify controlling meson_options.txt entries of type 'feature'. Signed-off-by: Mart Raudsepp <leio@gentoo.org> Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/meson.eclass13
1 files changed, 13 insertions, 0 deletions
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 75291d7bdd1b..65b09932a7ac 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: