build_plugin_mac.sh 669 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash -eu
  2. export LIBWEBRTC_DOWNLOAD_URL=https://github.com/Unity-Technologies/com.unity.webrtc/releases/download/M92/webrtc-mac.zip
  3. export SOLUTION_DIR=$(pwd)/Plugin~
  4. export DYLIB_FILE=$(pwd)/Runtime/Plugins/macOS/libwebrtc.dylib
  5. # Install cmake
  6. export HOMEBREW_NO_AUTO_UPDATE=1
  7. brew install cmake
  8. # Download LibWebRTC
  9. curl -L $LIBWEBRTC_DOWNLOAD_URL > webrtc.zip
  10. unzip -d $SOLUTION_DIR/webrtc webrtc.zip
  11. # Remove old dylib file
  12. rm -rf "$DYLIB_FILE"
  13. # Build UnityRenderStreaming Plugin
  14. cd "$SOLUTION_DIR"
  15. cmake . \
  16. -G Xcode \
  17. -D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
  18. -B build
  19. cmake \
  20. --build build \
  21. --config Release \
  22. --target WebRTCPlugin