diff options
author | Mike Gilbert <floppym@gentoo.org> | 2021-10-20 18:43:23 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2021-10-24 12:15:10 -0400 |
commit | 0727a1cdee942f15ac62f50bd2768b6566d8b322 (patch) | |
tree | 2aa598b43836ad6d2da90eb682e05125324bdbb7 /eclass/meson.eclass | |
parent | net-analyzer/sshping: fix my email (diff) | |
download | gentoo-0727a1cdee942f15ac62f50bd2768b6566d8b322.tar.gz gentoo-0727a1cdee942f15ac62f50bd2768b6566d8b322.tar.bz2 gentoo-0727a1cdee942f15ac62f50bd2768b6566d8b322.zip |
meson.eclass: add EMESON_BUILDTYPE variable
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>
Diffstat (limited to 'eclass/meson.eclass')
-rw-r--r-- | eclass/meson.eclass | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 4ba364924e40..5fab2f8df6be 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 |