Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,11 @@ qjs_sys_deps = []

m_dep = cc.find_library('m', required: false)
qjs_sys_deps += m_dep
qjs_sys_deps += dependency('threads', required: false)
qjs_sys_deps += dependency('dl', required: false)
if host_system != 'dos'
qjs_sys_deps += dependency('threads', required: false)
qjs_sys_deps += dependency('dl', required: false)
endif
tools = get_option('tools')

qjs_srcs = files(
'dtoa.c',
Expand Down Expand Up @@ -220,6 +223,8 @@ if qjs_libc
include_directories: include_directories('.'),
dependencies: qjs_dep,
)
elif not tools.allowed()
qjs_libc_dep = []
else
qjs_libc_lib = static_library(
'quickjs-libc',
Expand Down Expand Up @@ -304,13 +309,15 @@ endif
qjsc_srcs = files(
'qjsc.c',
)

qjsc_exe = executable(
'qjsc',
qjsc_srcs,

c_args: qjs_c_args,
dependencies: [qjs_dep, qjs_libc_dep],
install: true,
build_by_default: tools.allowed(),
install: tools.allowed(),
)

mimalloc_dep = []
Expand All @@ -328,15 +335,16 @@ qjs_exe_srcs = files(
'gen/standalone.c',
'qjs.c',
)

qjs_exe = executable(
'qjs',
qjs_exe_srcs,

c_args: qjs_c_args,
dependencies: [qjs_dep, qjs_libc_dep, mimalloc_dep],
export_dynamic: true,

install: true,
build_by_default: tools.allowed(),
install: tools.allowed(),
)

if meson.is_cross_build()
Expand Down Expand Up @@ -558,7 +566,7 @@ alias_target('codegen',
run_target(
'codegen_repl.c',
command: [
qjsc_exe,
'qjsc',
'-ss',
'-o', files('gen/repl.c'),
'-m',
Expand All @@ -569,7 +577,7 @@ alias_target('codegen',
run_target(
'codegen_standalone.c',
command: [
qjsc_exe,
'qjsc',
'-ss',
'-o', files('gen/standalone.c'),
'-m',
Expand All @@ -580,7 +588,7 @@ alias_target('codegen',
run_target(
'codegen_function_source.c',
command: [
qjsc_exe,
'qjsc',
'-e',
'-o', files('gen/function_source.c'),
'-n', 'tests/function_source.js',
Expand All @@ -590,7 +598,7 @@ alias_target('codegen',
run_target(
'codegen_hello.c',
command: [
qjsc_exe,
'qjsc',
'-e',
'-o', files('gen/hello.c'),
'-n', 'examples/hello.js',
Expand All @@ -600,7 +608,7 @@ alias_target('codegen',
run_target(
'codegen_hello_module.c',
command: [
qjsc_exe,
'qjsc',
'-e',
'-o', files('gen/hello_module.c'),
'-m',
Expand All @@ -611,7 +619,7 @@ alias_target('codegen',
run_target(
'codegen_test_fib.c',
command: [
qjsc_exe,
'qjsc',
'-e',
'-o', files('gen/test_fib.c'),
'-m',
Expand All @@ -622,7 +630,7 @@ alias_target('codegen',
run_target(
'codegen_builtin-array-fromasync.h',
command: [
qjsc_exe,
'qjsc',
'-C',
'-ss',
'-o', files('builtin-array-fromasync.h'),
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ option('libc', type: 'boolean', value: false, description: 'build qjs standard l
option('cli_mimalloc', type: 'feature', value: 'disabled', description: 'build qjs cli with mimalloc')
option('docdir', type: 'string', description: 'documentation directory')
option('parser', type: 'boolean', value: true, description: 'Enable JS source code parser')
option('tools', type: 'feature', description: 'build tools like qjs and qjsc')