Skip to content

Commit d46a584

Browse files
authored
shorten include path only for windows
since it hits compile performance
1 parent 7fd07d6 commit d46a584

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builder/frameworks/arduino.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import json
2828
import semantic_version
2929
import os
30+
import sys
3031
import shutil
3132
from os.path import join
3233

@@ -45,6 +46,7 @@
4546
board_sdkconfig = board.get("espidf.custom_sdkconfig", "")
4647
entry_custom_sdkconfig = "\n"
4748
flag_custom_sdkconfig = False
49+
IS_WINDOWS = sys.platform.startswith("win")
4850

4951
if config.has_option("env:"+env["PIOENV"], "custom_sdkconfig"):
5052
entry_custom_sdkconfig = env.GetProjectOption("custom_sdkconfig")
@@ -256,7 +258,8 @@ def shorthen_includes(env, node):
256258
call_compile_libs()
257259

258260
if "arduino" in env.subst("$PIOFRAMEWORK") and "espidf" not in env.subst("$PIOFRAMEWORK") and env.subst("$ARDUINO_LIB_COMPILE_FLAG") in ("Inactive", "True"):
259-
env.AddBuildMiddleware(shorthen_includes)
261+
if IS_WINDOWS:
262+
env.AddBuildMiddleware(shorthen_includes)
260263
if os.path.exists(join(FRAMEWORK_DIR, "tools", "platformio-build.py")):
261264
PIO_BUILD = "platformio-build.py"
262265
else:

0 commit comments

Comments
 (0)