mirror of
https://github.com/esphome/esphome.git
synced 2026-07-11 01:15:33 +00:00
[core] Exclude entity_types.h from generated esphome.h
The X-macro file requires ENTITY_TYPE_ and ENTITY_CONTROLLER_TYPE_ macros to be defined before inclusion. The generated esphome.h includes all .h files bare, which causes compilation errors.
This commit is contained in:
+4
-1
@@ -196,9 +196,12 @@ def copy_src_tree():
|
||||
source_files_l.sort()
|
||||
|
||||
# Build #include list for esphome.h
|
||||
# X-macro files are included multiple times with different macro definitions
|
||||
# and must not be included bare in esphome.h
|
||||
esphome_h_exclude = {Path("esphome/core/entity_types.h")}
|
||||
include_l = []
|
||||
for target, _ in source_files_l:
|
||||
if target.suffix in HEADER_FILE_EXTENSIONS:
|
||||
if target.suffix in HEADER_FILE_EXTENSIONS and target not in esphome_h_exclude:
|
||||
include_l.append(f'#include "{target}"')
|
||||
include_l.append("")
|
||||
include_s = "\n".join(include_l)
|
||||
|
||||
Reference in New Issue
Block a user