|
| 1 | +# CMake fragment for MicroPython extmod component |
| 2 | + |
| 3 | +set(MICROPY_EXTMOD_DIR "${MICROPY_DIR}/extmod") |
| 4 | +set(MICROPY_OOFATFS_DIR "${MICROPY_DIR}/lib/oofatfs") |
| 5 | + |
| 6 | +set(MICROPY_SOURCE_EXTMOD |
| 7 | + ${MICROPY_DIR}/lib/embed/abort_.c |
| 8 | + ${MICROPY_DIR}/lib/utils/printf.c |
| 9 | + ${MICROPY_EXTMOD_DIR}/machine_i2c.c |
| 10 | + ${MICROPY_EXTMOD_DIR}/machine_mem.c |
| 11 | + ${MICROPY_EXTMOD_DIR}/machine_pulse.c |
| 12 | + ${MICROPY_EXTMOD_DIR}/machine_signal.c |
| 13 | + ${MICROPY_EXTMOD_DIR}/machine_spi.c |
| 14 | + ${MICROPY_EXTMOD_DIR}/modbluetooth.c |
| 15 | + ${MICROPY_EXTMOD_DIR}/modbtree.c |
| 16 | + ${MICROPY_EXTMOD_DIR}/modframebuf.c |
| 17 | + ${MICROPY_EXTMOD_DIR}/modonewire.c |
| 18 | + ${MICROPY_EXTMOD_DIR}/moduasyncio.c |
| 19 | + ${MICROPY_EXTMOD_DIR}/modubinascii.c |
| 20 | + ${MICROPY_EXTMOD_DIR}/moducryptolib.c |
| 21 | + ${MICROPY_EXTMOD_DIR}/moductypes.c |
| 22 | + ${MICROPY_EXTMOD_DIR}/moduhashlib.c |
| 23 | + ${MICROPY_EXTMOD_DIR}/moduheapq.c |
| 24 | + ${MICROPY_EXTMOD_DIR}/modujson.c |
| 25 | + ${MICROPY_EXTMOD_DIR}/modurandom.c |
| 26 | + ${MICROPY_EXTMOD_DIR}/modure.c |
| 27 | + ${MICROPY_EXTMOD_DIR}/moduselect.c |
| 28 | + ${MICROPY_EXTMOD_DIR}/modussl_axtls.c |
| 29 | + ${MICROPY_EXTMOD_DIR}/modussl_mbedtls.c |
| 30 | + ${MICROPY_EXTMOD_DIR}/modutimeq.c |
| 31 | + ${MICROPY_EXTMOD_DIR}/moduwebsocket.c |
| 32 | + ${MICROPY_EXTMOD_DIR}/moduzlib.c |
| 33 | + ${MICROPY_EXTMOD_DIR}/modwebrepl.c |
| 34 | + ${MICROPY_EXTMOD_DIR}/uos_dupterm.c |
| 35 | + ${MICROPY_EXTMOD_DIR}/utime_mphal.c |
| 36 | + ${MICROPY_EXTMOD_DIR}/vfs.c |
| 37 | + ${MICROPY_EXTMOD_DIR}/vfs_blockdev.c |
| 38 | + ${MICROPY_EXTMOD_DIR}/vfs_fat.c |
| 39 | + ${MICROPY_EXTMOD_DIR}/vfs_fat_diskio.c |
| 40 | + ${MICROPY_EXTMOD_DIR}/vfs_fat_file.c |
| 41 | + ${MICROPY_EXTMOD_DIR}/vfs_lfs.c |
| 42 | + ${MICROPY_EXTMOD_DIR}/vfs_posix.c |
| 43 | + ${MICROPY_EXTMOD_DIR}/vfs_posix_file.c |
| 44 | + ${MICROPY_EXTMOD_DIR}/vfs_reader.c |
| 45 | + ${MICROPY_EXTMOD_DIR}/virtpin.c |
| 46 | + ${MICROPY_EXTMOD_DIR}/nimble/modbluetooth_nimble.c |
| 47 | +) |
| 48 | + |
| 49 | +# Library for btree module and associated code |
| 50 | + |
| 51 | +set(MICROPY_LIB_BERKELEY_DIR "${MICROPY_DIR}/lib/berkeley-db-1.xx") |
| 52 | + |
| 53 | +if(EXISTS "${MICROPY_LIB_BERKELEY_DIR}/btree/bt_close.c") |
| 54 | + add_library(micropy_extmod_btree OBJECT |
| 55 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_close.c |
| 56 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_conv.c |
| 57 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_debug.c |
| 58 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_delete.c |
| 59 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_get.c |
| 60 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_open.c |
| 61 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_overflow.c |
| 62 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_page.c |
| 63 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_put.c |
| 64 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_search.c |
| 65 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_seq.c |
| 66 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_split.c |
| 67 | + ${MICROPY_LIB_BERKELEY_DIR}/btree/bt_utils.c |
| 68 | + ${MICROPY_LIB_BERKELEY_DIR}/mpool/mpool.c |
| 69 | + ) |
| 70 | + |
| 71 | + target_include_directories(micropy_extmod_btree PRIVATE |
| 72 | + ${MICROPY_LIB_BERKELEY_DIR}/PORT/include |
| 73 | + ) |
| 74 | + |
| 75 | + target_compile_definitions(micropy_extmod_btree PRIVATE |
| 76 | + __DBINTERFACE_PRIVATE=1 |
| 77 | + mpool_error=printf |
| 78 | + abort=abort_ |
| 79 | + "virt_fd_t=void*" |
| 80 | + ) |
| 81 | + |
| 82 | + # The include directories and compile definitions below are needed to build |
| 83 | + # modbtree.c and should be added to the main MicroPython target. |
| 84 | + |
| 85 | + list(APPEND MICROPY_INC_CORE |
| 86 | + "${MICROPY_LIB_BERKELEY_DIR}/PORT/include" |
| 87 | + ) |
| 88 | + |
| 89 | + list(APPEND MICROPY_DEF_CORE |
| 90 | + __DBINTERFACE_PRIVATE=1 |
| 91 | + "virt_fd_t=void*" |
| 92 | + ) |
| 93 | +endif() |
0 commit comments