commit
46ca1bb04a
7
.github/workflows/macos.yml
vendored
7
.github/workflows/macos.yml
vendored
@ -30,11 +30,18 @@ jobs:
|
||||
- name: Build
|
||||
run: cmake --build build -t install
|
||||
|
||||
- name: Make fix_dylibs.sh executable
|
||||
run: chmod +x fix_dylibs.sh
|
||||
|
||||
- name: Fix dylibs
|
||||
run: ./fix_dylibs.sh VoxelEngine Release build
|
||||
|
||||
- name: Create DMG
|
||||
run: |
|
||||
mkdir VoxelEngineDmgContent
|
||||
cp -r build/res VoxelEngineDmgContent/
|
||||
cp -r build/VoxelEngine VoxelEngineDmgContent/
|
||||
cp -r build/libs VoxelEngineDmgContent/libs
|
||||
hdiutil create VoxelEngineMacApp.dmg -volname "VoxelEngine" -srcfolder VoxelEngineDmgContent -ov -format UDZO
|
||||
|
||||
- name: Upload artifacts
|
||||
|
||||
24
fix_dylibs.sh
Executable file
24
fix_dylibs.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
PROJECT_NAME=$1
|
||||
CONFIG=$2
|
||||
OUTPUT_DIR=$3
|
||||
LIBS_DIR="$OUTPUT_DIR/libs"
|
||||
|
||||
mkdir -p "$LIBS_DIR"
|
||||
|
||||
TMP_BINARY="$OUTPUT_DIR/tmp_$PROJECT_NAME"
|
||||
BINARY="$OUTPUT_DIR/$PROJECT_NAME"
|
||||
|
||||
cp "$BINARY" "$TMP_BINARY"
|
||||
|
||||
otool -L "$TMP_BINARY" | grep -o '/.*dylib' | while read -r dylib; do
|
||||
if [[ "$dylib" == /usr/lib/* || "$dylib" == /System/Library/* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
cp "$dylib" "$LIBS_DIR"
|
||||
install_name_tool -change "$dylib" "@executable_path/libs/$(basename "$dylib")" "$TMP_BINARY"
|
||||
done
|
||||
|
||||
mv "$TMP_BINARY" "$BINARY"
|
||||
Loading…
x
Reference in New Issue
Block a user