Files
2077-gps-mod/tools/build_red4ext_shim.sh
T
2026-06-27 04:36:28 -05:00

20 lines
652 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
plugin_dir="$repo_root/red4ext/EdgeWeightGPS"
build_dir="$repo_root/build/red4ext/MomentumGPS-mingw64"
sdk_dir="$repo_root/vendor/RED4ext.SDK"
if [[ ! -f "$sdk_dir/include/RED4ext/Api/v1/PluginInfo.hpp" ]]; then
mkdir -p "$repo_root/vendor"
git clone --depth 1 https://github.com/WopsS/RED4ext.SDK.git "$sdk_dir"
fi
cmake -S "$plugin_dir" -B "$build_dir" \
-DCMAKE_TOOLCHAIN_FILE="$plugin_dir/cmake/mingw64-toolchain.cmake" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build "$build_dir" --parallel
printf '%s\n' "$build_dir/MomentumGPS.dll"