Last active
March 10, 2025 21:22
-
-
Save dcvz/a2129372537f17b95b1f1e3e694ca6d9 to your computer and use it in GitHub Desktop.
ZeldaRecomp macOS build & run script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ============================================== | |
# Zelda64Recompiled macOS Build & Run Script | |
# ============================================== | |
# | |
# Prerequisites: | |
# 1. Install pkgx: curl -fsS https://pkgx.sh | sh | |
# 2. Install Xcode from the Mac App Store | |
# | |
# Usage: | |
# ./run-macos.sh | |
# | |
# Notes: | |
# - This script will build in Debug mode | |
# - Required dependencies (ninja, SDL2, FreeType, LLVM) will be handled by pkgx | |
# ============================================== | |
# Run CMake configure command with pkgx managing dependencies | |
pkgx +ninja +libsdl.org@2 +freetype.org +llvm.org cmake \ | |
-DCMAKE_BUILD_TYPE:STRING=Debug \ | |
-DFREETYPE_LIBRARY=$(pkgx +freetype.org pkg-config --variable=libdir freetype2)/libfreetype.dylib \ | |
-DFREETYPE_INCLUDE_DIRS=$(pkgx +freetype.org pkg-config --variable=includedir freetype2)/freetype2 \ | |
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \ | |
-DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang \ | |
-DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ \ | |
-DPATCHES_LD=$(pkgx +llvm.org which ld.lld) \ | |
-DPATCHES_OBJCOPY=$(pkgx +llvm.org which llvm-objcopy) \ | |
-DCMAKE_AR=$(pkgx +llvm.org which llvm-ar) \ | |
-DPATCHES_C_COMPILER=$(pkgx +llvm.org which clang) \ | |
-DRT64_BUILD_EXAMPLES=ON \ | |
--no-warn-unused-cli \ | |
-H. \ | |
-Bbuild \ | |
-G Ninja | |
# Run CMake build command | |
pkgx +ninja cmake --build build --config Debug | |
# Check if the build was successful | |
if [ $? -ne 0 ]; then | |
echo "Build failed" | |
exit 1 | |
fi | |
echo "Build successful! Starting debugger..." | |
echo "Type 'run' at the (lldb) prompt to start the game" | |
echo "Type 'bt' if the game crashes to see the backtrace" | |
echo "Type 'quit' to exit LLDB" | |
# Run the compiled application | |
lldb -- ./build/Zelda64Recompiled.app/Contents/MacOS/Zelda64Recompiled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment