lvgl: make libdrm include conditional

The libdrm include is only needed when "drm" is selected in
PACKAGECONFIG.

In addition, move the TARGET_CFLAG addition to lv-conf.inc, where the
DRM configuration is actually selected for LVGL.

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Christophe Chapuis
2024-03-18 19:25:50 +01:00
committed by Khem Raj
parent 4e9df16acb
commit c9c51b1bfa
3 changed files with 3 additions and 4 deletions
@@ -2,6 +2,9 @@ PACKAGECONFIG[drm] = ",,libdrm"
PACKAGECONFIG[fbdev] = ",,"
PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image"
# Add libdrm include if drm is selected in PACKAGECONFIG
TARGET_CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'drm', '-I${STAGING_INCDIR}/libdrm', '', d)}"
LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}"
LVGL_CONFIG_USE_EVDEV = "${@bb.utils.contains_any('PACKAGECONFIG', 'drm fbdev', '1', '0', d)}"
@@ -30,8 +30,6 @@ inherit cmake
S = "${WORKDIR}/git"
TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
do_configure:prepend() {
if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then
# Add libsdl build dependency, SDL2_image has no cmake file
@@ -22,8 +22,6 @@ inherit cmake
EXTRA_OECMAKE = "-DLIB_INSTALL_DIR=${baselib} -DBUILD_SHARED_LIBS=ON"
S = "${WORKDIR}/git"
TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm"
ALLOW_EMPTY:${PN} = "1"
PACKAGECONFIG ??= "drm"