From 20dc3f081a2715f8429fec96e1e0a5216e1e14fa Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 1 May 2024 08:51:34 +1200 Subject: [PATCH] Use lipo to merge macos-x64 and macos-arm64 Signed-off-by: Julian Oes --- .../tools/package_mavsdk_server_framework.bash | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mavsdk_server/tools/package_mavsdk_server_framework.bash b/src/mavsdk_server/tools/package_mavsdk_server_framework.bash index 8a687c99a..b31c71e81 100644 --- a/src/mavsdk_server/tools/package_mavsdk_server_framework.bash +++ b/src/mavsdk_server/tools/package_mavsdk_server_framework.bash @@ -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..." @@ -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