From f42ac94a45c8c451e28b5ae4c7c2b5400a182781 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Tue, 19 Mar 2024 09:02:48 -0500 Subject: [PATCH] Added check to release script, to check if DLL exists --- create_release_mingw.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/create_release_mingw.sh b/create_release_mingw.sh index 765de11..ccda555 100644 --- a/create_release_mingw.sh +++ b/create_release_mingw.sh @@ -5,6 +5,7 @@ set -o errexit # Stop executing when a command fails BASE_DIR=$(dirname $0) REL_DIR="$BASE_DIR/release/dist" +RAYLIB_DLL="$BASE_DIR/build/subprojects/raylib/libraylib.dll" mkdir -p "$REL_DIR" @@ -14,12 +15,15 @@ meson setup build/ # Build the application meson compile -C build/ -# Parse the output of the 'ldd' command, and create a file with the required DLL paths. -ldd build/pong.exe | awk ' NF == 4 {print $3}' > "$BASE_DIR/tmp_file.txt" +# Parse the output of the 'ldd' command (using only DLLs that are found) and create a file with the required DLL paths. +ldd build/pong.exe | awk ' NF == 4 {print $3}' | grep -i "dll" > "$BASE_DIR/tmp_file.txt" # Copy the required DLLs. cp $(cat "$BASE_DIR/tmp_file.txt") "$REL_DIR" +# Copy the raylib DLL, if it does not exist in the directory +cp -n "$RAYLIB_DLL" "$REL_DIR" + # Copy the executable itself cp "$BASE_DIR/build/pong" "$REL_DIR"