Skip to content

Commit

Permalink
This should now work
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes committed Jun 1, 2024
1 parent 6faed8a commit adc00ad
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/mavsdk_server/tools/package_mavsdk_server_framework.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR=${SCRIPT_DIR}/../../../build

IOS_BACKEND_DIR=${BUILD_DIR}/ios/src/mavsdk_server/src
IOS_SIM_X64_BACKEND_DIR=${BUILD_DIR}/ios_simulator_x64/src/mavsdk_server/src
IOS_SIM_ARM64_BACKEND_DIR=${BUILD_DIR}/ios_simulator_arm64/src/mavsdk_server/src
IOS_SIM_FAT_BACKEND_DIR=${BUILD_DIR}/ios_simulator/src/mavsdk_server/src

MACOS_X64_BACKEND_DIR=${BUILD_DIR}/macos_x64/src/mavsdk_server/src
MACOS_ARM64_BACKEND_DIR=${BUILD_DIR}/macos_arm64/src/mavsdk_server/src
MACOS_FAT_BACKEND_DIR=${BUILD_DIR}/macos/src/mavsdk_server/src
Expand All @@ -17,13 +19,10 @@ if [ -d ${BUILD_DIR}/mavsdk_server.xcframework ]; then
exit 1
fi

#echo "Fixing Modules in macOS framework"
#ln -sf Versions/Current/Modules ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework

echo "Running lipo for simulator"
mkdir -p ${IOS_SIM_FAT_BACKEND_DIR}
cp -a ${IOS_SIM_X64_BACKEND_DIR}/mavsdk_server.framework ${IOS_SIM_FAT_BACKEND_DIR}

echo "Running lipo for simulator"
xcrun lipo -create -output ${IOS_SIM_FAT_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server \
${IOS_SIM_X64_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server \
${IOS_SIM_ARM64_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server
Expand All @@ -33,11 +32,11 @@ tree ${IOS_SIM_FAT_BACKEND_DIR}/mavsdk_server.framework
echo "Running codesign for simulator"
xcrun codesign --verbose --sign - ${IOS_SIM_FAT_BACKEND_DIR}/mavsdk_server.framework

mkdir -p ${MACOS_FAT_BACKEND_DIR}
cp -a ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework ${MACOS_FAT_BACKEND_DIR}


echo "Running lipo for macos"
mkdir -p ${MACOS_FAT_BACKEND_DIR}
cp -a ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework ${MACOS_FAT_BACKEND_DIR}
xcrun lipo -create -output ${MACOS_FAT_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server \
${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server \
${MACOS_ARM64_BACKEND_DIR}/mavsdk_server.framework/mavsdk_server
Expand All @@ -54,14 +53,12 @@ xcodebuild -create-xcframework \
-framework ${MACOS_FAT_BACKEND_DIR}/mavsdk_server.framework \
-output ${BUILD_DIR}/mavsdk_server.xcframework

tree ${BUILD_DIR}/mavsdk_server.xcframework

echo "Setting executable bit"
chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/ios-arm64/mavsdk_server.framework/mavsdk_server
chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/ios-x86_64-simulator/mavsdk_server.framework/mavsdk_server
chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/ios-arm64-simulator/mavsdk_server.framework/mavsdk_server
chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/macos-x86_64/mavsdk_server.framework/mavsdk_server
chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/macos-arm64/mavsdk_server.framework/mavsdk_server
chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/ios-arm64_x86_64-simulator/mavsdk_server.framework/mavsdk_server
chmod +x ${BUILD_DIR}/mavsdk_server.xcframework/macos-arm64_x86_64/mavsdk_server.framework/mavsdk_server

echo "Creating zip archive"
cd ${BUILD_DIR}
zip -9 -y -r mavsdk_server.xcframework.zip mavsdk_server.xcframework

Expand Down

0 comments on commit adc00ad

Please sign in to comment.