#!/usr/bin/env bash # Build the mtgodot GDExtension into project/bin/. macOS only (Phase 1). set -euo pipefail cd "$(dirname "$0")" CONFIG="${1:-Debug}" # Debug | Release JOBS="${JOBS:-$(sysctl -n hw.ncpu)}" # godot-cpp + the vendored deps (zstd, libsodium-cmake and its nested libsodium) # are submodules — recurse. miniLZO is vendored in-tree, nothing to fetch. if [ ! -f extension/godot-cpp/CMakeLists.txt ] \ || [ ! -f extension/third_party/zstd/build/cmake/CMakeLists.txt ] \ || [ ! -f extension/third_party/libsodium-cmake/libsodium/src/libsodium/include/sodium.h ]; then echo "submodules missing — fetching (git submodule update --init --recursive)…" >&2 git submodule update --init --recursive fi cmake -S . -B build -DCMAKE_BUILD_TYPE="$CONFIG" cmake --build build --config "$CONFIG" -j "$JOBS" echo echo "Built libs in project/bin/:" ls -la project/bin/*.dylib 2>/dev/null || echo " (none — check build output above)"