extmod/btstack: Add cmake support for BTstack.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Peter Harper 2022-08-02 17:34:30 +01:00 committed by Damien George
parent 1de335f7ff
commit 35182a8688
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,60 @@
set(BTSTACK_LIB_DIR "${MICROPY_DIR}/lib/btstack")
set(BTSTACK_EXTMOD_DIR "${MICROPY_DIR}/extmod/btstack")
add_library(micropy_extmod_btstack INTERFACE)
target_include_directories(micropy_extmod_btstack INTERFACE
${MICROPY_DIR}/
${MICROPY_PORT_DIR}/
${BTSTACK_EXTMOD_DIR}/
${BTSTACK_LIB_DIR}/src
${BTSTACK_LIB_DIR}/3rd-party/bluedroid/decoder/include
${BTSTACK_LIB_DIR}/3rd-party/bluedroid/encoder/include
${BTSTACK_LIB_DIR}/3rd-party/md5
${BTSTACK_LIB_DIR}/3rd-party/yxml
)
target_sources(micropy_extmod_btstack INTERFACE
${BTSTACK_LIB_DIR}/platform/embedded/hci_dump_embedded_stdout.c
${BTSTACK_LIB_DIR}/src/ad_parser.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/ancs_client.c
${BTSTACK_LIB_DIR}/src/ble/att_db.c
${BTSTACK_LIB_DIR}/src/ble/att_db_util.c
${BTSTACK_LIB_DIR}/src/ble/att_dispatch.c
${BTSTACK_LIB_DIR}/src/ble/att_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/battery_service_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/cycling_power_service_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/cycling_speed_and_cadence_service_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/device_information_service_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/heart_rate_service_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/hids_device.c
${BTSTACK_LIB_DIR}/src/mesh/gatt-service/mesh_provisioning_service_server.c
${BTSTACK_LIB_DIR}/src/mesh/gatt-service/mesh_proxy_service_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/nordic_spp_service_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt-service/ublox_spp_service_server.c
${BTSTACK_LIB_DIR}/src/ble/gatt_client.c
${BTSTACK_LIB_DIR}/src/ble/le_device_db_memory.c
${BTSTACK_LIB_DIR}/src/ble/sm.c
${BTSTACK_LIB_DIR}/src/btstack_audio.c
${BTSTACK_LIB_DIR}/src/btstack_base64_decoder.c
${BTSTACK_LIB_DIR}/src/btstack_crypto.c
${BTSTACK_LIB_DIR}/src/btstack_hid_parser.c
${BTSTACK_LIB_DIR}/src/btstack_linked_list.c
${BTSTACK_LIB_DIR}/src/btstack_memory.c
${BTSTACK_LIB_DIR}/src/btstack_memory_pool.c
${BTSTACK_LIB_DIR}/src/btstack_resample.c
${BTSTACK_LIB_DIR}/src/btstack_ring_buffer.c
${BTSTACK_LIB_DIR}/src/btstack_run_loop.c
${BTSTACK_LIB_DIR}/src/btstack_run_loop_base.c
${BTSTACK_LIB_DIR}/src/btstack_slip.c
${BTSTACK_LIB_DIR}/src/btstack_tlv.c
${BTSTACK_LIB_DIR}/src/btstack_tlv_none.c
${BTSTACK_LIB_DIR}/src/btstack_util.c
${BTSTACK_LIB_DIR}/src/hci.c
${BTSTACK_LIB_DIR}/src/hci_cmd.c
${BTSTACK_LIB_DIR}/src/hci_dump.c
${BTSTACK_LIB_DIR}/src/hci_transport_em9304_spi.c
${BTSTACK_LIB_DIR}/src/hci_transport_h4.c
${BTSTACK_LIB_DIR}/src/l2cap.c
${BTSTACK_LIB_DIR}/src/l2cap_signaling.c
)

View File

@ -6,6 +6,7 @@ set(MICROPY_OOFATFS_DIR "${MICROPY_DIR}/lib/oofatfs")
set(MICROPY_SOURCE_EXTMOD set(MICROPY_SOURCE_EXTMOD
${MICROPY_DIR}/shared/libc/abort_.c ${MICROPY_DIR}/shared/libc/abort_.c
${MICROPY_DIR}/shared/libc/printf.c ${MICROPY_DIR}/shared/libc/printf.c
${MICROPY_EXTMOD_DIR}/btstack/modbluetooth_btstack.c
${MICROPY_EXTMOD_DIR}/machine_bitstream.c ${MICROPY_EXTMOD_DIR}/machine_bitstream.c
${MICROPY_EXTMOD_DIR}/machine_i2c.c ${MICROPY_EXTMOD_DIR}/machine_i2c.c
${MICROPY_EXTMOD_DIR}/machine_mem.c ${MICROPY_EXTMOD_DIR}/machine_mem.c