forked from m154k1/mpv-build-macOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-spirv-tools
More file actions
executable file
·50 lines (40 loc) · 1.15 KB
/
build-spirv-tools
File metadata and controls
executable file
·50 lines (40 loc) · 1.15 KB
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
45
46
47
48
49
50
#!/bin/bash -e
#
# SPIRV-Tools
# https://github.com/KhronosGroup/SPIRV-Tools.git
#
# SPIRV-Headers
# https://github.com/KhronosGroup/SPIRV-Headers.git
#
cd "$(dirname "$0")"
set -a; . .env; set +a
pkgname="spirv-tools"
pkgdir="${STOWDIR}/${pkgname}"
tools_srcdir="src/SPIRV-Tools"
headers_srcdir="src/SPIRV-Headers"
builddir="${TMPDIR:-/tmp}/build.${pkgname}"
echo "::group::$0"
rm -rf "${builddir}" "${pkgdir}"
cmake -B "${builddir}" -S "${headers_srcdir}" \
-DCMAKE_INSTALL_PREFIX="${pkgdir}" \
-DCMAKE_BUILD_TYPE=Release \
-DSPIRV_HEADERS_ENABLE_INSTALL=ON \
-DSPIRV_HEADERS_ENABLE_TESTS=OFF
cmake --install "${builddir}"
rm -rf "${builddir}"
cmake -B "${builddir}" -S "${tools_srcdir}" \
-DCMAKE_INSTALL_PREFIX="${pkgdir}" \
-DCMAKE_INSTALL_NAME_DIR="${pkgdir}/lib" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DBUILD_SHARED_LIBS=OFF \
-DSPIRV-Headers_SOURCE_DIR="${pkgdir}" \
-DSPIRV_SKIP_EXECUTABLES=ON \
-DSPIRV_SKIP_TESTS=ON \
"$@"
cmake --build "${builddir}"
cmake --install "${builddir}"
rm -rf "${pkgdir}"/{lib,share}/cmake
stow -Rd "${STOWDIR}" "${pkgname}"
rm -rf "${builddir}"
echo "::endgroup::"