-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildtargets.sh
55 lines (40 loc) · 1.22 KB
/
buildtargets.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
#!/bin/bash
cargotarget() {
#First argument is the desired target/toolchain, the rest are passed directly to cargo
#(such as '-vvv' or 'build/run')
local target="$1"
shift 1
cargo "+stable-$target" "$@" "--target=$target"
}
HOST_ARCH="${MSYSTEM_CHOST%%-*}"
BUILDRUN="build"
if [ "$(echo $1 | tr '[:upper:]' '[:lower:]')" = "run" ] ; then
if [ "$HOST_ARCH" = "i686" ] ; then
BUILDRUN="run"
else
echo "Incompatible host architecture. Building only."
fi
fi
if [ "$(echo $2 | tr '[:upper:]' '[:lower:]')" = "release" ] ; then
cargotarget "i686-pc-windows-gnu" -vv "$BUILDRUN" "--release"
else
cargotarget "i686-pc-windows-gnu" -vv "$BUILDRUN"
fi
BUILDRUN="build"
if [ "$(echo $1 | tr '[:upper:]' '[:lower:]')" = "run" ] ; then
if [ "$HOST_ARCH" = "x86_64" ] ; then
BUILDRUN="run"
else
echo "Incompatible host architecture. Building only."
fi
fi
if [ "$(echo $2 | tr '[:upper:]' '[:lower:]')" = "release" ] ; then
cargotarget "x86_64-pc-windows-gnu" -vv "$BUILDRUN" "--release"
else
cargotarget "x86_64-pc-windows-gnu" -vv "$BUILDRUN"
fi
# TEMPORARY (until audio data is compiled into binary)
for i in target/*/debug target/*/release
do
cp *.wav "$i"
done