Fix macOS asset extraction auto-build and docs

- extract_assets.sh: detect Homebrew and pass CMAKE_PREFIX_PATH,
  OPENSSL_ROOT_DIR, and PKG_CONFIG_PATH when auto-building on macOS
  (bare cmake couldn't find Homebrew deps)
- README.md: fix macOS brew command that had comments after line
  continuations (breaks shell execution)
- BUILD_INSTRUCTIONS.md: expand macOS asset extraction section with
  auto-build note and expansion targets
This commit is contained in:
Kelsi 2026-02-23 18:40:26 -08:00
parent f66b9eb154
commit 685736fa16
3 changed files with 21 additions and 3 deletions

View file

@ -81,7 +81,18 @@ if [ ! -f "$BINARY" ]; then
echo "Building asset_extract..."
if [ ! -d "$BUILD_DIR" ]; then
cmake -S "$SCRIPT_DIR" -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release
CMAKE_EXTRA_ARGS=()
# On macOS, Homebrew installs to a non-default prefix that CMake
# can't find automatically — pass it explicitly.
if command -v brew &>/dev/null; then
BREW="$(brew --prefix)"
CMAKE_EXTRA_ARGS+=(
"-DCMAKE_PREFIX_PATH=$BREW"
"-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3)"
)
export PKG_CONFIG_PATH="$BREW/lib/pkgconfig:$(brew --prefix ffmpeg)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix vulkan-loader 2>/dev/null)/lib/pkgconfig:$(brew --prefix shaderc 2>/dev/null)/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
fi
cmake -S "$SCRIPT_DIR" -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release "${CMAKE_EXTRA_ARGS[@]}"
fi
NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4)
cmake --build "$BUILD_DIR" --target asset_extract -- -j"$NPROC"