summaryrefslogtreecommitdiff
path: root/scripts/build_win.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build_win.sh')
-rwxr-xr-xscripts/build_win.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/build_win.sh b/scripts/build_win.sh
index c1732f0..da75748 100755
--- a/scripts/build_win.sh
+++ b/scripts/build_win.sh
@@ -24,12 +24,22 @@ cp third_party/windows/lib/wgpu_native.dll build_win/
# Copy MinGW DLLs (pthread, etc.)
echo "Copying MinGW DLLs..."
-MINGW_BIN=$(dirname $(find /opt/homebrew -name "libwinpthread-1.dll" | grep x86_64 | head -n 1))
-if [ -d "$MINGW_BIN" ]; then
- cp "$MINGW_BIN/libwinpthread-1.dll" build_win/
- cp "$MINGW_BIN/libgcc_s_seh-1.dll" build_win/ 2>/dev/null || true
- cp "$MINGW_BIN/libstdc++-6.dll" build_win/ 2>/dev/null || true
+if [[ "$(uname)" == "Darwin" ]]; then
+ MINGW_SEARCH_ROOTS="/opt/homebrew"
else
+ # Linux / WSL: mingw-w64 installed via apt
+ MINGW_SEARCH_ROOTS="/usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32"
+fi
+COPIED=0
+for dll in libwinpthread-1.dll libgcc_s_seh-1.dll libstdc++-6.dll; do
+ src=$(find $MINGW_SEARCH_ROOTS -name "$dll" 2>/dev/null | head -n 1)
+ if [ -n "$src" ]; then
+ cp "$src" build_win/
+ echo " Copied: $dll"
+ COPIED=$((COPIED+1))
+ fi
+done
+if [ "$COPIED" -eq 0 ]; then
echo "Warning: Could not find MinGW DLLs. You might need them to run the exe."
fi