Skip to content

Commit 339f24b

Browse files
committed
build/meson: export have_parser in dependency
1 parent 0738492 commit 339f24b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

meson.build

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,15 @@ if qjs_libc
149149
qjs_hdrs += qjs_libc_hdrs
150150
endif
151151

152+
qjs_parser = get_option('parser')
153+
152154
qjs_c_args = ['-D_GNU_SOURCE']
153155

154156
if host_system == 'windows'
155157
qjs_c_args += ['-DWIN32_LEAN_AND_MEAN', '-D_WIN32_WINNT=0x0601']
156158
endif
157159

158-
if not get_option('parser')
160+
if not qjs_parser
159161
qjs_c_args += ['-DQJS_DISABLE_PARSER']
160162
endif
161163

@@ -188,10 +190,15 @@ qjs_lib = library(
188190
version: meson.project_version(),
189191
)
190192

193+
qjs_export_variables = [
194+
f'have_parser=@qjs_parser@'
195+
]
196+
191197
qjs_dep = declare_dependency(
192198
link_with: qjs_lib,
193199
dependencies: qjs_sys_deps,
194200
include_directories: qjs_lib.private_dir_include(),
201+
variables: qjs_export_variables,
195202
)
196203

197204
if host_system == 'emscripten'
@@ -249,6 +256,7 @@ import('pkgconfig').generate(
249256
description: 'QuickJS, the Next Generation: a mighty JavaScript engine',
250257
url: 'https://github.com/quickjs-ng/quickjs',
251258
version: meson.project_version(),
259+
variables: qjs_export_variables,
252260
)
253261

254262
# QuickJS bytecode compiler

0 commit comments

Comments
 (0)