test_plugin_linux.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash -eu
  2. export LIBWEBRTC_DOWNLOAD_URL=https://github.com/Unity-Technologies/com.unity.webrtc/releases/download/M92/webrtc-linux.zip
  3. export SOLUTION_DIR=$(pwd)/Plugin~
  4. # See False positives
  5. # https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow
  6. export ASAN_OPTIONS=protect_shadow_gap=0:detect_leaks=1:detect_container_overflow=0
  7. export LSAN_OPTIONS=suppressions=$(pwd)/Plugin~/tools/sanitizer/lsan_suppressions.txt
  8. source ~/.profile
  9. # Download LibWebRTC
  10. curl -L $LIBWEBRTC_DOWNLOAD_URL > webrtc.zip
  11. unzip -d $SOLUTION_DIR/webrtc webrtc.zip
  12. # Install glfw3
  13. sudo apt install -y libglfw3-dev
  14. # Install glad2
  15. pip3 install git+https://github.com/dav1dde/glad.git@glad2#egg=glad2
  16. # Build UnityRenderStreaming Plugin
  17. cd "$SOLUTION_DIR"
  18. cmake . \
  19. -D CMAKE_C_COMPILER="clang-10" \
  20. -D CMAKE_CXX_COMPILER="clang++-10" \
  21. -D CMAKE_BUILD_TYPE="Debug" \
  22. -D CMAKE_CXX_FLAGS="-stdlib=libc++" \
  23. -D cxx_no_rtti=ON \
  24. -B build
  25. cmake \
  26. --build build \
  27. --config Debug \
  28. --target WebRTCLibTest
  29. # Run UnitTest
  30. "$SOLUTION_DIR/build/WebRTCPluginTest/WebRTCLibTest"