From 2a61ce80b8d63997415d9ba71f842f6ce20fc3c4 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sat, 31 Oct 2020 19:14:10 -0300 Subject: [PATCH] Put PIO "debug" build in the corner (#19975) --- buildroot/share/PlatformIO/scripts/common-cxxflags.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index 3e75434ee7..ee2afb1d26 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -10,3 +10,13 @@ env.Append(CXXFLAGS=[ #"-Wno-maybe-uninitialized", #"-Wno-sign-compare" ]) + +# Useful for JTAG debugging +# +# It will separe release and debug build folders. +# It useful when we need keep two live versions: one debug, for debugging, +# other release, for flashing. +# Without this, PIO will recompile everything twice for any small change. +# +if env.GetBuildType() == "debug": + env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug'