From 2778c277d64a243584dd3ee3e9e2c35e2f25a382 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Mon, 2 Jun 2025 17:20:45 +0200 Subject: [PATCH] add c_mpos/micropython.cmake to fix qr decoding in ESP32 build --- c_mpos/micropython.cmake | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 c_mpos/micropython.cmake diff --git a/c_mpos/micropython.cmake b/c_mpos/micropython.cmake new file mode 100644 index 00000000..32556124 --- /dev/null +++ b/c_mpos/micropython.cmake @@ -0,0 +1,26 @@ +# Seems this must be passed as: +# USER_C_MODULE=/home/user/sources/PiggyOS/c_mpos/micropython.cmake +# ...to make.py when building for esp32 to ensure it gets compiled. + +add_library(usermod_c_mpos INTERFACE) + +set(MPOS_C_INCLUDES) + +set(MPOS_C_SOURCES + ${CMAKE_CURRENT_LIST_DIR}/src/hello_world.c + ${CMAKE_CURRENT_LIST_DIR}/src/quirc_decode.c + ${CMAKE_CURRENT_LIST_DIR}/quirc/lib/identify.c + ${CMAKE_CURRENT_LIST_DIR}/quirc/lib/version_db.c + ${CMAKE_CURRENT_LIST_DIR}/quirc/lib/decode.c + ${CMAKE_CURRENT_LIST_DIR}/quirc/lib/quirc.c +) + +# Add our source files to the lib +target_sources(usermod_c_mpos INTERFACE ${MPOS_C_SOURCES}) + +# Add include directories. +target_include_directories(usermod_c_mpos INTERFACE ${MPOS_C_INCLUDES}) + +# Link our INTERFACE library to the usermod target. +target_link_libraries(usermod INTERFACE usermod_c_mpos) +