From 1f44ab4719ee6d0598a1e57fe35a21538a345cdb Mon Sep 17 00:00:00 2001 From: David Warkentin Date: Wed, 4 Sep 2024 17:26:38 -0600 Subject: [PATCH] Fix generated headers The currently generated C file for custom fonts is missing a block at the top to set LV_LVGL_H_INCLUDE_SIMPLE conditionally as is done in the current image converter. This will fail to compile depending on how your include paths are set up as it does for me. Fixes lvgl/lv_font_conv#116 --- lib/writers/lvgl/lv_font.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/writers/lvgl/lv_font.js b/lib/writers/lvgl/lv_font.js index ca387bd..bb6e88d 100644 --- a/lib/writers/lvgl/lv_font.js +++ b/lib/writers/lvgl/lv_font.js @@ -77,10 +77,18 @@ class LvFont extends Font { * Opts: ${this.opts.opts_string} ******************************************************************************/ +#ifdef __has_include + #if __has_include("lvgl.h") + #ifndef LV_LVGL_H_INCLUDE_SIMPLE + #define LV_LVGL_H_INCLUDE_SIMPLE + #endif + #endif +#endif + #ifdef LV_LVGL_H_INCLUDE_SIMPLE -#include "lvgl.h" + #include "lvgl.h" #else -#include "${this.opts.lv_include || 'lvgl/lvgl.h'}" + #include "${this.opts.lv_include || 'lvgl/lvgl.h'}" #endif #ifndef ${guard_name}