Fix cross-platform build: replace ${PROJECT_DIR} with relative paths

platformio.ini:
- Replace -I${PROJECT_DIR}/lib, -I${PROJECT_DIR}/deps/... with relative
  paths (-Ilib, -Ideps/...) in both tdeck-bluedroid and tdeck environments;
  ${PROJECT_DIR} is mangled on Windows inside build_flags, causing include
  paths to resolve inside the PlatformIO builder directory instead of the
  project root
- Remove hardcoded -I.pio/libdeps/tdeck/TinyGPSPlus/src and
  -I.pio/libdeps/tdeck/NimBLE-Arduino/src; these paths reference generated
  cache, break on fresh clones, and are redundant with lib_ldf_mode = deep+
- Fix OTA upload_command: replace python3 with $PYTHONEXE so it resolves
  to PlatformIO's bundled Python on Windows, macOS, and Linux

src/main.cpp, lib/tdeck_ui/UI/LXMF/UIManager.cpp:
- Change #include "tone/Tone.h" to #include "Tone.h"; PlatformIO
  automatically adds -Ilib/tone for local libraries, making the
  subdirectory prefix unnecessary and broken when -Ilib is not effective

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
davidcranor
2026-03-03 15:19:32 -05:00
co-authored by Claude Sonnet 4.6
parent 774f055362
commit 827ff2eb42
3 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
#include <lvgl.h>
#include <Preferences.h>
#include "Log.h"
#include "tone/Tone.h"
#include "Tone.h"
#include "../LVGL/LVGLLock.h"
#include "lxst_audio.h"
#include "Packet.h"
+7 -9
View File
@@ -58,9 +58,9 @@ build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DLV_CONF_INCLUDE_SIMPLE
-I${PROJECT_DIR}/lib
-I${PROJECT_DIR}/deps/microReticulum/lib/libbz2
-I${PROJECT_DIR}/deps/microReticulum/src
-Ilib
-Ideps/microReticulum/lib/libbz2
-Ideps/microReticulum/src
-DBZ_NO_STDIO
-DUSE_BLUEDROID
-Os
@@ -138,11 +138,9 @@ build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DLV_CONF_INCLUDE_SIMPLE
-I${PROJECT_DIR}/lib
-I${PROJECT_DIR}/deps/microReticulum/lib/libbz2
-I${PROJECT_DIR}/deps/microReticulum/src
-I.pio/libdeps/tdeck/TinyGPSPlus/src
-I.pio/libdeps/tdeck/NimBLE-Arduino/src
-Ilib
-Ideps/microReticulum/lib/libbz2
-Ideps/microReticulum/src
-DBZ_NO_STDIO
-DUSE_NIMBLE
-DCONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=1
@@ -163,4 +161,4 @@ build_flags =
[env:tdeck-ota]
extends = env:tdeck
upload_protocol = custom
upload_command = python3 tools/espota.py -i pyxis-tdeck.local -p 3232 -f $SOURCE
upload_command = "$PYTHONEXE" tools/espota.py -i pyxis-tdeck.local -p 3232 -f $SOURCE
+1 -1
View File
@@ -58,7 +58,7 @@
#include <UI/LXMF/SettingsScreen.h>
// Audio notifications
#include "tone/Tone.h"
#include "Tone.h"
// Logging
#include <Log.h>