Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -euo pipefail
- BUILD_DIR="build-macos"
- CMAKE_BUILD_TYPE="Release"
- # Detect Homebrew prefix (on Apple Silicon it's /opt/homebrew, on Intel it's /usr/local)
- BREW_PREFIX=$(brew --prefix)
- echo "[INFO] Building PocketMage Desktop Emulator for macOS"
- echo "[INFO] Using Homebrew prefix: $BREW_PREFIX"
- echo "[INFO] Checking dependencies..."
- if ! brew list --versions sdl2 >/dev/null 2>&1; then
- echo "[ERROR] SDL2 not installed. Run: brew install sdl2"
- exit 1
- fi
- if ! brew list --versions sdl2_ttf >/dev/null 2>&1; then
- echo "[ERROR] SDL2_ttf not installed. Run: brew install sdl2_ttf"
- exit 1
- fi
- echo "[SUCCESS] SDL2 and SDL2_ttf found via Homebrew"
- echo "[INFO] Creating build directory: $BUILD_DIR"
- mkdir -p "$BUILD_DIR"
- echo "[INFO] Configuring build with CMake..."
- cmake -S . -B "$BUILD_DIR" \
- -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
- -DCMAKE_PREFIX_PATH="$BREW_PREFIX"
- echo "[INFO] Building project..."
- cmake --build "$BUILD_DIR" --config "$CMAKE_BUILD_TYPE" -j$(sysctl -n hw.ncpu)
- echo "[SUCCESS] Build completed"
- echo "[INFO] Executable: $BUILD_DIR/PocketMage_Desktop_Emulator"
Advertisement
Add Comment
Please, Sign In to add comment