forked from m154k1/mpv-build-macOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-shaderc
More file actions
executable file
·44 lines (34 loc) · 983 Bytes
/
build-shaderc
File metadata and controls
executable file
·44 lines (34 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash -e
#
# shaderc
# https://github.com/google/shaderc.git
#
cd "$(dirname "$0")"
set -a; . .env; set +a
pkgname="shaderc"
pkgdir="${STOWDIR}/${pkgname}"
srcdir="src/shaderc"
builddir="${TMPDIR:-/tmp}/build.${pkgname}"
echo "::group::$0"
rm -rf "${builddir}"
cd "${srcdir}"
sed -i '' 's/${SHADERC_SKIP_INSTALL}/ON/g' third_party/CMakeLists.txt
sed -Ei '' 's/(GLSLANG_ENABLE_INSTALL ).*\)/\1OFF)/g' third_party/CMakeLists.txt
./utils/git-sync-deps
cd -
cmake -B "${builddir}" -S "${srcdir}" \
-DCMAKE_INSTALL_PREFIX="${pkgdir}" \
-DCMAKE_INSTALL_NAME_DIR="${pkgdir}/lib" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DSHADERC_SKIP_EXECUTABLES=ON \
-DSHADERC_SKIP_TESTS=ON \
-DSHADERC_SKIP_EXAMPLES=ON \
"$@"
cmake --build "${builddir}"
rm -rf "${pkgdir}"
cmake --install "${builddir}"
rm -rf "${pkgdir}"/lib/{*.a,pkgconfig/*{combined,static}.pc}
stow -Rd "${STOWDIR}" "${pkgname}"
rm -rf "${builddir}"
echo "::endgroup::"