build(cmake): fix installation when using private API (#10067)

This commit is contained in:
André Costa
2026-05-12 09:36:32 +02:00
committed by GitHub
parent fc4c7cee6a
commit 93bcda9271
5 changed files with 78 additions and 98 deletions
+56 -26
View File
@@ -13,36 +13,66 @@ concurrency:
jobs:
build-examples:
runs-on: ubuntu-24.04
strategy:
matrix:
api: [public, private]
steps:
- uses: actions/checkout@v6
- name: Generate lv_conf.h
run: |
python3 ./scripts/generate_lv_conf.py \
--template lv_conf_template.h \
--config lv_conf.h \
--defaults configs/ci/install/lv_conf.defaults
with:
fetch-depth: 0
- name: Install kconfig
run: pip install kconfiglib
- name: Build LVGL
run: |
cmake -B build -DCMAKE_INSTALL_PREFIX=$(pwd)/lvgl-install
cmake --build build -j$(nproc)
- name: Install LVGL
run: cmake --install build
defconfig configs/ci/install/${{ matrix.api }}_api_config
cmake -B build -GNinja -DLV_BUILD_USE_KCONFIG=ON
cmake --build build
cmake --install build --prefix lvgl-${{ matrix.api }}-install
- name: Build an application with the installed version of LVGL
- name: Generate Compilation Test Code
run: |
echo "#include <lvgl/lvgl.h>
#include <lvgl/lvgl.h>
#include <lvgl/demos/lv_demos.h>
#include <lvgl/examples/lv_examples.h>
int main(void) {
lv_init();
lv_example_label_1();
lv_demo_widgets();
while(1) {
lv_timer_handler();
}
return 0;
}" >> main.c
# We link with `g++` as thorvg (ThorVG library) contains C++ code that requires C++ runtime symbols
g++ main.c -o main -I$(pwd)/lvgl-install/include -L$(pwd)/lvgl-install/lib -llvgl_examples -llvgl_demos -llvgl -llvgl_thorvg -lm
if [ "${{ matrix.api }}" = "public" ]; then
echo "#include <lvgl/lvgl.h>
#include <lvgl/lvgl.h>
#include <lvgl/demos/lv_demos.h>
#include <lvgl/examples/lv_examples.h>
int main(void) {
lv_init();
lv_example_label_1();
lv_demo_widgets();
while(1) {
lv_timer_handler();
}
return 0;
}" >> main_${{ matrix.api }}.c
else
echo "#include <lvgl/lvgl.h>
#include <lvgl/lvgl.h>
#include <lvgl/demos/lv_demos.h>
#include <lvgl/examples/lv_examples.h>
#include <lvgl_private/lvgl_private.h>
int main(void) {
lv_init();
lv_example_label_1();
lv_demo_widgets();
lv_obj_destruct(lv_screen_active()); /*private*/
while(1) {
lv_timer_handler();
}
return 0;
}" >> main_${{ matrix.api }}.c
fi
- name: Compile Test Code
run: |
g++ main_${{ matrix.api }}.c -o main \
-I$(pwd)/lvgl-${{ matrix.api }}-install/include \
-L$(pwd)/lvgl-${{ matrix.api }}-install/lib \
-llvgl_examples \
-llvgl_demos \
-llvgl \
-llvgl_thorvg \
-lm