Files
gimp/build/windows/gitlab-ci/split-debug-msys2.sh
Jehan c5b05b6e03 build: separate debug symbols from binaries in the Windows installer.
The shell script was given to me by ender. This is an additional step he
runs after building.
2021-05-19 21:59:00 +02:00

23 lines
558 B
Bash
Executable File

#!/bin/bash
if [ -z "$1" ]
then
find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy -v --only-keep-debug '{}' '{}'.debug \;
find . \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f -exec objcopy -v --add-gnu-debuglink='{}'.debug '{}' --strip-unneeded \;
find . -iname '*.debug' -exec "$0" {} +
else
while [ -n "$1" ]
do
FP="$1"
NAME="${FP##*/}"
DIR="${FP%/*}"
echo "$FP -> $DIR/.debug"
if [ ! -d "$DIR/.debug" ]
then
mkdir "$DIR/.debug"
fi
mv "$FP" "$DIR/.debug"
shift
done
fi