Skip to content

Commit 2f98b5d

Browse files
authored
more granular enable of tools
1 parent ba49edb commit 2f98b5d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

platform.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def configure_default_packages(self, variables, targets):
5454
# Install all tools and toolchains
5555
self.packages["tl-install"]["optional"] = True
5656
for p in self.packages:
57-
if p in ("tool-mklittlefs", "tool-mkfatfs", "tool-mkspiffs", "tool-dfuutil", "tool-openocd", "tool-cmake", "tool-ninja", "tool-cppcheck", "contrib-piohome", "contrib-pioremote", "tc-ulp", "tc-rv32", "tl-xt-gdb", "tl-rv-gdb"):
57+
if p in ("tool-mklittlefs", "tool-mkfatfs", "tool-mkspiffs", "tool-dfuutil", "tool-openocd", "tool-cmake", "tool-ninja", "tool-cppcheck", "tool-clangtidy", "tool-pvs-studio", "contrib-piohome", "contrib-pioremote", "tc-ulp", "tc-rv32", "tl-xt-gdb", "tl-rv-gdb"):
5858
tl_path = "file://" + join(IDF_TOOLS_PATH_DEFAULT, "tools", p)
5959
self.packages[p]["optional"] = False
6060
self.packages[p]["version"] = tl_path
@@ -63,6 +63,19 @@ def configure_default_packages(self, variables, targets):
6363
if p in ("tool-cmake", "tool-ninja", "tc-ulp"):
6464
self.packages[p]["optional"] = False if "espidf" in frameworks else True
6565

66+
# Enable debug tool gdb only when build debug is enabled
67+
if variables.get("build_type") or "debug" in "".join(targets):
68+
self.packages["tl-rv-gdb"]["optional"] = False if mcu in ["esp32c2", "esp32c3", "esp32c6", "esp32h2"] else True
69+
self.packages["tl-xt-gdb"]["optional"] = False if not mcu in ["esp32c2", "esp32c3", "esp32c6", "esp32h2"] else True
70+
else:
71+
self.packages["tl-rv-gdb"]["optional"] = True
72+
self.packages["tl-xt-gdb"]["optional"] = True
73+
74+
# Enable check tools only when "check_tool" is set in platformio.ini
75+
for p in self.packages:
76+
if p in ("tool-cppcheck", "tool-clangtidy", "tool-pvs-studio"):
77+
self.packages[p]["optional"] = False if str(variables.get("check_tool")).strip("['']") in p else True
78+
6679
if "arduino" in frameworks:
6780
self.packages["framework-arduinoespressif32"]["optional"] = False
6881
self.packages["framework-arduinoespressif32-libs"]["optional"] = False

0 commit comments

Comments
 (0)