Add support to build for rp2 using cmake.

The changes are not specific to rp2. cmake support was added and
the rp2 port of micropython only works with cmake.
pull/20/head
udifuchs 2021-04-12 22:29:52 -05:00
rodzic 0eee52e9ae
commit 3c15f5e5cb
4 zmienionych plików z 22 dodań i 2 usunięć

Wyświetl plik

@ -42,6 +42,15 @@ And then compile the module with specified USER_C_MODULES dir
$ make USER_C_MODULES=../../../st7789_mpy/ all
For rp2040 (requires micropython 1.15):
$ cd micropython/ports/rp2
And then compile the module with specified USER_C_MODULES dir
$ make USER_C_MODULES=../../../st7789_mpy/st7789/micropython.cmake all
If you have other user modules, copy the st7789_driver/st7789 to
the user modules directory

Wyświetl plik

@ -0,0 +1,11 @@
add_library(usermod_st7789 INTERFACE)
target_sources(usermod_st7789 INTERFACE
${CMAKE_CURRENT_LIST_DIR}/st7789.c
)
target_include_directories(usermod_st7789 INTERFACE
${CMAKE_CURRENT_LIST_DIR}
)
target_link_libraries(usermod INTERFACE usermod_st7789)

Wyświetl plik

@ -2,5 +2,5 @@ ST7789_MOD_DIR := $(USERMOD_DIR)
SRC_USERMOD += $(addprefix $(ST7789_MOD_DIR)/, \
st7789.c \
)
CFLAGS_USERMOD += -I$(ST7789_MOD_DIR) -DMODULE_ST7789_ENABLED=1
CFLAGS_USERMOD += -I$(ST7789_MOD_DIR)
# CFLAGS_USERMOD += -DEXPOSE_EXTRA_METHODS=1

Wyświetl plik

@ -663,4 +663,4 @@ const mp_obj_module_t mp_module_st7789 = {
.globals = (mp_obj_dict_t*)&mp_module_st7789_globals,
};
MP_REGISTER_MODULE(MP_QSTR_st7789, mp_module_st7789, MODULE_ST7789_ENABLED);
MP_REGISTER_MODULE(MP_QSTR_st7789, mp_module_st7789, 1);