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

@ -95,10 +95,15 @@ cmake --build build -j"$(sysctl -n hw.logicalcpu)"
### Asset Extraction (macOS)
The script will auto-build `asset_extract` if needed (requires `stormlib`).
It automatically detects Homebrew and passes the correct paths to CMake.
```bash
./extract_assets.sh /path/to/WoW/Data wotlk
```
Supports `classic`, `tbc`, `wotlk` targets (auto-detected if omitted).
---
## 🪟 Windows (MSYS2 — Recommended)

View file

@ -88,8 +88,10 @@ sudo pacman -S sdl2 glm openssl \
# macOS (Homebrew)
brew install cmake pkg-config sdl2 glew glm openssl@3 zlib ffmpeg \
vulkan-loader vulkan-headers shaderc \
unicorn \ # optional: Warden module execution
stormlib # optional: asset_extract tool
unicorn \
stormlib
# unicorn is optional (Warden module execution)
# stormlib is optional (asset_extract tool)
```
### Container build

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"