summaryrefslogtreecommitdiff
path: root/scripts/project_init.sh
blob: db24c8f2c9c1db96b1f5a6861200936428649928 (plain)
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
#!/bin/sh
# Fetch minimal third-party dependencies

set -e

echo "Initializing demo64k dependencies..."

mkdir -p third_party

if [ ! -f third_party/miniaudio.h ]; then
  echo "Fetching miniaudio.h..."
  curl -L https://raw.githubusercontent.com/mackron/miniaudio/master/miniaudio.h     -o third_party/miniaudio.h
else
  echo "miniaudio.h already present."
fi

# wgpu-native submodule
if [ ! -d third_party/wgpu-native ]; then
  echo "Fetching wgpu-native submodule..."
  git submodule update --init --recursive
else
  echo "wgpu-native submodule already present."
fi

if [ ! -f third_party/wgpu-native/target/release/libwgpu_native.a ]; then
  echo "Building wgpu-native static library..."
  (cd third_party/wgpu-native && make lib-native)
else
  echo "wgpu-native static library already built."
fi

echo "Done."