diff --git a/libant/meson.build b/libant/meson.build index 3faa7ed..d4ed328 100644 --- a/libant/meson.build +++ b/libant/meson.build @@ -17,6 +17,13 @@ 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, +) + lib_sources = files(run_command( python, files('meson/sources.py'), src_root / 'sources.json', 'library', src_root, check: true @@ -24,7 +31,7 @@ lib_sources = files(run_command( libant_core = static_library( 'ant_core', - lib_sources + [snapshot_h], + lib_sources + [snapshot_h, messages_h], include_directories: include, dependencies: ant_deps + [oxc_dep], ) @@ -32,7 +39,7 @@ libant_core = static_library( if use_lto libant_core_lto = static_library( 'ant_core_lto', - lib_sources + [snapshot_h], + lib_sources + [snapshot_h, messages_h], include_directories: include, dependencies: ant_deps + [oxc_dep], c_args: ['-flto'], diff --git a/libant/scripts/compile.sh b/libant/scripts/compile.sh index 1d7f51c..b74c675 100755 --- a/libant/scripts/compile.sh +++ b/libant/scripts/compile.sh @@ -4,12 +4,21 @@ set -e . "$(dirname "$0")/common.sh" cd "$SCRIPT_DIR" - export PKG_CONFIG_PATH="$DEPS_DIR/lib/pkgconfig:$PKG_CONFIG_PATH" -mkdir -p "$BUILD_DIR/vendor/tlsuv" -rm -rf "$BUILD_DIR/vendor/tlsuv/deps" -cp -RL "$BUILD_DIR/deps" "$BUILD_DIR/vendor/tlsuv/deps" +tlsuv_wrap="$SCRIPT_DIR/vendor/tlsuv.wrap" +tlsuv_dir="$(awk -F '=' '/^directory[[:space:]]*=/{gsub(/[[:space:]]/, "", $2); print $2; exit}' "$tlsuv_wrap")" + +if [ -z "$tlsuv_dir" ]; then + echo "Failed to resolve tlsuv directory from $tlsuv_wrap" >&2 + exit 1 +fi + +tlsuv_prefix="$BUILD_DIR/vendor/$tlsuv_dir/deps" +mkdir -p "$BUILD_DIR/vendor/$tlsuv_dir" + +rm -rf "$tlsuv_prefix" +cp -RL "$BUILD_DIR/deps" "$tlsuv_prefix" -meson setup build --prefer-static -Dtls_library=mbedtls -Ddeps_prefix_cmake="$BUILD_DIR/vendor/tlsuv/deps" "$@" -meson compile -C build \ No newline at end of file +meson setup build --prefer-static -Dtls_library=mbedtls -Ddeps_prefix_cmake="$tlsuv_prefix" "$@" +meson compile -C build diff --git a/meson.build b/meson.build index e7f779c..e1c0115 100644 --- a/meson.build +++ b/meson.build @@ -17,6 +17,13 @@ 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, +) + lib_sources = files(run_command( python, files('meson/sources.py'), files('sources.json'), 'engine', check: true @@ -24,10 +31,10 @@ lib_sources = files(run_command( libant = static_library( 'ant', - lib_sources + [snapshot_h], + install: true, + lib_sources + [snapshot_h, messages_h], include_directories: include, - dependencies: ant_deps, - install: true + dependencies: ant_deps ) pkg_lib = custom_target( @@ -64,13 +71,6 @@ libant_dep = declare_dependency( dependencies: ant_deps + [oxc_dep, pkg_dep] ) -messages_h = custom_target('messages_h', - input: 'src/core/messages.toml', - output: 'messages.h', - command: [python, files('meson/messages.py'), '@INPUT@'], - capture: true, -) - link_args = [] if get_option('static_link') link_args += ['-static'] @@ -78,6 +78,6 @@ endif executable( 'ant', - files('src/main.c', 'src/watch.c') + [messages_h], + files('src/main.c', 'src/watch.c'), dependencies: libant_dep, link_args: link_args )