forked from lvgl/lv_web_emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (56 loc) · 1.61 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
set (LVGL9 0)
set (HAS_FLOW_SUPPORT 1)
cmake_minimum_required(VERSION 3.12)
project (lv_emscripten)
set(USE_FLAGS "-s USE_SDL=2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${USE_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${USE_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s INITIAL_MEMORY=83886080 -sLLD_REPORT_UNDEFINED ${USE_FLAGS}")
include_directories(${PROJECT_SOURCE_DIR})
add_subdirectory(lvgl)
if (${LVGL9})
else()
add_subdirectory(lv_drivers)
endif(${LVGL9})
file(GLOB MY_SOURCES "./*.c")
set(SOURCES ${MY_SOURCES})
if (${HAS_FLOW_SUPPORT})
add_definitions(-DHAS_FLOW_SUPPORT=1)
endif(${HAS_FLOW_SUPPORT})
file(GLOB_RECURSE my_src
./eez-project/src/*.cpp
./eez-project/src/*.c
)
list(APPEND SOURCES ${my_src})
add_executable(index ${SOURCES})
set(CMAKE_EXECUTABLE_SUFFIX ".html")
if (${LVGL9})
if (${HAS_FLOW_SUPPORT})
add_definitions(-DEEZ_FOR_LVGL)
add_subdirectory(eez-framework)
target_link_libraries(index
lvgl
eez-framework
)
else()
target_link_libraries(index
lvgl
)
endif(${HAS_FLOW_SUPPORT})
else()
if (${HAS_FLOW_SUPPORT})
add_definitions(-DEEZ_FOR_LVGL)
add_subdirectory(eez-framework)
target_link_libraries(index
lvgl
lv_drivers
eez-framework
)
else()
target_link_libraries(index
lvgl
lv_drivers
)
endif(${HAS_FLOW_SUPPORT})
endif(${LVGL9})
set_target_properties(index PROPERTIES LINK_FLAGS "--shell-file ${PROJECT_SOURCE_DIR}/lvgl_shell.html -s SINGLE_FILE=1")