public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] meson.eclass: add EMESON_BUILDTYPE variable
@ 2021-10-21 15:51 Mike Gilbert
  0 siblings, 0 replies; only message in thread
From: Mike Gilbert @ 2021-10-21 15:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: williamh, Mike Gilbert

This allows the buildtype option to be overridden or omitted.

This may be necessary if an ebuild makes use of the 'debug' built-in
option control project-specific debug functionality. meson emits a
warning if both buildtype and debug are specified, since the former
overrides the latter.

See discussion in https://github.com/gentoo/gentoo/pull/22574.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
 eclass/meson.eclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 4ba364924e4..5fab2f8df6b 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -64,6 +64,11 @@ fi
 # Build directory, location where all generated files should be placed.
 # If this isn't set, it defaults to ${WORKDIR}/${P}-build.
 
+# @ECLASS-VARIABLE: EMESON_BUILDTYPE
+# @DESCRIPTION:
+# The buildtype value to pass to meson setup.
+: ${EMESON_BUILDTYPE=plain}
+
 # @ECLASS-VARIABLE: EMESON_SOURCE
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -310,7 +315,6 @@ meson_src_configure() {
 
 	local mesonargs=(
 		meson setup
-		--buildtype plain
 		--libdir "$(get_libdir)"
 		--localstatedir "${EPREFIX}/var/lib"
 		--prefix "${EPREFIX}/usr"
@@ -321,6 +325,10 @@ meson_src_configure() {
 		--native-file "$(_meson_create_native_file)"
 	)
 
+	if [[ -n ${EMESON_BUILDTYPE} ]]; then
+		mesonargs+=( --buildtype "${EMESON_BUILDTYPE}" )
+	fi
+
 	if tc-is-cross-compiler; then
 		mesonargs+=( --cross-file "$(_meson_create_cross_file)" )
 	fi
-- 
2.33.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-21 15:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 15:51 [gentoo-dev] [PATCH] meson.eclass: add EMESON_BUILDTYPE variable Mike Gilbert

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