Skip to content

Conversation

@MeteorsLiu
Copy link
Contributor

@MeteorsLiu MeteorsLiu commented Jul 3, 2025

How to generate lvgl

Environment requirement

llcppg: v0.7.0
llgo: greater than v0.11.5
llvm: 19

Software requirement

sdl2

1. Copy and edit lv_conf.h

cd lvgl
cp lv_conf_template.h lv_conf.h

Edit lv_conf.h,

1. Enable content

#if 1 /* Set this to "1" to enable content */

2. Enable sdl2

/** Use SDL to open window on PC and handle mouse and keyboard. */
#define LV_USE_SDL              1

2. Build LVGL

mkdir build && cd build
cmake  -DCMAKE_CXX_FLAGS=$(pkg-config --cflags sdl2) -DCMAKE_C_FLAGS=$(pkg-config --cflags sdl2) ..
cmake --build .

3. Add pkgconfig

includedir="{{lvgl source path}}"
libdir="${includedir}/build/lib"

Name: lvgl
Description: Light and Versatile Graphics Library
URL: https://lvgl.io/
Version: 9.3.0
Cflags: -I${includedir}
Libs: -L${libdir} -llvgl

And activate it, export PKG_CONFIG_PATH=$(pwd):$PKG_CONFIG_PATH

4. Generate llcppg.cfg

llcppcfg -excludes "tests demos src examples build libs env_support" lvgl

5. Edit llcppg.cfg

lvgl requires external sdl2 and enable llcppg static lib mode.

"libs": "$(pkg-config --libs lvgl sdl2)",
"staticLib": true

6. Generate with llcppg

llcppg -mod github.com/goplus/llpkg/lvgl

Release-as: lvgl/v1.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant