Something went wrong. Try again.
javascript for 🐜's, a tiny runtime with big ambitions antjs.org
Something went wrong. Try again.
ant meson.build
3.1 kB · 122 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123project('ant', ['c', 'cpp'], default_options: [ 'buildtype=release', 'optimization=3', 'c_std=gnu23', 'cpp_std=gnu++23', 'default_library=static', 'b_lto=true', 'b_lto_threads=8', 'strip=true', 'warning_level=2'], subproject_dir: 'vendor')
python = find_program('python3')is_static = get_option('static_link')
src_root = meson.project_source_root()include = include_directories('include')
subdir('meson')
messages_h = custom_target('messages_h', input: 'src/core/messages.toml', output: 'messages.h', command: [python, files('meson/messages.py'), '@INPUT@'], capture: true,)
theme_h = custom_target('theme_h', input: 'src/highlight/theme.toml', output: 'theme.h', command: [python, files('meson/theme.py'), '@INPUT@'], capture: true,)
lib_sources = files(run_command( python, files('meson/sources.py'), files('sources.json'), 'engine', check: true).stdout().strip().split())
libant = static_library( 'ant', lib_sources + [ builtin_bundle_h, snapshot_h, messages_h, theme_h ], install: true, include_directories: include, dependencies: ant_deps)
pkg_lib = custom_target( 'pkg_zig', output: 'libpkg.a', command: [ 'sh', '-c', '"$ZIG" build --build-file "$PKG_ZIG_DIR/build.zig" --prefix "$PKG_BUILD_DIR" && cp "$PKG_BUILD_DIR/lib/$PKG_LIB_NAME" "@OUTPUT@"' ], env: { 'ZIG': zig.full_path(), 'ANT_VERSION': ant_version, 'PKG_ZIG_DIR': pkg_zig_dir, 'PKG_BUILD_DIR': pkg_build_dir, 'LMDB_INCLUDE': lmdb_include_path, 'ZLIB_INCLUDE': zlib_include_path, 'LIBUV_INCLUDE': libuv_include_path, 'YYJSON_INCLUDE': yyjson_include_path, 'PKG_TARGET': host_machine.cpu_family() + '-' + host_machine.system(), 'PKG_LIB_NAME': host_machine.system() == 'windows' ? 'pkg.lib' : 'libpkg.a', }, build_by_default: true, build_always_stale: true)
pkg_dep = declare_dependency( link_with: [pkg_lib], include_directories: include, dependencies: [lmdb_dep, tlsuv_dep, libuv_dep, nghttp2_dep])
libant_dep = declare_dependency( link_with: libant, include_directories: include, dependencies: ant_deps + [oxc_dep, pkg_dep])
link_args = []if get_option('static_link') link_args += ['-static']endif
ant_link_args = link_argsif host_machine.system() == 'windows' ant_link_args += ['-Wl,--stack,134217728']elif host_machine.system() == 'darwin' ant_link_args += ['-Wl,-stack_size,0x2000000']else ant_link_args += ['-Wl,-z,stack-size=134217728']endifif get_option('linker_map') ant_linkmap = meson.project_build_root() + '/ant.linkmap' if host_machine.system() == 'darwin' ant_link_args += ['-Wl,-map,' + ant_linkmap] else ant_link_args += ['-Wl,-Map=' + ant_linkmap] endifendif
executable( 'ant', files('src/main.c', 'src/watch.c') + [messages_h], dependencies: libant_dep, link_args: ant_link_args, export_dynamic: true)
executable( 'tlsuv-boringssl-smoke', files('tests/tlsuv_boringssl_smoke.c'), dependencies: [tlsuv_dep, libuv_dep, llhttp, zlib_dep] + (host_machine.system() == 'darwin' ? [security_dep] : []), build_by_default: false)