-
Notifications
You must be signed in to change notification settings - Fork 94
/
build-liboqs.sh
executable file
·48 lines (35 loc) · 1.39 KB
/
build-liboqs.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
#!/bin/bash
BRANCH=ivpn-ios-app
IN_LIBOQS=lib/Release/liboqs.a
OUT_LIBOQS_IPHONEOS=../../IVPNClient/liboqs/liboqs-iphoneos.a
OUT_LIBOQS_IPHONESIMULATOR=../../IVPNClient/liboqs/liboqs-iphonesimulator.a
set -e
# Clone liboqs
echo "=> Clone liboqs"
mkdir -p submodules
cd submodules
if [ ! -d "liboqs" ] ; then
git clone --depth 1 --branch ${BRANCH} https://github.com/ivpn/liboqs
fi
cd liboqs
# liboqs for iphoneos
echo "=> Build liboqs-iphoneos.a"
cmake -G Xcode -DOQS_USE_OPENSSL=OFF -DOQS_BUILD_ONLY_LIB=ON -DOQS_DIST_BUILD=ON -DOQS_MINIMAL_BUILD="KEM_kyber_1024;" -DCMAKE_TOOLCHAIN_FILE=.CMake/toolchain_ios.cmake -DPLATFORM=OS64
cmake --build . --config Release
echo "=> Copy liboqs.a to ${OUT_LIBOQS_IPHONEOS}"
cp -f $IN_LIBOQS $OUT_LIBOQS_IPHONEOS
echo "=> Clean files"
rm -rf $IN_LIBOQS
git clean -fd
echo "=> Build completed for ${OUT_LIBOQS_IPHONEOS}"
# liboqs for iphonesimulator
echo "=> Build liboqs-iphonesimulator.a"
cmake -G Xcode -DOQS_USE_OPENSSL=OFF -DOQS_BUILD_ONLY_LIB=ON -DOQS_DIST_BUILD=ON -DOQS_MINIMAL_BUILD="KEM_kyber_1024;" -DCMAKE_TOOLCHAIN_FILE=.CMake/toolchain_ios.cmake -DPLATFORM=SIMULATORARM64
cmake --build . --config Release
echo "=> Copy liboqs.a to ${OUT_LIBOQS_IPHONESIMULATOR}"
cp -f $IN_LIBOQS $OUT_LIBOQS_IPHONESIMULATOR
echo "=> Clean files"
rm -rf $IN_LIBOQS
git clean -fd
echo "=> Build completed for ${OUT_LIBOQS_IPHONESIMULATOR}"
echo "=> BUILD SUCCESSFUL"