File
Blob: archive/fft-benchmark/firmware/main/CMakeLists.txt
| 1 | idf_component_register(SRCS "../platform/entry.c" "../platform/board.c" "../platform/peer.c" |
| 2 | "../platform/http.c" "../platform/spectrum_benchmark.c" WHOLE_ARCHIVE |
| 3 | INCLUDE_DIRS "../platform/include" "../platform" "${CMAKE_BINARY_DIR}/private" |
| 4 | PRIV_REQUIRES esp_psram esp_driver_gpio esp_wifi esp_netif esp_event |
| 5 | esp_timer esp_system spi_flash esp_partition heap json esp_peer esp_http_client esp-tls pthread vfs esp-dsp esp_audio_codec) |
| 6 | |
| 7 | set(RUST_TARGET "xtensa-esp32s3-espidf") |
| 8 | set(RUST_TARGET_DIR "${CMAKE_BINARY_DIR}/cargo") |
| 9 | set(RUST_ARCHIVE "${RUST_TARGET_DIR}/${RUST_TARGET}/release/libesp32_radio.a") |
| 10 | add_custom_target(radio_rust_build |
| 11 | COMMAND ${CMAKE_COMMAND} -E env |
| 12 | "RUSTFLAGS=--cfg espidf_time64" |
| 13 | "CARGO_TARGET_DIR=${RUST_TARGET_DIR}" |
| 14 | cargo +esp-radio build --manifest-path "${CMAKE_CURRENT_LIST_DIR}/../Cargo.toml" |
| 15 | --package esp32-radio --release --locked --target ${RUST_TARGET} |
| 16 | -Zbuild-std=std,panic_abort |
| 17 | BYPRODUCTS "${RUST_ARCHIVE}" |
| 18 | WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/.." |
| 19 | VERBATIM USES_TERMINAL) |
| 20 | add_prebuilt_library(radio_rust "${RUST_ARCHIVE}" PRIV_REQUIRES pthread vfs esp-dsp esp_audio_codec) |
| 21 | add_dependencies(radio_rust radio_rust_build) |
| 22 | target_link_libraries(${COMPONENT_LIB} PRIVATE radio_rust) |