Files

12 lines
700 B
Bash
Executable File

#!/bin/bash
# Cross-build OctoReport.exe (static, GUI) with mingw-w64; zstd 1.5.7 compressor compiled in.
set -euo pipefail
H=$(cd "$(dirname "$0")" && pwd); Z=/mnt/Games/@project/tools/zstd-1.5.7-src/zstd-1.5.7/lib
O=${1:-$H/out}; mkdir -p "$O/obj"
for f in $Z/common/*.c $Z/compress/*.c; do
x86_64-w64-mingw32-gcc -O2 -DZSTD_DISABLE_ASM -DZSTD_MULTITHREAD=0 -I$Z -I$Z/common -c "$f" -o "$O/obj/$(basename "${f%.c}").o"
done
x86_64-w64-mingw32-g++ -std=c++20 -O2 -municode -mwindows -I$Z "$H/OctoReport.cpp" "$O"/obj/*.o -o "$O/OctoReport.exe" \
-static -static-libgcc -static-libstdc++ -lwinhttp -lole32 -lshell32 -luuid
x86_64-w64-mingw32-strip "$O/OctoReport.exe"; ls -la "$O/OctoReport.exe"