mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Fix build on Pico W
Use `lib_ldf_mode=chain+` so the LDF evaluates preprocessor conditions when scanning for library dependencies. Without this, the LDF (in default 'deep' mode) ignores it to find #include <BLEDevice.h> inside the #ifdef ESP32 block in esp32/BLELogInterface.h, pulling in the Arduino-Pico BLE library. That library only compiles correctly when PIO_FRAMEWORK_ARDUINO_ENABLE_BLUETOOTH is set (which enables the required BTstack defines), so without that flag the build fails. chain+ prevents this by honouring the #ifdef ESP32 guard.
This commit is contained in:
parent
382a5403b7
commit
d8e838fe4d
3 changed files with 23 additions and 2 deletions
|
|
@ -2,7 +2,13 @@
|
||||||
#include <Mesh.h>
|
#include <Mesh.h>
|
||||||
|
|
||||||
#include "MyMesh.h"
|
#include "MyMesh.h"
|
||||||
#include <helpers/BLELogInterface.h>
|
#if BLE_PACKET_LOGGING
|
||||||
|
#if defined(NRF52_PLATFORM) || defined(ESP32)
|
||||||
|
#include <helpers/BLELogInterface.h>
|
||||||
|
#else
|
||||||
|
#error "BLE_PACKET_LOGGING is not supported on this platform (only ESP32 and nRF52)"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MESH_PACKET_LOGGING && BLE_PACKET_LOGGING && (defined(NRF52_PLATFORM) || defined(ESP32))
|
#if MESH_PACKET_LOGGING && BLE_PACKET_LOGGING && (defined(NRF52_PLATFORM) || defined(ESP32))
|
||||||
static BLELogInterface ble_log;
|
static BLELogInterface ble_log;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,13 @@
|
||||||
#include <Mesh.h>
|
#include <Mesh.h>
|
||||||
|
|
||||||
#include "MyMesh.h"
|
#include "MyMesh.h"
|
||||||
#include <helpers/BLELogInterface.h>
|
#if BLE_PACKET_LOGGING
|
||||||
|
#if defined(NRF52_PLATFORM) || defined(ESP32)
|
||||||
|
#include <helpers/BLELogInterface.h>
|
||||||
|
#else
|
||||||
|
#error "BLE_PACKET_LOGGING is not supported on this platform (only ESP32 and nRF52)"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MESH_PACKET_LOGGING && BLE_PACKET_LOGGING && (defined(NRF52_PLATFORM) || defined(ESP32))
|
#if MESH_PACKET_LOGGING && BLE_PACKET_LOGGING && (defined(NRF52_PLATFORM) || defined(ESP32))
|
||||||
static BLELogInterface ble_log;
|
static BLELogInterface ble_log;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,15 @@ build_src_filter = ${rp2040_base.build_src_filter}
|
||||||
+<PicoWBoard.cpp>
|
+<PicoWBoard.cpp>
|
||||||
+<../variants/rpi_picow>
|
+<../variants/rpi_picow>
|
||||||
lib_deps = ${rp2040_base.lib_deps}
|
lib_deps = ${rp2040_base.lib_deps}
|
||||||
|
; Use chain+ so the LDF evaluates preprocessor conditions when scanning for
|
||||||
|
; library dependencies. Without this, the LDF (in default 'deep' mode) ignores
|
||||||
|
; #ifdef guards and follows all #include directives unconditionally. That causes
|
||||||
|
; it to find #include <BLEDevice.h> inside the #ifdef ESP32 block in
|
||||||
|
; esp32/BLELogInterface.h, pulling in the Arduino-Pico BLE library. That
|
||||||
|
; library only compiles correctly when PIO_FRAMEWORK_ARDUINO_ENABLE_BLUETOOTH is
|
||||||
|
; set (which enables the required BTstack defines), so without that flag the
|
||||||
|
; build fails. chain+ prevents this by honouring the #ifdef ESP32 guard.
|
||||||
|
lib_ldf_mode = chain+
|
||||||
|
|
||||||
[env:PicoW_repeater]
|
[env:PicoW_repeater]
|
||||||
extends = rpi_picow
|
extends = rpi_picow
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue