forked from btcsuite/btcd
-
Notifications
You must be signed in to change notification settings - Fork 26
/
do_ios
executable file
·30 lines (24 loc) · 804 Bytes
/
do_ios
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
#!/usr/bin/env sh
mkdir -p lib
echo "Building for arm64..."
CGO_ENABLED=1 \
GOOS=ios \
GOARCH=arm64 \
SDK=iphoneos \
CGO_ENABLED=1 \
CC=$(PWD)/clangwrap.sh \
CGO_CFLAGS="-fembed-bitcode" \
go build -buildmode=c-archive -tags ios -trimpath -o lib/pld_arm64.a lnd/cmd/lnd/main.go
echo "Building for x86_64..."
CGO_ENABLED=1 \
GOOS=ios \
GOARCH=amd64 \
SDK=iphonesimulator \
CGO_ENABLED=1 \
CC=$(PWD)/clangwrap.sh \
go build -buildmode=c-archive -tags ios -trimpath -o lib/pld_amd64.a lnd/cmd/lnd/main.go
# /usr/bin/lipo ./lib/pld_arm64.a ./lib/pld_amd64.a -create -output ./lib/ios/pld.a
xcodebuild -create-xcframework -output lib/pld.xcframework -library lib/pld_arm64.a -library lib/pld_amd64.a
cp lib/pld_amd64.h lib/pld.h
echo "output file in lib/pld.xcframework"
echo "header file in lib/pld.h"