error UIKet

This commit is contained in:
Macbook 2024-10-05 00:10:05 +07:00 committed by Yaroslav Yashin
parent 5ab4318c23
commit 5e5fb917fe
5 changed files with 30 additions and 6 deletions

View file

@ -0,0 +1,19 @@
#!/bin/sh
# go/clangwrap_macos.sh
# Lấy đường dẫn SDK cho macOS
SDK_PATH=`xcrun --sdk macosx --show-sdk-path`
# Tìm đường dẫn đến `clang` cho macOS
CLANG=`xcrun --sdk macosx --find clang`
# Xác định kiến trúc máy dựa trên biến GOARCH
if [ "$GOARCH" == "amd64" ]; then
CARCH="x86_64"
elif [ "$GOARCH" == "arm64" ]; then
CARCH="arm64"
fi
# Thực thi `clang` với các tùy chọn cụ thể cho macOS
exec $CLANG -arch $CARCH -isysroot $SDK_PATH -mmacosx-version-min=10.15 "$@"

View file

@ -1,9 +1,11 @@
XCODEBUILD="/usr/bin/xcodebuild"
WORKINGDIR=`pwd`
PATCH="/usr/bin/patch"
echo "Building OpenVPNAdapter for macOS ..."
# Copy the Project.xcconfig settings to amnezia.xcconfig
cat $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/Project.xcconfig > $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig
OTHER_LDFLAGS[sdk=iphoneos*] = -framework UIKit
OTHER_LDFLAGS[sdk=macosx*] = -framework Cocoa
# Append macOS-specific build directory configurations to amnezia.xcconfig
cat << EOF >> $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig