From 937ab6760f2ab67de811ee9a0978c4ec601816ce Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 18 Jan 2025 15:47:53 +0100 Subject: [PATCH] shorten include path only for windows since it hits compile performance --- builder/frameworks/arduino.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 7bf2c53..1b13628 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -26,6 +26,7 @@ import subprocess import json import semantic_version import os +import sys import shutil from os.path import join @@ -44,6 +45,7 @@ mcu = board.get("build.mcu", "esp32") board_sdkconfig = board.get("espidf.custom_sdkconfig", "") entry_custom_sdkconfig = "\n" flag_custom_sdkconfig = False +IS_WINDOWS = sys.platform.startswith("win") if config.has_option("env:"+env["PIOENV"], "custom_sdkconfig"): entry_custom_sdkconfig = env.GetProjectOption("custom_sdkconfig") @@ -248,7 +250,8 @@ if flag_custom_sdkconfig == True and flag_any_custom_sdkconfig == False: call_compile_libs() if "arduino" in env.subst("$PIOFRAMEWORK") and "espidf" not in env.subst("$PIOFRAMEWORK") and env.subst("$ARDUINO_LIB_COMPILE_FLAG") in ("Inactive", "True"): - env.AddBuildMiddleware(shorthen_includes) + if IS_WINDOWS: + env.AddBuildMiddleware(shorthen_includes) if os.path.exists(join(platform.get_package_dir( "framework-arduinoespressif32"), "tools", "platformio-build.py")): PIO_BUILD = "platformio-build.py"