Exclude the prefix wrapper from esphome.h, state the failure-path cost honestly

This commit is contained in:
J. Nick Koston
2026-08-27 08:33:25 -05:00
parent 4605ac08a5
commit 92b71f8ce4
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -64,8 +64,9 @@ async def to_code(config: ConfigType) -> None:
# Curated prefix for the pch (the script folds it plus defines.h):
# host has no framework force-includes, and the per-TU cost is the
# STL closure behind the core headers. Measured -43% compile CPU.
# Gated so ESPHOME_PCH_ENABLE=0 restores the strict view; a
# toolchain that cannot load its own pch hits the script's probe.
# Gated so ESPHOME_PCH_ENABLE=0 restores the strict view. When the
# .gch fails to build or load, the force-include stays and every TU
# parses the closure as text: correct, but slower than no pch.
cg.add_platformio_option("build_src_flags", f"-include {HOST_PCH_PREFIX}")
+1
View File
@@ -247,6 +247,7 @@ def copy_src_tree():
Path(
"esphome/core/ring_buffer.h"
), # moved to components/ring_buffer/, removed in 2026.11.0
Path("esphome/core/pch_prefix.h"), # build machinery, not user API
}
include_l = []
for target, _ in source_files_l: