summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2017-12-11 14:14:06 -0500
committerMike Gilbert <floppym@gentoo.org>2017-12-23 13:04:12 -0500
commitb7ad7de7e4a3d584601bf3d7bd9c8d9c7dd2af48 (patch)
tree91befd6910548c0dde40725645b7ccb75f2eb56c /eclass
parentwww-client/chromium: remove old (diff)
downloadgentoo-b7ad7de7e4a3d584601bf3d7bd9c8d9c7dd2af48.tar.gz
gentoo-b7ad7de7e4a3d584601bf3d7bd9c8d9c7dd2af48.tar.bz2
gentoo-b7ad7de7e4a3d584601bf3d7bd9c8d9c7dd2af48.zip
meson.eclass: add meson_use function
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 2c943dd6ae27..71735fbfc67d 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -137,6 +137,19 @@ _meson_create_cross_file() {
EOF
}
+# @FUNCTION: meson_use
+# @USAGE: <USE flag> [option name]
+# @DESCRIPTION:
+# Given a USE flag and meson project option, outputs a string like:
+#
+# -Doption=true
+# -Doption=false
+#
+# If the project option is unspecified, it defaults to the USE flag.
+meson_use() {
+ usex "$1" "-D${2-$1}=true" "-D${2-$1}=false"
+}
+
# @FUNCTION: meson_src_configure
# @DESCRIPTION:
# This is the meson_src_configure function.