-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_external_tools.sh
executable file
·66 lines (58 loc) · 1.76 KB
/
build_external_tools.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
set -e
WGSLRUNNER_PATH="$(dirname "$(realpath "${0}")")"
cd "${WGSLRUNNER_PATH}"
if [ ! -d external_tools ]; then
mkdir external_tools
fi
# allow for non-default locations
if [ "${DAWN_BUILD_PATH}" ]; then
DAWN_BUILD_PATH="$(realpath "${DAWN_BUILD_PATH}")"
if [ ! -d "${DAWN_BUILD_PATH}" ]; then
echo "Error: env path to dawn-build DAWN_BUILD_PATH is not a valid directory."
exit 1
fi
else
DAWN_BUILD_PATH="${WGSLRUNNER_PATH}/dawn-build"
fi
if [ "${WGSLSMITH_PATH}" ]; then
WGSLSMITH_PATH="$(realpath "${WGSLSMITH_PATH}")"
if [ ! -d "${WGSLSMITH_PATH}" ]; then
echo "Error: env path to wgslsmith WGSLSMITH_PATH is not a valid directory."
exit 1
fi
else
WGSLSMITH_PATH="${WGSLRUNNER_PATH}/wgslsmith"
fi
# builds Dawn using the dawn-build tool
cd "${DAWN_BUILD_PATH}"
./scripts/build
export DAWN_SRC_DIR="${DAWN_BUILD_PATH}/dawn"
export DAWN_BUILD_DIR="${DAWN_BUILD_PATH}/build"
# builds the wgslsmith harness using the wgslsmith build script
cd "${WGSLSMITH_PATH}/harness"
cargo build --release
# builds a standalone version of Tint from existing Dawn files
cd "${WGSLRUNNER_PATH}/external_tools"
if [ ! -d tint ]; then
mkdir tint
fi
cd tint
cmake "${DAWN_SRC_DIR}"
make tint
# builds a standalone version of spirv-val from existing Dawn files
cd "${DAWN_SRC_DIR}/third_party/vulkan-deps/spirv-tools/src"
if [ ! -d build ]; then
mkdir build
fi
cd build
cmake -DSPIRV_SKIP_TESTS=ON \
-DSPIRV-Headers_SOURCE_DIR="${DAWN_SRC_DIR}/third_party/vulkan-deps/spirv-headers/src" ..
make spirv-val
# builds a standalone version of glslangValidator from existing Dawn files
cd "${DAWN_SRC_DIR}/third_party/vulkan-deps/glslang/src"
if [ ! -d build ]; then
mkdir build
fi
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" ..
make -j4 install