2021-12-05 19:30:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SHADERC_REPO="https://github.com/google/shaderc.git"
|
|
|
|
SHADERC_COMMIT="657c5ed2ba1714c0430895a274a94d6f2aeeab85"
|
|
|
|
|
|
|
|
ffbuild_enabled() {
|
|
|
|
[[ $ADDINS_STR == *4.4* ]] && return -1
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_dockerbuild() {
|
|
|
|
git-mini-clone "$SHADERC_REPO" "$SHADERC_COMMIT" shaderc
|
|
|
|
cd shaderc
|
|
|
|
|
|
|
|
./utils/git-sync-deps
|
|
|
|
|
|
|
|
mkdir build && cd build
|
|
|
|
|
|
|
|
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \
|
|
|
|
-DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
|
|
|
|
-DENABLE_EXCEPTIONS=ON -DENABLE_CTEST=OFF -DENABLE_GLSLANG_BINARIES=OFF -DSPIRV_SKIP_EXECUTABLES=ON \
|
|
|
|
-DSPIRV_TOOLS_BUILD_STATIC=ON -DBUILD_SHARED_LIBS=OFF ..
|
|
|
|
ninja -j$(nproc)
|
|
|
|
ninja install
|
|
|
|
|
|
|
|
# for some reason, this does not get installed...
|
|
|
|
cp libshaderc_util/libshaderc_util.a "$FFBUILD_PREFIX"/lib
|
|
|
|
|
|
|
|
echo "Libs: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/shaderc_combined.pc
|
|
|
|
echo "Libs: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/shaderc_static.pc
|
|
|
|
|
|
|
|
cp "$FFBUILD_PREFIX"/lib/pkgconfig/{shaderc_combined,shaderc}.pc
|
|
|
|
|
|
|
|
if [[ $TARGET == win* ]]; then
|
|
|
|
rm -r "$FFBUILD_PREFIX"/bin "$FFBUILD_PREFIX"/lib/*.dll.a
|
|
|
|
elif [[ $TARGET == linux* ]]; then
|
|
|
|
rm -r "$FFBUILD_PREFIX"/bin "$FFBUILD_PREFIX"/lib/*.so*
|
|
|
|
else
|
|
|
|
echo "Unknown target"
|
|
|
|
return -1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_configure() {
|
|
|
|
echo --enable-libshaderc
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_unconfigure() {
|
2021-12-05 21:14:09 +00:00
|
|
|
[[ $ADDINS_STR == *4.4* ]] && return 0
|
2021-12-05 19:30:30 +00:00
|
|
|
echo --disable-libshaderc
|
|
|
|
}
|