build: do not allow to compile f0rmz and unl0kr without graphical backends

This commit is contained in:
Vladimir Stoiakin 2025-09-27 23:23:41 +03:00
parent 32b26b8e34
commit 742bb6af1c
4 changed files with 15 additions and 21 deletions

View file

@ -165,7 +165,7 @@ static int parsing_handler(void* user_data, const char* section, const char* key
*/
void f0_config_init_opts(f0_config_opts *opts) {
opts->general.backend = bbx_backends_backends[0] == NULL ? BBX_BACKENDS_BACKEND_NONE : 0;
opts->general.backend = 0;
opts->intro.title = "A Form!";
opts->intro.body = "Please complete the following form.";
opts->theme.default_id = BBX_THEMES_THEME_BREEZY_DARK;

View file

@ -6,28 +6,23 @@
#include "backends.h"
#include "../shared/log.h"
#include "log.h"
#include <string.h>
/**
* Public interface
*/
const char *bbx_backends_backends[] = {
static const char *backends[] = {
#if LV_USE_LINUX_FBDEV
"fbdev",
#endif /* LV_USE_LINUX_FBDEV */
#endif
#if LV_USE_LINUX_DRM
"drm",
#endif /* LV_USE_LINUX_DRM */
#endif
NULL
};
bbx_backends_backend_id_t bbx_backends_find_backend_with_name(const char *name) {
for (int i = 0; bbx_backends_backends[i] != NULL; ++i) {
if (strcmp(bbx_backends_backends[i], name) == 0) {
for (int i = 0; backends[i] != NULL; ++i) {
if (strcmp(backends[i], name) == 0) {
bbx_log(BBX_LOG_LEVEL_VERBOSE, "Found backend: %s\n", name);
return i;
}

View file

@ -7,7 +7,11 @@
#ifndef BBX_BACKENDS_H
#define BBX_BACKENDS_H
#include "lvgl/lvgl.h"
#include "lv_conf.h"
#if LV_USE_LINUX_FBDEV == 0 && LV_USE_LINUX_DRM == 0
#error Neither of graphical backends is enabled
#endif
/**
* Backend identifiers
@ -18,17 +22,12 @@ typedef enum {
BBX_BACKENDS_BACKEND_NONE = -1,
#if LV_USE_LINUX_FBDEV
BBX_BACKENDS_BACKEND_FBDEV,
#endif /* LV_USE_LINUX_FBDEV */
#endif
#if LV_USE_LINUX_DRM
BBX_BACKENDS_BACKEND_DRM,
#endif /* LV_USE_LINUX_DRM */
#endif
} bbx_backends_backend_id_t;
/**
* Actual backends
*/
extern const char *bbx_backends_backends[];
/**
* Find the first backend with a given name.
*

View file

@ -139,7 +139,7 @@ static int parsing_handler(void* user_data, const char* section, const char* key
void ul_config_init_opts(ul_config_opts *opts) {
opts->general.animations = false;
opts->general.backend = bbx_backends_backends[0] == NULL ? BBX_BACKENDS_BACKEND_NONE : 0;
opts->general.backend = 0;
opts->general.timeout = 0;
opts->keyboard.autohide = true;
opts->keyboard.layout_id = SQ2LV_LAYOUT_US;