2024-11-22 08:25:15 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
32)
|
|
|
|
WINXX=win32
|
|
|
|
;;
|
|
|
|
64)
|
|
|
|
WINXX=win64
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "ERROR: $0 must be called with one argument: 32 or 64" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
|
|
|
. build_common
|
|
|
|
cd .. # root project dir
|
|
|
|
|
|
|
|
WINXX_BUILD_DIR="$WORK_DIR/build-$WINXX"
|
|
|
|
|
2024-11-22 22:17:41 +01:00
|
|
|
app/deps/adb_windows.sh
|
2024-11-21 23:16:18 +01:00
|
|
|
app/deps/sdl.sh $WINXX cross shared
|
2024-12-09 18:30:37 +01:00
|
|
|
app/deps/dav1d.sh $WINXX cross shared
|
2024-11-21 23:16:18 +01:00
|
|
|
app/deps/ffmpeg.sh $WINXX cross shared
|
|
|
|
app/deps/libusb.sh $WINXX cross shared
|
2024-11-22 08:25:15 +01:00
|
|
|
|
2024-11-21 23:16:18 +01:00
|
|
|
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/$WINXX-cross-shared"
|
2024-11-22 22:17:41 +01:00
|
|
|
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-windows"
|
2024-11-22 08:25:15 +01:00
|
|
|
|
|
|
|
rm -rf "$WINXX_BUILD_DIR"
|
|
|
|
meson setup "$WINXX_BUILD_DIR" \
|
|
|
|
--pkg-config-path="$DEPS_INSTALL_DIR/lib/pkgconfig" \
|
|
|
|
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
|
|
|
|
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
|
|
|
|
--cross-file=cross_$WINXX.txt \
|
|
|
|
--buildtype=release \
|
|
|
|
--strip \
|
|
|
|
-Db_lto=true \
|
|
|
|
-Dcompile_server=false \
|
|
|
|
-Dportable=true
|
|
|
|
ninja -C "$WINXX_BUILD_DIR"
|
|
|
|
|
|
|
|
# Group intermediate outputs into a 'dist' directory
|
|
|
|
mkdir -p "$WINXX_BUILD_DIR/dist"
|
|
|
|
cp "$WINXX_BUILD_DIR"/app/scrcpy.exe "$WINXX_BUILD_DIR/dist/"
|
|
|
|
cp app/data/scrcpy-console.bat "$WINXX_BUILD_DIR/dist/"
|
|
|
|
cp app/data/scrcpy-noconsole.vbs "$WINXX_BUILD_DIR/dist/"
|
|
|
|
cp app/data/icon.png "$WINXX_BUILD_DIR/dist/"
|
|
|
|
cp app/data/open_a_terminal_here.bat "$WINXX_BUILD_DIR/dist/"
|
|
|
|
cp "$DEPS_INSTALL_DIR"/bin/*.dll "$WINXX_BUILD_DIR/dist/"
|
2024-11-22 22:17:41 +01:00
|
|
|
cp -r "$ADB_INSTALL_DIR"/. "$WINXX_BUILD_DIR/dist/"
|