-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build of iOS simulator libraries. #58
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,45 @@ | ||
IOS_OUT=ios | ||
|
||
IOS_SDK_PATH=$(shell xcrun --sdk iphoneos --show-sdk-path) | ||
IOS_SIM_SDK_PATH=$(shell xcrun --sdk iphonesimulator --show-sdk-path) | ||
|
||
ios-arm64: | ||
GOOS=ios \ | ||
GOARCH=arm64 \ | ||
CLANGARCH=arm64 \ | ||
CGO_ENABLED=1 \ | ||
SDK=iphoneos \ | ||
TARGET=arm64-apple-ios16 \ | ||
SDK=iphoneos \ | ||
SDK_PATH=$(IOS_SDK_PATH) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this variable for? If I understand what is going on, it supposed to be redefined in clangwrap.sh. I don't see how this value used. |
||
CGO_LDFLAGS="-target arm64-apple-ios16 -syslibroot \"${IOS_SDK_PATH}\"" \ | ||
CC=$(PWD)/clangwrap.sh \ | ||
CGO_CFLAGS="-fembed-bitcode" \ | ||
go build -tags no_jwz -buildmode=c-archive -o $(IOS_OUT)/libpolygonid-ios.a ./cmd/polygonid | ||
cp $(IOS_OUT)/libpolygonid-ios.h $(IOS_OUT)/libpolygonid.h | ||
|
||
|
||
ios-simulator-x86_64: | ||
GOOS=darwin \ | ||
GOOS=ios \ | ||
GOARCH=amd64 \ | ||
CLANGARCH=x86_64 \ | ||
CGO_ENABLED=1 \ | ||
TARGET=x86_64-apple-ios16-simulator \ | ||
SDK=iphonesimulator \ | ||
TARGET=x86-64-apple-ios16-simulator \ | ||
SDK_PATH=$(IOS_SIM_SDK_PATH) \ | ||
CGO_LDFLAGS="-target x86_64-apple-ios16-simulator -syslibroot \"${IOS_SIM_SDK_PATH}\"" \ | ||
CC=$(PWD)/clangwrap.sh \ | ||
CGO_CFLAGS="-fembed-bitcode" \ | ||
go build -tags ios,no_jwz -buildmode=c-archive -o $(IOS_OUT)/libpolygonid-ios-simulator-x86_64.a ./cmd/polygonid | ||
cp $(IOS_OUT)/libpolygonid-ios-simulator-x86_64.h $(IOS_OUT)/libpolygonid.h | ||
|
||
ios-simulator-arm64: | ||
GOOS=darwin \ | ||
GOOS=ios \ | ||
GOARCH=arm64 \ | ||
CLANGARCH=arm64 \ | ||
CGO_ENABLED=1 \ | ||
SDK=iphonesimulator \ | ||
TARGET=arm64-apple-ios16-simulator \ | ||
SDK=iphonesimulator \ | ||
SDK_PATH=$(IOS_SIM_SDK_PATH) \ | ||
CGO_LDFLAGS="-target arm64-apple-ios16-simulator -syslibroot \"${IOS_SIM_SDK_PATH}\"" \ | ||
CC=$(PWD)/clangwrap.sh \ | ||
CGO_CFLAGS="-fembed-bitcode" \ | ||
go build -tags ios,no_jwz -buildmode=c-archive -o $(IOS_OUT)/libpolygonid-ios-simulator-arm64.a ./cmd/polygonid | ||
|
@@ -46,11 +57,14 @@ ios-old: ios-arm64 ios-simulator-x86_64 | |
lipo $(IOS_OUT)/libpolygonid-ios.a $(IOS_OUT)/libpolygonid-ios-simulator-x86_64.a -create -output $(IOS_OUT)/libpolygonid.a | ||
cp $(IOS_OUT)/libpolygonid-ios.h $(IOS_OUT)/libpolygonid.h | ||
|
||
ios-device: ios-arm64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't understand the purpose of this target. |
||
cp $(IOS_OUT)/libpolygonid-ios.h $(IOS_OUT)/libpolygonid.h | ||
|
||
ios-simulator: ios-simulator-x86_64 ios-simulator-arm64 | ||
lipo $(IOS_OUT)/libpolygonid-ios-simulator-x86_64.a $(IOS_OUT)/libpolygonid-ios-simulator-arm64.a -create -output $(IOS_OUT)/libpolygonid-ios-simulator.a | ||
cp $(IOS_OUT)/libpolygonid-ios-simulator-arm64.h $(IOS_OUT)/libpolygonid.h | ||
|
||
ios: ios-old ios-arm64 ios-simulator | ||
ios: ios-device ios-simulator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was expected that by calling the |
||
|
||
dylib: | ||
go build -tags no_jwz -buildmode=c-shared -o $(IOS_OUT)/libpolygonid.dylib ./cmd/polygonid | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this variable for?