From 0a3dcf627ba9b9f0b0bfc15474265cf5e73b8cce Mon Sep 17 00:00:00 2001 From: Brad Barnett <127794626+bdbarnett@users.noreply.github.com> Date: Tue, 22 Sep 2026 07:43:50 -0500 Subject: [PATCH] micropython.cmake: skip the driver on non-esp32 CMake ports _audioif.c includes ESP-IDF's driver/i2s_std.h, and cmods links every usermod it finds, so an rp2 build died at the last file whether or not it wanted the pump. The same guard cameraif carries. Closes #15 --- micropython.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/micropython.cmake b/micropython.cmake index 1eb2911..49676ad 100644 --- a/micropython.cmake +++ b/micropython.cmake @@ -10,6 +10,16 @@ set(AUDIOPUMP_MOD_DIR ${CMAKE_CURRENT_LIST_DIR}) +# esp32 is the only CMake port this driver has: _audioif.c includes ESP-IDF's +# driver/i2s_std.h, and cmods links every usermod it finds into every build. +# Without this guard an rp2 (or any non-IDF CMake) build fails at the last +# file with "driver/i2s_std.h: No such file" whether or not it wanted the +# pump (#15). cameraif carries the same guard for the same reason. +if(NOT ESP_PLATFORM) + message(STATUS "audioif: skipped -- the platform driver is esp32-only on CMake ports") + return() +endif() + if(NOT DEFINED AUDIOPUMP_AUDIODSP_DIR) if(EXISTS ${AUDIOPUMP_MOD_DIR}/../audiodsp/src/shared/audiodsp_port.h) set(AUDIOPUMP_AUDIODSP_DIR ${AUDIOPUMP_MOD_DIR}/../audiodsp)