MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

migrate all meson configs to /meson

+243 -411
+6 -196
libant/meson.build
··· 7 7 ], subproject_dir: 'vendor') 8 8 9 9 use_lto = get_option('lto') 10 - cmake = import('cmake') 10 + 11 11 src_root = meson.project_source_root() / '..' 12 + vendor_dir = 'vendor' 13 + is_static = true 14 + 15 + subdir('../meson') 12 16 13 17 module_files = run_command('sh', '-c', 14 18 'ls ' + src_root / 'src' / 'modules' / '*.c', ··· 25 29 '../src/esm/remote.c', 26 30 ) + files(module_files) 27 31 28 - tls_lib = get_option('tls_library') 29 - cc = meson.get_compiler('c') 30 - 31 - if tls_lib == 'openssl' 32 - openssl_dep = dependency('openssl', required: true, static: true) 33 - mbedtls_dep = [] 34 - else 35 - openssl_dep = dependency('', required: false) 36 - mbedtls_dep = [ 37 - dependency('mbedtls', required: true, static: true), 38 - dependency('mbedx509', required: true, static: true), 39 - dependency('mbedcrypto', required: true, static: true), 40 - ] 41 - endif 42 - libsodium_dep = dependency('libsodium', required: true, static: true) 43 - 44 - if host_machine.system() == 'windows' 45 - uuid_dep = cc.find_library('rpcrt4', required: true) 46 - elif host_machine.system() == 'darwin' 47 - uuid_dep = dependency('uuid', required: true) 48 - security_dep = dependency('appleframeworks', modules: ['Security', 'CoreFoundation'], required: true) 49 - else 50 - uuid_dep = dependency('uuid', required: true, static: true) 51 - endif 52 - 53 - llhttp = dependency('llhttp', static: true, required: false) 54 - if not llhttp.found() 55 - llhttp = dependency('llhttp', method: 'cmake', modules: ['llhttp::llhttp_static'], required: true) 56 - endif 57 - 58 - libuv_sub = subproject('libuv', default_options: [ 59 - 'build_tests=false', 60 - 'build_benchmarks=false' 61 - ]) 62 - libuv_dep = libuv_sub.get_variable('libuv_dep') 63 - 64 - tlsuv_opts = cmake.subproject_options() 65 - bdwgc_opts = cmake.subproject_options() 66 - 67 - cmake_prefix = get_option('deps_prefix_cmake') 68 - tlsuv_cmake_defines = { 69 - 'BUILD_TESTING': 'OFF', 70 - 'TLSUV_TLSLIB': tls_lib, 71 - 'MBEDTLS_DIR': cmake_prefix, 72 - } 73 - tlsuv_opts.add_cmake_defines(tlsuv_cmake_defines) 74 - 75 - bdwgc_opts.add_cmake_defines({ 76 - 'BUILD_SHARED_LIBS': 'OFF', 77 - 'enable_cplusplus': 'OFF', 78 - }) 79 - 80 - tlsuv_compile_args = [ 81 - '-Wno-unused-function', 82 - '-Wno-unused-variable', 83 - '-Wno-bitwise-op-parentheses', 84 - '-Wno-sometimes-uninitialized', 85 - '-I' + meson.project_source_root() / 'subprojects' / 'libuv-v1.51.0' / 'include' 86 - ] 87 - if cmake_prefix != '' 88 - tlsuv_compile_args += ['-I' + cmake_prefix / 'include'] 89 - endif 90 - tlsuv_opts.append_compile_args('c', tlsuv_compile_args) 91 - 92 - bdwgc_gc_args = ['-DGC_NO_THREAD_REDIRECTS', '-DGC_THREADS'] 93 - if host_machine.system() == 'linux' 94 - bdwgc_gc_args += ['-DNO_GETCONTEXT'] 95 - endif 96 - bdwgc_opts.append_compile_args('c', bdwgc_gc_args) 97 - 98 - tlsuv_dep = cmake.subproject('tlsuv', options: tlsuv_opts).dependency('tlsuv') 99 - bdwgc_dep = cmake.subproject('bdwgc', options: bdwgc_opts).dependency('gc') 100 - 101 - pcre2_dep = subproject('pcre2').get_variable('libpcre2_8') 102 - uthash_dep = subproject('uthash').get_variable('uthash_dep') 103 - yyjson_dep = subproject('yyjson').get_variable('yyjson_dep') 104 - uuidv7_dep = subproject('uuidv7').get_variable('uuidv7_dep') 105 - argtable3_dep = subproject('argtable3').get_variable('argtable3_dep') 106 - minicoro_dep = subproject('minicoro').get_variable('minicoro_dep') 107 - 108 - zlib_dep = subproject('zlib-ng', 109 - default_options: ['b_lto=false'] 110 - ).get_variable('zlib_ng_dep') 111 - 112 - libffi_dep = subproject('libffi', default_options: [ 113 - 'warning_level=0', 114 - 'tests=false' 115 - ]).get_variable('ffi_dep') 116 - 117 - cargo = find_program('cargo', required: true) 118 - cp = find_program('cp', required: true) 119 - 120 - oxc_lib_name = 'liboxc.a' 121 - oxc_output_name = 'liboxc.a' 122 - 123 - if host_machine.system() == 'windows' 124 - rust_target = 'x86_64-pc-windows-gnu' 125 - oxc_release_dir = meson.project_build_root() / 'oxc-target' / rust_target / 'release' 126 - rust_target_arg = ' --target ' + rust_target 127 - else 128 - oxc_release_dir = meson.project_build_root() / 'oxc-target' / 'release' 129 - rust_target_arg = '' 130 - endif 131 - 132 - oxc_lib = custom_target( 133 - 'oxc_strip', 134 - output: oxc_output_name, 135 - command: [ 136 - 'sh', '-c', 137 - cargo.full_path() + ' build --release' + rust_target_arg + ' ' + 138 - '--manifest-path ' + meson.project_source_root() / '..' / 'src' / 'strip' / 'Cargo.toml' + ' ' + 139 - '--target-dir ' + meson.project_build_root() / 'oxc-target' + 140 - ' && ' + cp.full_path() + ' ' + oxc_release_dir / oxc_lib_name + ' @OUTPUT@' 141 - ], 142 - build_by_default: true 143 - ) 144 - 145 - oxc_dep = declare_dependency(link_with: oxc_lib) 146 - 147 - git_hash = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() 148 - if git_hash == '' 149 - git_hash = 'unknown' 150 - endif 151 - 152 - timestamp_opt = get_option('build_timestamp') 153 - if timestamp_opt == '' 154 - timestamp = run_command('date', '+%s', check: true).stdout().strip() 155 - else 156 - timestamp = timestamp_opt 157 - endif 158 - 159 - version_conf = configuration_data() 160 - version_conf.set('ANT_VERSION', '0.3.13.' + timestamp + '-g' + git_hash) 161 - version_conf.set('ANT_BUILD_TIMESTAMP', timestamp) 162 - 163 - cmd_cc = meson.get_compiler('c') 164 - target_triple = run_command(cmd_cc.cmd_array(), '-dumpmachine', check: true).stdout().strip() 165 - 166 - triple_parts = target_triple.split('-') 167 - if triple_parts.length() == 4 and triple_parts[1] != 'unknown' and triple_parts[1] != 'pc' and triple_parts[1] != 'apple' 168 - target_triple = triple_parts[0] + '-unknown-' + triple_parts[2] + '-' + triple_parts[3] 169 - endif 170 - 171 - version_conf.set('ANT_GIT_HASH', git_hash) 172 - if tls_lib == 'mbedtls' 173 - version_conf.set('ANT_TARGET_TRIPLE', target_triple + '-mbedtls') 174 - else 175 - version_conf.set('ANT_TARGET_TRIPLE', target_triple) 176 - endif 177 - 178 - config_h = configure_file( 179 - input: '../include/config.h.in', 180 - output: 'config.h', 181 - configuration: version_conf 182 - ) 183 - 184 32 include = include_directories('../include') 185 33 build_include = include_directories('.') 186 34 strip_include = include_directories('../src/strip') ··· 196 44 add_project_link_arguments('-no-pie', language: 'c') 197 45 endif 198 46 199 - node = find_program('node', required: true) 200 - 201 - core_files = run_command('sh', '-c', 202 - 'find ' + meson.project_source_root() / '..' / 'src' / 'core' + ' -name "*.js" ! -name "index.js" | sort', 203 - check: true 204 - ).stdout().strip().split() 205 - 206 - snapshot_h = custom_target( 207 - 'snapshot', 208 - input: ['../src/core/index.ts'] + files(core_files), 209 - output: 'snapshot_data.h', 210 - command: [ 211 - node, 212 - meson.project_source_root() / '..' / 'src' / 'tools' / 'gen_snapshot.js', 213 - '@INPUT0@', 214 - '@OUTPUT@', 215 - 'VERSION=' + version_conf.get('ANT_VERSION'), 216 - 'GIT_HASH=' + version_conf.get('ANT_GIT_HASH'), 217 - 'BUILD_TIMESTAMP=' + version_conf.get('ANT_BUILD_TIMESTAMP'), 218 - 'TARGET=' + version_conf.get('ANT_TARGET_TRIPLE'), 219 - 'MBEDTLS=' + (tls_lib == 'mbedtls').to_string(), 220 - 'HOST=' + host_machine.system() 221 - ], 222 - build_by_default: true 223 - ) 224 - 225 - ant_deps = [ 226 - libffi_dep, bdwgc_dep, uuid_dep, 227 - llhttp, pcre2_dep, libuv_dep, 228 - argtable3_dep, tlsuv_dep, libsodium_dep, 229 - yyjson_dep, minicoro_dep, uuidv7_dep, 230 - openssl_dep, zlib_dep, uthash_dep, 231 - ] + mbedtls_dep 232 - 233 - if host_machine.system() == 'darwin' 234 - ant_deps += [security_dep] 235 - endif 236 - 237 47 libant_core = static_library( 238 48 'ant_core', 239 49 lib_sources + [snapshot_h], ··· 280 90 '@INPUT0@', '@OUTPUT@' 281 91 ], 282 92 build_by_default: true 283 - ) 93 + )
+13 -215
meson.build
··· 3 3 'c_std=gnu23', 4 4 'default_library=static', 5 5 'b_lto=true', 6 + 'b_lto_threads=8', 6 7 'strip=true' 7 8 ], subproject_dir: 'vendor') 8 9 9 - cmake = import('cmake') 10 - include = include_directories('include') 10 + src_root = meson.project_source_root() 11 + vendor_dir = 'vendor' 12 + is_static = false 13 + 14 + subdir('meson') 11 15 12 16 module_files = run_command('sh', '-c', 13 17 'cd "$MESON_SOURCE_ROOT" && ls src/modules/*.c', ··· 24 28 'src/esm/remote.c', 25 29 ) + files(module_files) 26 30 27 - tls_lib = get_option('tls_library') 28 - cc = meson.get_compiler('c') 29 - if tls_lib == 'openssl' 30 - openssl_dep = dependency('openssl', required: true) 31 - mbedtls_dep = [] 32 - else 33 - openssl_dep = dependency('', required: false) 34 - mbedtls_dep = [ 35 - dependency('mbedtls', required: true), 36 - dependency('mbedx509', required: true), 37 - dependency('mbedcrypto', required: true), 38 - ] 39 - endif 40 - libsodium_dep = dependency('libsodium', required: true) 41 - 42 - if host_machine.system() == 'windows' 43 - uuid_dep = cc.find_library('rpcrt4', required: true) 44 - secur32_dep = cc.find_library('secur32', required: true) 45 - ntdll_dep = cc.find_library('ntdll', required: true) 46 - crypt32_dep = cc.find_library('crypt32', required: true) 47 - userenv_dep = cc.find_library('userenv', required: true) 48 - else 49 - uuid_dep = dependency('uuid', required: true) 50 - endif 51 - llhttp = dependency('llhttp', static: true, required: false) 52 - if not llhttp.found() 53 - llhttp = dependency('llhttp', method: 'cmake', modules: ['llhttp::llhttp_static'], required: true) 54 - endif 55 - 56 - if host_machine.system() == 'darwin' 57 - security_dep = dependency('appleframeworks', modules: ['Security', 'CoreFoundation'], required: true) 58 - endif 59 - 60 - libuv_sub = subproject('libuv', default_options: [ 61 - 'build_tests=false', 62 - 'build_benchmarks=false' 63 - ]) 64 - 65 - libuv_dep = libuv_sub.get_variable('libuv_dep') 66 - tlsuv_opts = cmake.subproject_options() 67 - bdwgc_opts = cmake.subproject_options() 68 - 69 - cmake_prefix = get_option('deps_prefix_cmake') 70 - tlsuv_cmake_defines = { 71 - 'BUILD_TESTING': 'OFF', 72 - 'TLSUV_TLSLIB': tls_lib 73 - } 74 - if cmake_prefix != '' 75 - tlsuv_cmake_defines += {'CMAKE_PREFIX_PATH': cmake_prefix} 76 - endif 77 - tlsuv_opts.add_cmake_defines(tlsuv_cmake_defines) 78 - 79 - bdwgc_opts.add_cmake_defines({ 80 - 'BUILD_SHARED_LIBS': 'OFF', 81 - 'enable_cplusplus': 'OFF', 82 - }) 83 - 84 - tlsuv_opts.append_compile_args('c', [ 85 - '-Wno-unused-function', 86 - '-Wno-unused-variable', 87 - '-Wno-bitwise-op-parentheses', 88 - '-Wno-sometimes-uninitialized', 89 - '-I' + (meson.project_source_root() / 'vendor' / 'libuv-v1.51.0' / 'include') 90 - ]) 91 - 92 - bdwgc_gc_args = ['-DGC_NO_THREAD_REDIRECTS', '-DGC_THREADS'] 93 - if host_machine.system() == 'linux' 94 - bdwgc_gc_args += ['-DNO_GETCONTEXT'] 95 - endif 96 - bdwgc_opts.append_compile_args('c', bdwgc_gc_args) 97 - 98 - tlsuv_dep = cmake.subproject('tlsuv', options: tlsuv_opts).dependency('tlsuv') 99 - bdwgc_dep = cmake.subproject('bdwgc', options: bdwgc_opts).dependency('gc') 100 - 101 - pcre2_dep = subproject('pcre2').get_variable('libpcre2_8') 102 - uthash_dep = subproject('uthash').get_variable('uthash_dep') 103 - yyjson_dep = subproject('yyjson').get_variable('yyjson_dep') 104 - uuidv7_dep = subproject('uuidv7').get_variable('uuidv7_dep') 105 - argtable3_dep = subproject('argtable3').get_variable('argtable3_dep') 106 - minicoro_dep = subproject('minicoro').get_variable('minicoro_dep') 107 - 108 - zlib_dep = subproject('zlib-ng', 109 - default_options: ['b_lto=false'] 110 - ).get_variable('zlib_ng_dep') 111 - 112 - libffi_dep = subproject('libffi', default_options: [ 113 - 'warning_level=0', 114 - 'tests=false' 115 - ]).get_variable('ffi_dep') 116 - 117 - cargo = find_program('cargo', required: true) 118 - cp = find_program('cp', required: true) 119 - strip_include = include_directories('src/strip') 120 - 121 - oxc_lib_name = 'liboxc.a' 122 - oxc_output_name = 'liboxc.a' 123 - 124 - if host_machine.system() == 'windows' 125 - rust_target = 'x86_64-pc-windows-gnu' 126 - oxc_release_dir = meson.project_build_root() / 'oxc-target' / rust_target / 'release' 127 - rust_target_arg = ' --target ' + rust_target 128 - else 129 - oxc_release_dir = meson.project_build_root() / 'oxc-target' / 'release' 130 - rust_target_arg = '' 131 - endif 132 - 133 - oxc_lib = custom_target( 134 - 'oxc_strip', 135 - output: oxc_output_name, 136 - command: [ 137 - 'sh', '-c', 138 - cargo.full_path() + ' build --release' + rust_target_arg + ' ' + 139 - '--manifest-path ' + meson.project_source_root() / 'src' / 'strip' / 'Cargo.toml' + ' ' + 140 - '--target-dir ' + meson.project_build_root() / 'oxc-target' + 141 - ' && ' + cp.full_path() + ' ' + oxc_release_dir / oxc_lib_name + ' @OUTPUT@' 142 - ], 143 - build_by_default: true 144 - ) 145 - 146 - oxc_dep = declare_dependency(link_with: oxc_lib) 147 - 148 - git = find_program('git', required: false) 149 - if git.found() 150 - git_commit = run_command(git, 'rev-parse', '--short=10', 'HEAD', check: false) 151 - if git_commit.returncode() == 0 152 - git_hash = git_commit.stdout().strip() 153 - else 154 - git_hash = 'unknown' 155 - endif 156 - else 157 - git_hash = 'unknown' 158 - endif 159 - 160 - version_conf = configuration_data() 161 - 162 - git_hash = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() 163 - timestamp_opt = get_option('build_timestamp') 164 - if timestamp_opt == '' 165 - timestamp = run_command('date', '+%s', check: true).stdout().strip() 166 - else 167 - timestamp = timestamp_opt 168 - endif 169 - 170 - version_conf.set('ANT_VERSION', '0.3.13.' + timestamp + '-g' + git_hash) 171 - version_conf.set('ANT_BUILD_TIMESTAMP', timestamp) 172 - 173 - cmd_cc = meson.get_compiler('c') 174 - target_triple = run_command(cmd_cc.cmd_array(), '-dumpmachine', check: true).stdout().strip() 175 - 176 - triple_parts = target_triple.split('-') 177 - if triple_parts.length() == 4 and triple_parts[1] != 'unknown' and triple_parts[1] != 'pc' and triple_parts[1] != 'apple' 178 - target_triple = triple_parts[0] + '-unknown-' + triple_parts[2] + '-' + triple_parts[3] 179 - endif 180 - 181 - version_conf.set('ANT_GIT_HASH', git_hash) 182 - if tls_lib == 'mbedtls' 183 - version_conf.set('ANT_TARGET_TRIPLE', target_triple + '-mbedtls') 184 - else 185 - version_conf.set('ANT_TARGET_TRIPLE', target_triple) 186 - endif 187 - 188 - config_h = configure_file( 189 - input: 'include/config.h.in', 190 - output: 'config.h', 191 - configuration: version_conf 192 - ) 193 - 31 + include = include_directories('include') 194 32 build_include = include_directories('.') 33 + strip_include = include_directories('src/strip') 195 34 196 35 add_project_arguments( 197 36 '-D NO_EXECUTE_PERMISSION', ··· 204 43 add_project_link_arguments('-no-pie', language: 'c') 205 44 endif 206 45 207 - node = find_program('node', required: true) 208 - gen_snapshot = files('src/tools/gen_snapshot.js') 209 - 210 - core_files = run_command('sh', '-c', 211 - 'cd "$MESON_SOURCE_ROOT" && find src/core -name "*.js" ! -name "index.js" | sort', 212 - check: true 213 - ).stdout().strip().split() 214 - 215 - snapshot_h = custom_target( 216 - 'snapshot', 217 - input: ['src/core/index.ts'] + files(core_files), 218 - output: 'snapshot_data.h', 219 - command: [ 220 - node, 221 - gen_snapshot, 222 - '@INPUT0@', 223 - '@OUTPUT@', 224 - 'VERSION=' + version_conf.get('ANT_VERSION'), 225 - 'GIT_HASH=' + version_conf.get('ANT_GIT_HASH'), 226 - 'BUILD_TIMESTAMP=' + version_conf.get('ANT_BUILD_TIMESTAMP'), 227 - 'TARGET=' + version_conf.get('ANT_TARGET_TRIPLE'), 228 - 'MBEDTLS=' + (tls_lib == 'mbedtls').to_string(), 229 - 'HOST=' + host_machine.system() 230 - ], 231 - build_by_default: true 232 - ) 233 - 234 - ant_deps = [ 235 - libffi_dep, bdwgc_dep, uuid_dep, 236 - llhttp, pcre2_dep, libuv_dep, 237 - argtable3_dep, tlsuv_dep, libsodium_dep, 238 - yyjson_dep, minicoro_dep, uuidv7_dep, 239 - openssl_dep, zlib_dep, uthash_dep, 240 - ] + mbedtls_dep 241 - 242 - if host_machine.system() == 'darwin' 243 - ant_deps += [security_dep] 244 - elif host_machine.system() == 'windows' 245 - ant_deps += [secur32_dep, ntdll_dep, crypt32_dep, userenv_dep] 246 - endif 247 - 248 - link_args = [] 249 - if get_option('static_link') 250 - link_args += ['-static'] 251 - endif 252 - 253 46 libant = static_library( 254 47 'ant', 255 48 lib_sources + [snapshot_h], ··· 263 56 include_directories: [include, build_include], 264 57 dependencies: ant_deps + [oxc_dep] 265 58 ) 59 + 60 + link_args = [] 61 + if get_option('static_link') 62 + link_args += ['-static'] 63 + endif 266 64 267 65 executable( 268 66 'ant',
+148
meson/deps/meson.build
··· 1 + cmake = import('cmake') 2 + cc = meson.get_compiler('c') 3 + tls_lib = get_option('tls_library') 4 + 5 + if tls_lib == 'openssl' 6 + openssl_dep = dependency('openssl', required: true, static: is_static) 7 + mbedtls_dep = [] 8 + else 9 + openssl_dep = dependency('', required: false) 10 + mbedtls_dep = [ 11 + dependency('mbedtls', required: true, static: is_static), 12 + dependency('mbedx509', required: true, static: is_static), 13 + dependency('mbedcrypto', required: true, static: is_static), 14 + ] 15 + endif 16 + 17 + libsodium_dep = dependency('libsodium', required: true, static: is_static) 18 + 19 + # Platform-specific dependencies 20 + if host_machine.system() == 'windows' 21 + uuid_dep = cc.find_library('rpcrt4', required: true) 22 + secur32_dep = cc.find_library('secur32', required: true) 23 + ntdll_dep = cc.find_library('ntdll', required: true) 24 + crypt32_dep = cc.find_library('crypt32', required: true) 25 + userenv_dep = cc.find_library('userenv', required: true) 26 + win_deps = [secur32_dep, ntdll_dep, crypt32_dep, userenv_dep] 27 + elif host_machine.system() == 'darwin' 28 + uuid_dep = dependency('uuid', required: true) 29 + security_dep = dependency('appleframeworks', modules: ['Security', 'CoreFoundation'], required: true) 30 + win_deps = [] 31 + else 32 + uuid_dep = dependency('uuid', required: true, static: is_static) 33 + win_deps = [] 34 + endif 35 + 36 + # llhttp 37 + llhttp = dependency('llhttp', static: true, required: false) 38 + if not llhttp.found() 39 + llhttp = dependency('llhttp', method: 'cmake', modules: ['llhttp::llhttp_static'], required: true) 40 + endif 41 + 42 + # libuv subproject 43 + libuv_sub = subproject('libuv', default_options: [ 44 + 'build_tests=false', 45 + 'build_benchmarks=false' 46 + ]) 47 + libuv_dep = libuv_sub.get_variable('libuv_dep') 48 + 49 + # CMake subproject options 50 + tlsuv_opts = cmake.subproject_options() 51 + bdwgc_opts = cmake.subproject_options() 52 + 53 + cmake_prefix = get_option('deps_prefix_cmake') 54 + tlsuv_cmake_defines = { 55 + 'BUILD_TESTING': 'OFF', 56 + 'TLSUV_TLSLIB': tls_lib, 57 + } 58 + if cmake_prefix != '' 59 + tlsuv_cmake_defines += {'MBEDTLS_DIR': cmake_prefix, 'CMAKE_PREFIX_PATH': cmake_prefix} 60 + endif 61 + tlsuv_opts.add_cmake_defines(tlsuv_cmake_defines) 62 + 63 + bdwgc_opts.add_cmake_defines({ 64 + 'BUILD_SHARED_LIBS': 'OFF', 65 + 'enable_cplusplus': 'OFF', 66 + }) 67 + 68 + tlsuv_compile_args = [ 69 + '-Wno-unused-function', 70 + '-Wno-unused-variable', 71 + '-Wno-bitwise-op-parentheses', 72 + '-Wno-sometimes-uninitialized', 73 + '-I' + meson.project_source_root() / vendor_dir / 'libuv-v1.51.0' / 'include' 74 + ] 75 + if cmake_prefix != '' 76 + tlsuv_compile_args += ['-I' + cmake_prefix / 'include'] 77 + endif 78 + tlsuv_opts.append_compile_args('c', tlsuv_compile_args) 79 + 80 + bdwgc_gc_args = ['-DGC_NO_THREAD_REDIRECTS', '-DGC_THREADS'] 81 + if host_machine.system() == 'linux' 82 + bdwgc_gc_args += ['-DNO_GETCONTEXT'] 83 + endif 84 + bdwgc_opts.append_compile_args('c', bdwgc_gc_args) 85 + 86 + tlsuv_dep = cmake.subproject('tlsuv', options: tlsuv_opts).dependency('tlsuv') 87 + bdwgc_dep = cmake.subproject('bdwgc', options: bdwgc_opts).dependency('gc') 88 + 89 + # Meson subprojects 90 + pcre2_dep = subproject('pcre2').get_variable('libpcre2_8') 91 + uthash_dep = subproject('uthash').get_variable('uthash_dep') 92 + yyjson_dep = subproject('yyjson').get_variable('yyjson_dep') 93 + uuidv7_dep = subproject('uuidv7').get_variable('uuidv7_dep') 94 + argtable3_dep = subproject('argtable3').get_variable('argtable3_dep') 95 + minicoro_dep = subproject('minicoro').get_variable('minicoro_dep') 96 + 97 + zlib_dep = subproject('zlib-ng', 98 + default_options: ['b_lto=false'] 99 + ).get_variable('zlib_ng_dep') 100 + 101 + libffi_dep = subproject('libffi', default_options: [ 102 + 'warning_level=0', 103 + 'tests=false' 104 + ]).get_variable('ffi_dep') 105 + 106 + # Rust oxc parser 107 + cargo = find_program('cargo', required: true) 108 + cp = find_program('cp', required: true) 109 + 110 + oxc_lib_name = 'liboxc.a' 111 + oxc_output_name = 'liboxc.a' 112 + 113 + if host_machine.system() == 'windows' 114 + rust_target = 'x86_64-pc-windows-gnu' 115 + oxc_release_dir = meson.project_build_root() / 'oxc-target' / rust_target / 'release' 116 + rust_target_arg = ' --target ' + rust_target 117 + else 118 + oxc_release_dir = meson.project_build_root() / 'oxc-target' / 'release' 119 + rust_target_arg = '' 120 + endif 121 + 122 + oxc_lib = custom_target( 123 + 'oxc_strip', 124 + output: oxc_output_name, 125 + command: [ 126 + 'sh', '-c', 127 + cargo.full_path() + ' build --release' + rust_target_arg + ' ' + 128 + '--manifest-path ' + src_root / 'src' / 'strip' / 'Cargo.toml' + ' ' + 129 + '--target-dir ' + meson.project_build_root() / 'oxc-target' + 130 + ' && ' + cp.full_path() + ' ' + oxc_release_dir / oxc_lib_name + ' @OUTPUT@' 131 + ], 132 + build_by_default: true 133 + ) 134 + 135 + oxc_dep = declare_dependency(link_with: oxc_lib) 136 + 137 + # Collect all dependencies 138 + ant_deps = [ 139 + libffi_dep, bdwgc_dep, uuid_dep, 140 + llhttp, pcre2_dep, libuv_dep, 141 + argtable3_dep, tlsuv_dep, libsodium_dep, 142 + yyjson_dep, minicoro_dep, uuidv7_dep, 143 + openssl_dep, zlib_dep, uthash_dep, 144 + ] + mbedtls_dep + win_deps 145 + 146 + if host_machine.system() == 'darwin' 147 + ant_deps += [security_dep] 148 + endif
+9
meson/meson.build
··· 1 + # Shared build configuration 2 + # Variables expected from parent: 3 + # src_root - path to project root (for finding sources) 4 + # vendor_dir - name of vendor/subproject directory 5 + # is_static - whether to link dependencies statically 6 + 7 + subdir('deps') 8 + subdir('version') 9 + subdir('snapshot')
+28
meson/snapshot/meson.build
··· 1 + # Snapshot generation 2 + # Include with: subdir('meson') or subdir('../meson') 3 + 4 + node = find_program('node', required: true) 5 + 6 + core_files = run_command('sh', '-c', 7 + 'find ' + src_root / 'src' / 'core' + ' -name "*.js" ! -name "index.js" | sort', 8 + check: true 9 + ).stdout().strip().split() 10 + 11 + snapshot_h = custom_target( 12 + 'snapshot', 13 + input: [src_root / 'src' / 'core' / 'index.ts'] + files(core_files), 14 + output: 'snapshot_data.h', 15 + command: [ 16 + node, 17 + src_root / 'src' / 'tools' / 'gen_snapshot.js', 18 + '@INPUT0@', 19 + '@OUTPUT@', 20 + 'VERSION=' + version_conf.get('ANT_VERSION'), 21 + 'GIT_HASH=' + version_conf.get('ANT_GIT_HASH'), 22 + 'BUILD_TIMESTAMP=' + version_conf.get('ANT_BUILD_TIMESTAMP'), 23 + 'TARGET=' + version_conf.get('ANT_TARGET_TRIPLE'), 24 + 'MBEDTLS=' + (tls_lib == 'mbedtls').to_string(), 25 + 'HOST=' + host_machine.system() 26 + ], 27 + build_by_default: true 28 + )
+39
meson/version/meson.build
··· 1 + # Version and build configuration 2 + # Include with: subdir('meson') or subdir('../meson') 3 + 4 + git_hash = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() 5 + if git_hash == '' 6 + git_hash = 'unknown' 7 + endif 8 + 9 + timestamp_opt = get_option('build_timestamp') 10 + if timestamp_opt == '' 11 + timestamp = run_command('date', '+%s', check: true).stdout().strip() 12 + else 13 + timestamp = timestamp_opt 14 + endif 15 + 16 + version_conf = configuration_data() 17 + version_conf.set('ANT_VERSION', '0.3.13.' + timestamp + '-g' + git_hash) 18 + version_conf.set('ANT_BUILD_TIMESTAMP', timestamp) 19 + version_conf.set('ANT_GIT_HASH', git_hash) 20 + 21 + cmd_cc = meson.get_compiler('c') 22 + target_triple = run_command(cmd_cc.cmd_array(), '-dumpmachine', check: true).stdout().strip() 23 + 24 + triple_parts = target_triple.split('-') 25 + if triple_parts.length() == 4 and triple_parts[1] != 'unknown' and triple_parts[1] != 'pc' and triple_parts[1] != 'apple' 26 + target_triple = triple_parts[0] + '-unknown-' + triple_parts[2] + '-' + triple_parts[3] 27 + endif 28 + 29 + if tls_lib == 'mbedtls' 30 + version_conf.set('ANT_TARGET_TRIPLE', target_triple + '-mbedtls') 31 + else 32 + version_conf.set('ANT_TARGET_TRIPLE', target_triple) 33 + endif 34 + 35 + config_h = configure_file( 36 + input: src_root / 'include' / 'config.h.in', 37 + output: 'config.h', 38 + configuration: version_conf 39 + )