Re: [meta-oe][PATCH] apitrace: Conditionally enable X11 support


Martin Jansa
 

Why not use PACKAGECONFIG for this? It won't set the EXTRA_OECMAKE automatically, but will handle the depends correctly (and will be easy to switch of if someone with x1 and opengl in DISTRO_FEATURES still doesn't wan to have X11 enabled here for whatever reason).


On Fri, Oct 15, 2021 at 12:41 AM Marek Vasut <marex@...> wrote:
In case DISTRO_FEATURES contain both x11 and opengl, enable X11 support
in apitrace, because all the requirements are satisfied.

Signed-off-by: Marek Vasut <marex@...>
Cc: Khem Raj <raj.khem@...>
---
 meta-oe/recipes-devtools/apitrace/apitrace_10.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta-oe/recipes-devtools/apitrace/apitrace_10.0.bb b/meta-oe/recipes-devtools/apitrace/apitrace_10.0.bb
index 57ec1f8e0..f097f78a9 100644
--- a/meta-oe/recipes-devtools/apitrace/apitrace_10.0.bb
+++ b/meta-oe/recipes-devtools/apitrace/apitrace_10.0.bb
@@ -13,12 +13,13 @@ SRC_URI = "gitsm://github.com/${BPN}/${BPN}.git \
 S = "${WORKDIR}/git"

 DEPENDS += "zlib libpng python3-native"
+DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'libx11', '', d)} "

 inherit cmake

 EXTRA_OECMAKE += "\
     -DENABLE_GUI=OFF \
-    -DENABLE_X11=OFF \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', '-DENABLE_X11=ON', '-DENABLE_X11=OFF', d)} \
     -DENABLE_STATIC_LIBGCC=OFF \
     -DENABLE_STATIC_LIBSTDCXX=OFF \
     -DPython3_ROOT_DIR=/usr/bin/python3-native \
--
2.33.0




Join openembedded-devel@lists.openembedded.org to automatically receive all group messages.