Skip to content

Commit a6c1161

Browse files
committed
scripts: add build-spirv-tools
1 parent f4d72b1 commit a6c1161

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

build-spirv-tools

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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
18+
echo "*** $0: started"
19+
20+
rm -rf "${builddir}"
21+
22+
cmake -B "${builddir}" -S "${srcdir}" \
23+
-DCMAKE_INSTALL_PREFIX="${pkgdir}" \
24+
-DCMAKE_INSTALL_NAME_DIR="${pkgdir}/lib" \
25+
-DCMAKE_BUILD_TYPE=Release \
26+
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
27+
-DBUILD_SHARED_LIBS=OFF \
28+
-DSPIRV_SKIP_EXECUTABLES=ON \
29+
-DSPIRV_SKIP_TESTS=ON \
30+
"$@"
31+
32+
cmake --build "${builddir}"
33+
34+
rm -rf "${pkgdir}"
35+
36+
cmake --install "${builddir}"
37+
rm -rf "${pkgdir}"/lib/cmake
38+
stow -Rd "${STOWDIR}" "${pkgname}"
39+
40+
rm -rf "${builddir}"
41+
42+
echo "*** $0: finished"

0 commit comments

Comments
 (0)