You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
902 B
32 lines
902 B
cmake_minimum_required(VERSION 3.12) |
|
project (lvgl-template-web) |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O2") |
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s INITIAL_MEMORY=83886080 -sLLD_REPORT_UNDEFINED -s USE_SDL=2") |
|
|
|
include_directories(${PROJECT_SOURCE_DIR}) |
|
|
|
add_subdirectory(lvgl) |
|
add_subdirectory(lv_drivers) |
|
file(GLOB MY_SOURCES "./*.c") |
|
set(SOURCES ${MY_SOURCES}) |
|
|
|
file(GLOB_RECURSE my_src |
|
./src/*.cpp |
|
./src/*.c |
|
) |
|
list(APPEND SOURCES ${my_src}) |
|
|
|
add_executable(index ${SOURCES} ${INCLUDES}) |
|
|
|
if(NOT LVGL_CHOSEN_DEMO) |
|
set(LVGL_CHOSEN_DEMO lv_demo_widgets) |
|
endif() |
|
set_source_files_properties(main.c PROPERTIES COMPILE_FLAGS -DCHOSEN_DEMO=${LVGL_CHOSEN_DEMO}) |
|
|
|
set(CMAKE_EXECUTABLE_SUFFIX ".html") |
|
target_link_libraries(index |
|
lvgl |
|
lv_drivers |
|
) |
|
set_target_properties(index PROPERTIES LINK_FLAGS "--shell-file ${PROJECT_SOURCE_DIR}/lvgl_shell.html -s SINGLE_FILE=1")
|
|
|