-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.ios
72 lines (61 loc) · 3.58 KB
/
Makefile.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
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
64
65
66
67
68
69
70
71
72
IOS_OUTPUT?=ios
IOS_BINDING_OUTPUT?=$(BINDING_OUTPUT)/$(IOS_OUTPUT)
IOS_BINDING_NAME?=$(BINDING_NAME).a
binding_ios: binding_ios_arm64 binding_ios_x86_64_sim
lipo $(IOS_BINDING_OUTPUT)/x86_64_sim/$(IOS_BINDING_NAME) $(IOS_BINDING_OUTPUT)/arm64/$(IOS_BINDING_NAME) $(IOS_BINDING_OUTPUT)/armv7/$(IOS_BINDING_NAME) -create -output $(IOS_BINDING_OUTPUT)/$(IOS_BINDING_NAME)
cp $(IOS_BINDING_OUTPUT)/arm64/*.h $(IOS_BINDING_OUTPUT)
rm -rf $(IOS_BINDING_OUTPUT)/arm64 $(IOS_BINDING_OUTPUT)/x86_64_sim $(IOS_BINDING_OUTPUT)/armv7
binding_ios_xcframework: binding_ios_all_iphone binding_ios_all_sim binding_ios_all_catalyst
mkdir -p $(IOS_BINDING_OUTPUT)/headers
cp $(IOS_BINDING_OUTPUT)/arm64/*.h $(IOS_BINDING_OUTPUT)/headers
rm -rf $(IOS_BINDING_OUTPUT)/Openpgp.xcframework
xcodebuild -create-xcframework \
-library $(IOS_BINDING_OUTPUT)/arm64/$(IOS_BINDING_NAME) -headers $(IOS_BINDING_OUTPUT)/headers \
-library $(IOS_BINDING_OUTPUT)/sim/$(IOS_BINDING_NAME) -headers $(IOS_BINDING_OUTPUT)/headers \
-library $(IOS_BINDING_OUTPUT)/catalyst/$(IOS_BINDING_NAME) -headers $(IOS_BINDING_OUTPUT)/headers \
-output $(IOS_BINDING_OUTPUT)/Openpgp.xcframework
rm -rf $(IOS_BINDING_OUTPUT)/arm64 $(IOS_BINDING_OUTPUT)/sim $(IOS_BINDING_OUTPUT)/catalyst $(IOS_BINDING_OUTPUT)/headers
binding_ios_all_iphone: binding_ios_arm64
binding_ios_all_sim: binding_ios_x86_64_sim binding_ios_arm64_sim
mkdir -p $(IOS_BINDING_OUTPUT)/sim
lipo $(IOS_BINDING_OUTPUT)/x86_64_sim/$(IOS_BINDING_NAME) $(IOS_BINDING_OUTPUT)/arm64_sim/$(IOS_BINDING_NAME) -create -output $(IOS_BINDING_OUTPUT)/sim/$(IOS_BINDING_NAME)
rm -rf $(IOS_BINDING_OUTPUT)/x86_64_sim $(IOS_BINDING_OUTPUT)/arm64_sim
binding_ios_all_catalyst: binding_ios_x86_64_catalyst binding_ios_arm64_catalyst
mkdir -p $(IOS_BINDING_OUTPUT)/catalyst
lipo $(IOS_BINDING_OUTPUT)/x86_64_catalyst/$(IOS_BINDING_NAME) $(IOS_BINDING_OUTPUT)/arm64_catalyst/$(IOS_BINDING_NAME) -create -output $(IOS_BINDING_OUTPUT)/catalyst/$(IOS_BINDING_NAME)
rm -rf $(IOS_BINDING_OUTPUT)/x86_64_catalyst $(IOS_BINDING_OUTPUT)/arm64_catalyst
binding_ios_x86_64_catalyst:
CGO_LDFLAGS="-target x86_64-apple-ios14-macabi" \
BINDING_FILE=$(IOS_OUTPUT)/x86_64_catalyst/$(IOS_BINDING_NAME) BUILD_MODE="c-archive" \
SDK=macosx CC=$(PWD)/clangwrap.sh \
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 \
make binding
binding_ios_arm64_catalyst:
CGO_LDFLAGS="-target arm64-apple-ios14-macabi -fembed-bitcode" \
BINDING_FILE=$(IOS_OUTPUT)/arm64_catalyst/$(IOS_BINDING_NAME) BUILD_MODE="c-archive" \
SDK=macosx CC=$(PWD)/clangwrap.sh \
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 \
make binding
binding_ios_x86_64_sim:
CGO_LDFLAGS="-target x86_64-apple-ios10-simulator -fembed-bitcode" \
BINDING_FILE=$(IOS_OUTPUT)/x86_64_sim/$(IOS_BINDING_NAME) BUILD_MODE="c-archive" \
SDK=iphonesimulator CC=$(PWD)/clangwrap.sh \
GOOS=ios GOARCH=amd64 CGO_ENABLED=1 \
make binding
binding_ios_arm64_sim:
CGO_LDFLAGS="-target arm64-apple-ios10-simulator -fembed-bitcode" \
BINDING_FILE=$(IOS_OUTPUT)/arm64_sim/$(IOS_BINDING_NAME) BUILD_MODE="c-archive" \
SDK=iphonesimulator CC=$(PWD)/clangwrap.sh \
GOOS=ios GOARCH=arm64 CGO_ENABLED=1 \
make binding
binding_ios_arm64:
CGO_LDFLAGS="-target arm64-apple-ios10 -fembed-bitcode" \
BINDING_FILE=$(IOS_OUTPUT)/arm64/$(IOS_BINDING_NAME) BUILD_MODE="c-archive" \
SDK=iphoneos CC=$(PWD)/clangwrap.sh \
GOOS=ios GOARCH=arm64 CGO_ENABLED=1 \
make binding
binding_ios_armv7:
BINDING_FILE=$(IOS_OUTPUT)/armv7/$(IOS_BINDING_NAME) BUILD_MODE="c-archive" \
SDK=iphoneos CC=$(PWD)/clangwrap.sh CGO_CFLAGS="-fembed-bitcode" \
GOOS=darwin GOARCH=arm CGO_ENABLED=1 BINDING_ARGS="-tags ios" \
make binding