diff --git a/esphome/build_gen/espidf.py b/esphome/build_gen/espidf.py index b8f5e95db5..f461e0353d 100644 --- a/esphome/build_gen/espidf.py +++ b/esphome/build_gen/espidf.py @@ -337,6 +337,7 @@ def _pch_cmake() -> str: # a .gch drop out of the TU depfiles, and prepare_pch() touches the # header whenever it rebuilds the .gch so consumers recompile. target_compile_options(${{COMPONENT_LIB}} PRIVATE + "$<$:-Winvalid-pch>" "$<$:-include>" "$<$:{PCH_HEADER_NAME}>" )