LVGL / ESP32_Display_Panel compiles everything

Hello, I’m working on an HMI project with a Waveshare ESP32-S3-TOUCH-7 display.

The project works and compiles perfectly, but even though I configure lv_conf.h (with #if 1 enabling the file) and esp_panel_drivers_conf.h to exclude unused demos, fonts, and drivers, these files still get included during compilation. I had to delete the folders containing demos and examples, and temporarily the fonts I don’t use, to prevent them from being compiled. However, dealing with the drivers is more complicated because deleting them breaks the entire library. I don’t know how to prevent the compilation of files that I disable via configuration (screen drivers, touch drivers, IO expander, fonts, demos). I also deleted all duplicate configuration files inside the libraries.

The libraries are installed in lib/ (I don’t use lib_deps), and the corresponding configuration files are also inside the lib/ folder, except for lv_conf.h, which is located inside the lvgl library folder (otherwise, compilation throws an error saying the file cannot be found).

I appreciate your help and comments.

Libraries:

  • esp-lib-utils v0.1.2

  • ESP32_Display_Panel v1.0.0

  • ESP32_IO_Expander v1.0.1

  • lvgl v8.4.0

This is my platformio.ini file

[platformio]
default_envs = waveshare_7

[env:waveshare_7]

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip

platform_packages =
  platformio/framework-arduinoespressif32@ https://github.com/espressif/arduino-esp32.git#3.1.1
  platformio/framework-arduinoespressif32-libs@https://dl.espressif.com/AE/esp-arduino-libs/esp32-3.1.1-h.zip

board = ESP32S3Box
board_build.flash_mode = qio
board_build.flash_size = 16MB
board_build.psram_type = opi
board_build.arduino.memory_type = qio_opi

framework = arduino

monitor_speed = 115200
monitor_filters =
  esp32_exception_decoder
  colorize

build_unflags =
  -std=gnu++11

build_flags =
  -DCORE_DEBUG_LEVEL=1
  -DLV_CONF_INCLUDE_SIMPLE
  -DLV_LVGL_H_INCLUDE_SIMPLE
  -I

lib_ldf_mode = chain

upload_speed = 921600
upload_port = COM4

You misunderstand defines usage. All files placed into your project tree is normal compiled, but if defines inside is off result is empty object .o file … And all this is doing only once or on config changes.

Then learn how right use libdesp and library.json etc. Removing files is one way, but totally unusable after you require update some lib …