2
2
find_package (Python3 REQUIRED COMPONENTS Interpreter)
3
3
find_program (AWK awk mawk gawk)
4
4
5
- set (LV_BINDINGS_DIR ${MICROPY_DIR} /lib/lv_bindings )
5
+ set (LV_BINDINGS_DIR ${CMAKE_CURRENT_LIST_DIR} )
6
6
7
7
# Common function for creating LV bindings
8
8
@@ -81,7 +81,9 @@ set(LV_PNG_DIR ${LV_BINDINGS_DIR}/driver/png/lodepng)
81
81
set (LV_MP ${CMAKE_BINARY_DIR} /lv_mp.c)
82
82
set (LV_PNG ${CMAKE_BINARY_DIR} /lv_png.c)
83
83
set (LV_PNG_C ${CMAKE_BINARY_DIR} /lv_png_c.c)
84
- set (LV_ESPIDF ${CMAKE_BINARY_DIR} /lv_espidf.c)
84
+ if (ESP_PLATFORM)
85
+ set (LV_ESPIDF ${CMAKE_BINARY_DIR} /lv_espidf.c)
86
+ endif ()
85
87
86
88
# Function for creating all specific bindings
87
89
@@ -105,7 +107,11 @@ function(all_lv_bindings)
105
107
106
108
file (GLOB_RECURSE LV_PNG_HEADERS ${LV_PNG_DIR} /*.h)
107
109
configure_file (${LV_PNG_DIR} /lodepng.cpp ${LV_PNG_C} COPYONLY )
108
- idf_build_set_property(COMPILE_DEFINITIONS "${LV_PNG_PP_OPTIONS} " APPEND )
110
+ if (ESP_PLATFORM)
111
+ idf_build_set_property(COMPILE_DEFINITIONS "${LV_PNG_PP_OPTIONS} " APPEND )
112
+ else ()
113
+ add_definitions (${LV_PNG_PP_OPTIONS} )
114
+ endif ()
109
115
lv_bindings(
110
116
OUTPUT
111
117
${LV_PNG}
@@ -120,30 +126,31 @@ function(all_lv_bindings)
120
126
)
121
127
122
128
# ESPIDF bindings
123
-
124
- file (GLOB_RECURSE LV_ESPIDF_HEADERS ${IDF_PATH} /components/*.h ${LV_BINDINGS_DIR} /driver/esp32/*.h)
125
- lv_bindings(
126
- OUTPUT
127
- ${LV_ESPIDF}
128
- INPUT
129
- ${LV_BINDINGS_DIR} /driver/esp32/espidf.h
130
- DEPENDS
131
- ${LV_ESPIDF_HEADERS}
132
- PP_OPTIONS
133
- -DPYCPARSER
134
- GEN_OPTIONS
135
- -M espidf
136
- FILTER
137
- i2s_ll.h
138
- i2s_hal.h
139
- esp_intr_alloc.h
140
- soc/spi_periph.h
141
- rom/ets_sys.h
142
- soc/sens_struct.h
143
- soc/rtc.h
144
- driver/periph_ctrl.h
145
- include /esp_private
146
- )
129
+ if (ESP_PLATFORM)
130
+ file (GLOB_RECURSE LV_ESPIDF_HEADERS ${IDF_PATH} /components/*.h ${LV_BINDINGS_DIR} /driver/esp32/*.h)
131
+ lv_bindings(
132
+ OUTPUT
133
+ ${LV_ESPIDF}
134
+ INPUT
135
+ ${LV_BINDINGS_DIR} /driver/esp32/espidf.h
136
+ DEPENDS
137
+ ${LV_ESPIDF_HEADERS}
138
+ PP_OPTIONS
139
+ -DPYCPARSER
140
+ GEN_OPTIONS
141
+ -M espidf
142
+ FILTER
143
+ i2s_ll.h
144
+ i2s_hal.h
145
+ esp_intr_alloc.h
146
+ soc/spi_periph.h
147
+ rom/ets_sys.h
148
+ soc/sens_struct.h
149
+ soc/rtc.h
150
+ driver/periph_ctrl.h
151
+ include /esp_private
152
+ )
153
+ endif (ESP_PLATFORM)
147
154
148
155
endfunction ()
149
156
@@ -158,16 +165,16 @@ set(LV_INCLUDE
158
165
159
166
set (LV_SRC
160
167
${LV_MP}
161
-
162
- ${LV_BINDINGS_DIR} /driver/esp32/espidf.c
163
- ${LV_BINDINGS_DIR} /driver/esp32/modrtch.c
164
- ${LV_BINDINGS_DIR} /driver/esp32/sh2lib.c
165
-
166
168
${LV_PNG}
167
169
${LV_PNG_C}
168
170
${LV_BINDINGS_DIR} /driver/png/mp_lodepng.c
169
-
170
- ${LV_ESPIDF}
171
171
)
172
172
173
-
173
+ if (ESP_PLATFORM)
174
+ LIST (APPEND LV_SRC
175
+ ${LV_BINDINGS_DIR} /driver/esp32/espidf.c
176
+ ${LV_BINDINGS_DIR} /driver/esp32/modrtch.c
177
+ ${LV_BINDINGS_DIR} /driver/esp32/sh2lib.c
178
+ ${LV_ESPIDF}
179
+ )
180
+ endif (ESP_PLATFORM)
0 commit comments