Skip to content

Commit febb0e8

Browse files
committed
fix: filter out source files from header extraction
1 parent 5e60be4 commit febb0e8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ecsact/private/ecsact_build_recipe.bzl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ CPP_HEADER_SUFFIXES = [
1515
".h",
1616
".hpp",
1717
".inl",
18+
".ipp",
1819
]
1920

21+
def _is_cc_header(p):
22+
for cpp_header_suffix in CPP_HEADER_SUFFIXES:
23+
if p.endswith(cpp_header_suffix):
24+
return True
25+
return False
26+
2027
def _strip_external(p):
2128
# type: (string) -> string
2229
EXTERNAL_PREFIX = "external/"
@@ -27,9 +34,8 @@ def _strip_external(p):
2734
def _source_outdir(src):
2835
# type: (File) -> string
2936
src_path = src.path
30-
for cpp_header_suffix in CPP_HEADER_SUFFIXES:
31-
if src.path.endswith(cpp_header_suffix):
32-
return "include/" + _strip_external(src.dirname)
37+
if _is_cc_header(src.path):
38+
return "include/" + _strip_external(src.dirname)
3339
return _strip_external(src.dirname)
3440

3541
def _dedup_sources(source_paths):
@@ -89,6 +95,9 @@ def _ecsact_build_recipe(ctx):
8995
for hdr in cc_dep_compilation_context.headers.to_list():
9096
hdr_prefix = ""
9197

98+
if not _is_cc_header(hdr.path):
99+
continue
100+
92101
for quote_inc in cc_dep_compilation_context.quote_includes.to_list():
93102
if hdr.path.startswith(quote_inc):
94103
hdr_prefix = quote_inc

0 commit comments

Comments
 (0)