Skip to content

Commit 8152557

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

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

build-spirv-tools

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash -e
2+
#
3+
# SPIRV-Headers
4+
# https://github.com/KhronosGroup/SPIRV-Headers.git
5+
#
6+
# SPIRV-Tools
7+
# https://github.com/KhronosGroup/SPIRV-Tools.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=ON \
28+
-DSPIRV_TOOLS_BUILD_STATIC=OFF \
29+
-DSPIRV_SKIP_EXECUTABLES=ON \
30+
-DSPIRV_SKIP_TESTS=ON \
31+
"$@"
32+
33+
cmake --build "${builddir}"
34+
35+
rm -rf "${pkgdir}"
36+
37+
cmake --install "${builddir}"
38+
rm -rf "${pkgdir}"/lib/cmake
39+
stow -Rd "${STOWDIR}" "${pkgname}"
40+
41+
rm -rf "${builddir}"
42+
43+
echo "*** $0: finished"

0 commit comments

Comments
 (0)