-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmeson.build
More file actions
202 lines (190 loc) · 7.41 KB
/
Copy pathmeson.build
File metadata and controls
202 lines (190 loc) · 7.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
project(
'turbohtml',
'c',
version: run_command(['tools/generate_version.py'], check: true).stdout().strip(),
meson_version: '>=1.5.0',
default_options: ['c_std=c11', 'warning_level=2'],
)
# Freeze the git-derived version into the sdist so wheels built from it need no git history.
meson.add_dist_script('tools/generate_version.py', '--write', 'src/turbohtml/_version.py', '--meson-dist')
# Keep the development-only submodule corpora out of the sdist regardless of local checkout state.
meson.add_dist_script('tools/prune_dist.py')
py = import('python').find_installation(pure: false)
# Strip the shipped object's local .symtab at link time. The release wheels pass -Dstrip=true, but meson-python
# packages straight from the build directory and never runs the install-time strip that option drives, so we do
# it in the link instead. extension_module already defaults to -fvisibility=hidden (only PyInit__html stays
# dynamic) and -Db_lto has dropped the unreachable internals, so .symtab is the last slack: ~65 KB off the Linux
# .so, ~46 KB off the macOS bundle. Gating on -Dstrip keeps every local symbol in the coverage, sanitizer, tsan,
# codspeed, and warnings builds, which never set it, for gdb/gcov/valgrind/CodSpeed. The flag is applied
# directly, not via get_supported_link_arguments: ld64 warns on -Wl,-x and meson's probe misreads the warning as
# unsupported. -Dstrip fires only on the cibuildwheel toolchains (GNU ld/lld, ld64, MSVC), so the branch is safe.
release_link_args = []
if get_option('strip')
strip_system = host_machine.system()
if strip_system == 'darwin'
release_link_args = ['-Wl,-x']
elif strip_system != 'windows' # MSVC's release .pyd carries no symbol table to strip
release_link_args = ['-Wl,--strip-all']
endif
endif
py.extension_module(
'_html',
[
'src/turbohtml/_c/core/module.c',
'src/turbohtml/_c/tokenizer/charref.c',
'src/turbohtml/_c/tokenizer/statemachine.c',
'src/turbohtml/_c/tokenizer/token.c',
'src/turbohtml/_c/tokenizer/tokenizer.c',
'src/turbohtml/_c/tokenizer/sax.c',
'src/turbohtml/_c/tokenizer/rewrite.c',
'src/turbohtml/_c/tokenizer/xml.c',
'src/turbohtml/_c/dom/tree.c',
'src/turbohtml/_c/dom/mutate.c',
'src/turbohtml/_c/dom/binding.c',
'src/turbohtml/_c/dom/node.c',
'src/turbohtml/_c/dom/element.c',
'src/turbohtml/_c/dom/shadow.c',
'src/turbohtml/_c/dom/leaf.c',
'src/turbohtml/_c/dom/traversal.c',
'src/turbohtml/_c/dom/range.c',
'src/turbohtml/_c/dom/observe.c',
'src/turbohtml/_c/dom/treebuild.c',
'src/turbohtml/_c/dom/formatters.c',
'src/turbohtml/_c/dom/document.c',
'src/turbohtml/_c/serialize/escape.c',
'src/turbohtml/_c/serialize/unescape.c',
'src/turbohtml/_c/serialize/markup.c',
'src/turbohtml/_c/serialize/document.c',
'src/turbohtml/_c/serialize/lossless.c',
'src/turbohtml/_c/serialize/c14n.c',
'src/turbohtml/_c/serialize/minify.c',
'src/turbohtml/_c/css/minify/css.c',
'src/turbohtml/_c/serialize/markdown.c',
'src/turbohtml/_c/serialize/text.c',
'src/turbohtml/_c/extract/readability.c',
'src/turbohtml/_c/extract/boilerplate.c',
'src/turbohtml/_c/js/lexer.c',
'src/turbohtml/_c/js/ast.c',
'src/turbohtml/_c/js/parser.c',
'src/turbohtml/_c/js/printer.c',
'src/turbohtml/_c/js/fold.c',
'src/turbohtml/_c/js/mangle.c',
'src/turbohtml/_c/js/minify.c',
'src/turbohtml/_c/js/lexdump.c',
'src/turbohtml/_c/css/select/selector.c',
'src/turbohtml/_c/css/select/to_xpath.c',
'src/turbohtml/_c/query/xslt.c',
'src/turbohtml/_c/query/methods.c',
'src/turbohtml/_c/query/xpath/ast.c',
'src/turbohtml/_c/query/xpath/lexer.c',
'src/turbohtml/_c/query/xpath/parser.c',
'src/turbohtml/_c/query/xpath/eval.c',
'src/turbohtml/_c/query/xpath/functions.c',
'src/turbohtml/_c/query/find.c',
'src/turbohtml/_c/query/facade.c',
'src/turbohtml/_c/clean/sanitize.c',
'src/turbohtml/_c/clean/linkify.c',
'src/turbohtml/_c/clean/phone.c',
'src/turbohtml/_c/clean/phone_binding.c',
'src/turbohtml/_c/extract/links.c',
'src/turbohtml/_c/url/url.c',
'src/turbohtml/_c/url/clean.c',
'src/turbohtml/_c/url/idna.c',
'src/turbohtml/_c/unicode/normalize.c',
'src/turbohtml/_c/url/registrable.c',
'src/turbohtml/_c/extract/annotation.c',
'src/turbohtml/_c/extract/structured_data.c',
'src/turbohtml/_c/extract/feed.c',
'src/turbohtml/_c/extract/tables.c',
'src/turbohtml/_c/extract/dates.c',
'src/turbohtml/_c/css/cssom/cssom.c',
'src/turbohtml/_c/validate/schema.c',
'src/turbohtml/_c/validate/conformance.c',
],
include_directories: include_directories('src/turbohtml/_c'),
link_args: release_link_args,
install: true,
subdir: 'turbohtml',
)
py.install_sources(
[
'src/turbohtml/__init__.py',
'src/turbohtml/__main__.py',
'src/turbohtml/_html.pyi',
'src/turbohtml/build.py',
'src/turbohtml/conformance.py',
'src/turbohtml/convert.py',
'src/turbohtml/cssom.py',
'src/turbohtml/detect.py',
'src/turbohtml/mutations.py',
'src/turbohtml/rewrite.py',
'src/turbohtml/saxparse.py',
'src/turbohtml/treebuild.py',
'src/turbohtml/transform.py',
'src/turbohtml/traverse.py',
'src/turbohtml/validate.py',
'src/turbohtml/py.typed',
],
subdir: 'turbohtml',
)
py.install_sources(
[
'src/turbohtml/extract/__init__.py',
'src/turbohtml/extract/_article.py',
'src/turbohtml/extract/_dates.py',
'src/turbohtml/extract/_feed.py',
'src/turbohtml/extract/_links.py',
'src/turbohtml/extract/_structured_data.py',
'src/turbohtml/extract/_urls.py',
],
subdir: 'turbohtml/extract',
)
py.install_sources(
[
'src/turbohtml/query/__init__.py',
'src/turbohtml/query/_match.py',
'src/turbohtml/query/_xpath.py',
],
subdir: 'turbohtml/query',
)
py.install_sources(
[
'src/turbohtml/clean/__init__.py',
'src/turbohtml/clean/_linkify.py',
'src/turbohtml/clean/_sanitizer.py',
],
subdir: 'turbohtml/clean',
)
py.install_sources(
[
'src/turbohtml/_internal/__init__.py',
'src/turbohtml/_internal/_cssmin.py',
'src/turbohtml/_internal/_jsminify.py',
'src/turbohtml/_internal/_locations.py',
'src/turbohtml/_internal/_minify.py',
'src/turbohtml/_internal/_render.py',
'src/turbohtml/_internal/_selectors.py',
],
subdir: 'turbohtml/_internal',
)
py.install_sources(
[
'src/turbohtml/_stubs/__init__.pyi',
'src/turbohtml/_stubs/dom.pyi',
'src/turbohtml/_stubs/features.pyi',
'src/turbohtml/_stubs/query.pyi',
'src/turbohtml/_stubs/serialize.pyi',
'src/turbohtml/_stubs/tokenizer.pyi',
'src/turbohtml/_stubs/validate.pyi',
],
subdir: 'turbohtml/_stubs',
)
py.install_sources(
[
'src/turbohtml/migration/__init__.py',
'src/turbohtml/migration/bleach.py',
'src/turbohtml/migration/markupsafe.py',
'src/turbohtml/migration/stdlib.py',
],
subdir: 'turbohtml/migration',
)