2025-11-17 22:31:09 +01:00

36 lines
1.6 KiB
CMake

set(LV_BUILD_USE_KCONFIG ON)
idf_component_register(SRCS
"test_ihm.c"
"../../ihm.c"
"driver_backends.c"
"sdl.c"
"../../fonts/montserrat_medium_12.c"
"../../fonts/montserrat_medium_18.c"
"../../fonts/montserrat_medium_24.c"
"../../fonts/roboto_medium_36.c"
"../../fonts/roboto_medium_72.c"
INCLUDE_DIRS
"../../include"
WHOLE_ARCHIVE
REQUIRES lvgl meteofrance)
message("Including SDL2 support")
find_package(PkgConfig REQUIRED)
pkg_check_modules(SDL2 REQUIRED sdl2)
pkg_check_modules(SDL2_IMAGE REQUIRED SDL2_image)
list(APPEND PKG_CONFIG_LIB ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES})
list(APPEND PKG_CONFIG_INC ${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS})
target_compile_options(${COMPONENT_LIB} PUBLIC --coverage -DLV_LVGL_H_INCLUDE_SIMPLE)
target_link_libraries(${COMPONENT_LIB} PUBLIC ${PKG_CONFIG_LIB} --coverage)
target_include_directories(${COMPONENT_LIB} PRIVATE ${CMAKE_SOURCE_DIR}/mock ${PKG_CONFIG_INC})
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
target_compile_options(${COMPONENT_LIB} PRIVATE -std=gnu++20)
endif()
# Currently 'main' for IDF_TARGET=linux is defined in freertos component.
# Since we are using a freertos mock here, need to let Catch2 provide 'main'.
#target_link_libraries(${COMPONENT_LIB} PRIVATE Catch2WithMain)