Skip to content

Commit

Permalink
Use lipo to merge macos-x64 and macos-arm64
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Oes <[email protected]>
  • Loading branch information
julianoes committed Apr 30, 2024
1 parent b97b6b7 commit 20dc3f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mavsdk_server/tools/package_mavsdk_server_framework.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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
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

if [ -d ${BUILD_DIR}/mavsdk_server.xcframework ]; then
echo "${BUILD_DIR}/mavsdk_server.xcframework already exists! Aborting..."
Expand All @@ -21,13 +22,18 @@ ln -sf Versions/Current/Modules ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework
# REMOVEME again
tree .

xcrun lipo -create -output ${MACOS_FAT_BACKEND_DIR}/mavsdk_server.framework \
${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework \
${MACOS_ARM64_BACKEND_DIR}/mavsdk_server.framework

xcrun codesign --sign - ${MACOS_FAT_BACKEND_DIR}/mavsdk_server.framework

echo "Creating xcframework..."
xcodebuild -create-xcframework \
-framework ${IOS_BACKEND_DIR}/mavsdk_server.framework \
-framework ${IOS_SIM_X64_BACKEND_DIR}/mavsdk_server.framework \
-framework ${IOS_SIM_ARM64_BACKEND_DIR}/mavsdk_server.framework \
-framework ${MACOS_X64_BACKEND_DIR}/mavsdk_server.framework \
-framework ${MACOS_ARM64_BACKEND_DIR}/mavsdk_server.framework \
-framework ${MACOS_FAT_BACKEND_DIR}/mavsdk_server.framework \
-output ${BUILD_DIR}/mavsdk_server.xcframework

# REMOVEME again
Expand Down

0 comments on commit 20dc3f0

Please sign in to comment.