50-shaderc.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. SCRIPT_REPO="https://github.com/google/shaderc.git"
  3. SCRIPT_COMMIT="9634bcd356c257e72a06bc995e1d40964d6a8375"
  4. ffbuild_enabled() {
  5. [[ $ADDINS_STR == *4.4* ]] && return -1
  6. return 0
  7. }
  8. ffbuild_dockerdl() {
  9. default_dl .
  10. echo "./utils/git-sync-deps"
  11. }
  12. ffbuild_dockerbuild() {
  13. mkdir build && cd build
  14. cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \
  15. -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
  16. -DENABLE_EXCEPTIONS=ON -DENABLE_CTEST=OFF -DENABLE_GLSLANG_BINARIES=OFF -DSPIRV_SKIP_EXECUTABLES=ON \
  17. -DSPIRV_TOOLS_BUILD_STATIC=ON -DBUILD_SHARED_LIBS=OFF ..
  18. ninja -j$(nproc)
  19. ninja install
  20. # for some reason, this does not get installed...
  21. cp libshaderc_util/libshaderc_util.a "$FFBUILD_PREFIX"/lib
  22. echo "Libs: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/shaderc_combined.pc
  23. echo "Libs: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/shaderc_static.pc
  24. cp "$FFBUILD_PREFIX"/lib/pkgconfig/{shaderc_combined,shaderc}.pc
  25. if [[ $TARGET == win* ]]; then
  26. rm -r "$FFBUILD_PREFIX"/bin "$FFBUILD_PREFIX"/lib/*.dll.a
  27. elif [[ $TARGET == linux* ]]; then
  28. rm -r "$FFBUILD_PREFIX"/bin "$FFBUILD_PREFIX"/lib/*.so*
  29. else
  30. echo "Unknown target"
  31. return -1
  32. fi
  33. }
  34. ffbuild_configure() {
  35. echo --enable-libshaderc
  36. }
  37. ffbuild_unconfigure() {
  38. [[ $ADDINS_STR == *4.4* ]] && return 0
  39. echo --disable-libshaderc
  40. }