@@ -161,6 +161,10 @@ def is_header(file):
161
161
]
162
162
163
163
164
+ def is_public_header (header ):
165
+ return "__" not in header and not header .startswith ("ext/" )
166
+
167
+
164
168
def is_modulemap_header (header ):
165
169
"""Returns whether a header should be listed in the modulemap"""
166
170
# TODO: Should `__config_site` be in the modulemap?
@@ -192,25 +196,26 @@ def is_modulemap_header(header):
192
196
assert libcxx_root .exists ()
193
197
194
198
all_headers = sorted (
195
- p .relative_to (include ).as_posix () for p in include .rglob ("[a -z]*" ) if is_header (p )
199
+ p .relative_to (include ).as_posix () for p in include .rglob ("[_a -z]*" ) if is_header (p )
196
200
)
197
201
toplevel_headers = sorted (
198
- p .relative_to (include ).as_posix () for p in include .glob ("[a -z]*" ) if is_header (p )
202
+ p .relative_to (include ).as_posix () for p in include .glob ("[_a -z]*" ) if is_header (p )
199
203
)
200
204
experimental_headers = sorted (
201
205
p .relative_to (include ).as_posix ()
202
206
for p in include .glob ("experimental/[a-z]*" )
203
207
if is_header (p )
204
208
)
205
- public_headers = toplevel_headers + experimental_headers
209
+
210
+ public_headers = [p for p in all_headers if is_public_header (p )]
206
211
207
212
# The headers used in the std and std.compat modules.
208
213
#
209
214
# This is the set of all C++23-and-later headers, excluding C compatibility headers.
210
215
module_headers = [
211
216
header
212
217
for header in toplevel_headers
213
- if not header .endswith (".h" )
218
+ if not header .endswith (".h" ) and is_public_header ( header )
214
219
# These headers have been removed in C++20 so are never part of a module.
215
220
and not header in ["ccomplex" , "ciso646" , "cstdbool" , "ctgmath" ]
216
221
]
0 commit comments