From 21c864da600f4020c5017fe280d0761b5bb201d0 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Wed, 6 Mar 2024 13:06:29 -0600 Subject: [PATCH] Created script to copy DLLs into application fodler on mingw --- copy_dlls_mingw.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 copy_dlls_mingw.sh diff --git a/copy_dlls_mingw.sh b/copy_dlls_mingw.sh new file mode 100644 index 0000000..50f8316 --- /dev/null +++ b/copy_dlls_mingw.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# This script copies required DLLs, and the application itself into a folder called 'release'. It only runs on MinGW. + +BASE_DIR=$(dirname $0) +REL_DIR="$BASE_DIR/release/dist" + +mkdir -p "$REL_DIR" + +# 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" + +# Copy the required DLLs. +cp $(cat "$BASE_DIR/tmp_file.txt") "$REL_DIR" + +# Copy the executable itself +cp "$BASE_DIR/build/pong" "$REL_DIR" + +# Remove the temporary file. +rm "$BASE_DIR/tmp_file.txt" +