[PATCH cygport 1/2] meson: use auto-features option

Jon Turney jon.turney@dronecode.org.uk
Tue Apr 2 17:22:00 GMT 2019


This option added in 0.47 [1], is intended to be used by distribution
packaging to ensure that features for a package are explicitly
configured. (e.g see discussion at [2])

(Note that features are a relatively recent meson feature and thus
aren't used by some packages)

[1] http://mesonbuild.com/Release-notes-for-0-47-0.html#new-type-of-build-option-for-features
[2] https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/SVURE6JRDBTFKHJAPFBYRZ62JQ56OLEG/
---
 cygclass/meson.cygclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cygclass/meson.cygclass b/cygclass/meson.cygclass
index 1d2694c..2490cd6 100644
--- a/cygclass/meson.cygclass
+++ b/cygclass/meson.cygclass
@@ -53,7 +53,7 @@ inherit ninja
 #  cygmeson should be run in the directory containing the top-level meson.build.
 #****
 cygmeson() {
-	local crossargs mdir
+	local crossargs mdir meson_version
 
 	if [ ! -e meson.build ]
 	then
@@ -75,6 +75,12 @@ cygmeson() {
 
 	check_prog_req meson
 
+	meson_version=$(meson --version)
+	if ! __version_at_least 0.47 ${meson_version}
+	then
+	    error "meson.cygclass: minimum supported meson version is 0.47"
+	fi
+
 #****v* cygmeson/CYGMESON_ARGS
 #  DESCRIPTION
 #  Additional flags to pass to meson, as a string.
@@ -86,6 +92,7 @@ cygmeson() {
 		--localstatedir=$(__host_localstatedir) \
 		--sysconfdir=$(__host_sysconfdir) \
 		--buildtype=plain --wrap-mode=nodownload \
+		--auto-features=enabled \
 		${crossargs} ${CYGMESON_ARGS} "${@}" ${CHOST} \
 		|| error "meson failed"
 }
-- 
2.17.0



More information about the Cygwin-apps mailing list