Skip to content

Commit 1a8a476

Browse files
committed
scripts: add build-spirv-tools
1 parent 0ba4fdc commit 1a8a476

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

build-spirv-tools

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash -e
2+
#
3+
# SPIRV-Tools
4+
# https://github.com/KhronosGroup/SPIRV-Tools.git
5+
#
6+
# SPIRV-Headers
7+
# https://github.com/KhronosGroup/SPIRV-Headers.git
8+
#
9+
cd "$(dirname "$0")"
10+
set -a; . .env; set +a
11+
12+
pkgname="spirv-tools"
13+
pkgdir="${STOWDIR}/${pkgname}"
14+
srcdir="src/SPIRV-Tools"
15+
builddir="${TMPDIR:-/tmp}/build.${pkgname}"
16+
17+
echo "::group::$0"
18+
19+
rm -rf "${builddir}"
20+
21+
cmake -B "${builddir}" -S "${srcdir}" \
22+
-DCMAKE_INSTALL_PREFIX="${pkgdir}" \
23+
-DCMAKE_INSTALL_NAME_DIR="${pkgdir}/lib" \
24+
-DCMAKE_BUILD_TYPE=Release \
25+
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
26+
-DBUILD_SHARED_LIBS=OFF \
27+
-DSPIRV_SKIP_EXECUTABLES=ON \
28+
-DSPIRV_SKIP_TESTS=ON \
29+
"$@"
30+
31+
cmake --build "${builddir}"
32+
33+
rm -rf "${pkgdir}"
34+
35+
cmake --install "${builddir}"
36+
rm -rf "${pkgdir}"/lib/cmake
37+
stow -Rd "${STOWDIR}" "${pkgname}"
38+
39+
rm -rf "${builddir}"
40+
41+
echo "::endgroup::"

0 commit comments

Comments
 (0)