final build network extension
This commit is contained in:
parent
b6601d051a
commit
f7aa82331e
1 changed files with 12 additions and 4 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
XCODEBUILD="/usr/bin/xcodebuild"
|
XCODEBUILD="/usr/bin/xcodebuild"
|
||||||
WORKINGDIR=`pwd`
|
WORKINGDIR=`pwd`
|
||||||
PATCH="/usr/bin/patch"
|
PATCH="/usr/bin/patch"
|
||||||
|
|
||||||
echo "Building OpenVPNAdapter for macOS ..."
|
echo "Building OpenVPNAdapter for macOS ..."
|
||||||
|
|
||||||
# Copy the Project.xcconfig settings to amnezia.xcconfig
|
# Copy the Project.xcconfig settings to amnezia.xcconfig
|
||||||
cat $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/Project.xcconfig > $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/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
|
# Append macOS-specific build directory configurations to amnezia.xcconfig
|
||||||
cat << EOF >> $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig
|
cat << EOF >> $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig
|
||||||
|
|
@ -14,12 +16,18 @@ CONFIGURATION_BUILD_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos
|
||||||
BUILT_PRODUCTS_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos
|
BUILT_PRODUCTS_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Add LDFLAGS for macOS, exclude UIKit which is for iOS only
|
||||||
|
echo "OTHER_LDFLAGS = -framework Cocoa" >> $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig
|
||||||
|
|
||||||
# Fetch the current macOS SDK version dynamically
|
# Fetch the current macOS SDK version dynamically
|
||||||
MACOSX_SDK=macosx15.0
|
MACOSX_SDK=$(xcrun --sdk macosx --show-sdk-path | sed -E 's/.*MacOSX([0-9]+\.[0-9]+)\.sdk/\1/')
|
||||||
|
|
||||||
|
echo "Using macOS SDK version: $MACOSX_SDK"
|
||||||
|
|
||||||
cd 3rd/OpenVPNAdapter
|
cd 3rd/OpenVPNAdapter
|
||||||
|
|
||||||
# Build for macOS using the correct SDK and destination
|
# Build for macOS using the correct SDK and destination
|
||||||
if $XCODEBUILD -scheme OpenVPNAdapter -configuration Release -xcconfig Configuration/amnezia.xcconfig -sdk $MACOSX_SDK -destination 'generic/platform=macOS' -project OpenVPNAdapter.xcodeproj ; then
|
if $XCODEBUILD -scheme OpenVPNAdapter -configuration Release -xcconfig Configuration/amnezia.xcconfig -sdk macosx$MACOSX_SDK -destination 'generic/platform=macOS' -project OpenVPNAdapter.xcodeproj ; then
|
||||||
echo "OpenVPNAdapter built successfully for macOS"
|
echo "OpenVPNAdapter built successfully for macOS"
|
||||||
else
|
else
|
||||||
echo "OpenVPNAdapter macOS build failed ..."
|
echo "OpenVPNAdapter macOS build failed ..."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue