-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·63 lines (50 loc) · 1.89 KB
/
build.sh
File metadata and controls
executable file
·63 lines (50 loc) · 1.89 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
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# USAGE: ./build.sh <TARGET ARCHITECTURE>
# List of available target architectures https://doc.rust-lang.org/nightly/rustc/platform-support.html
# create a build directory
mkdir build
# enter the vade-evan repository
cd vade-evan
# rustup add architecture
rustup target add $1
# load the target machine of gcc
host=`gcc -dumpmachine`
if [ $1 = "x86_64-apple-darwin" ] && [[ $host != "x86_64-apple-darwin"* ]]
then
echo "Build target is x86_64-apple-darwin which can only be built locally on a mac machine"
elif [ $1 = "x86_64-apple-darwin" ] && [[ $host == "x86_64-apple-darwin"* ]]
then
# build vade-evan for target using cross
cargo build --release --no-default-features --features=sdk --target-dir ../build --target $1
elif [ $1 = "armv7s-apple-ios" ] || [ $1 = "armv7-apple-ios" ] || [ $1 = "i686-apple-ios" ]
then
echo "Target build not supported"
elif [ $1 = "aarch64-apple-ios" ] || [ $1 = "aarch64-apple-ios-sim" ] || [ $1 = "x86_64-apple-ios" ] || [ $1 = "x86_64-pc-windows-gnu" ]
then
# replace cargo.toml with a new one omitting compilation of didcomm
mv Cargo.toml Cargo.toml.copy
cp ../Cargo.toml.new Cargo.toml
# copy the cross configuration inside vade-evan
cp ../Cross.toml Cross.toml
# build vade-evan for target using cross
cross build --release --no-default-features --features=sdk --target-dir ../build --target $1
# delete cross configuration
rm Cross.toml
# fall back to the original cargo.toml
rm Cargo.toml
mv Cargo.toml.copy Cargo.toml
else
# copy the cross configuration inside vade-evan
cp ../Cross.toml Cross.toml
# build vade-evan for target using cross
cross build --release --no-default-features --features=sdk --target-dir ../build --target $1
# delete cross configuration
rm Cross.toml
fi
# exit vade-evan repository
cd ..
# copy the static library to lib folder
cd lib
mkdir $1
cd ..
cp build/$1/release/libvade_evan.a ./lib/$1/