Skip to content

Commit

Permalink
Update build_xcframework.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
feuvan authored Sep 9, 2024
1 parent db7f9bf commit de42012
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions .github/workflows/build_xcframework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,26 @@ jobs:
- name: Create fat libraries using lipo
run: |
mkdir -p "${OUTPUT_DIR}/fat"
# For macOS
lipo -create \
"${OUTPUT_DIR}/build-macosx-arm64/macosx-arm64-MacOSX/lib/libopencore-amrnb.a" \
"${OUTPUT_DIR}/build-macosx-x86_64/macosx-x86_64-MacOSX/lib/libopencore-amrnb.a" \
-output "${OUTPUT_DIR}/fat/libopencore-amrnb-macos.a"
lipo -create \
"${OUTPUT_DIR}/build-macosx-arm64/macosx-arm64-MacOSX/lib/libopencore-amrwb.a" \
"${OUTPUT_DIR}/build-macosx-x86_64/macosx-x86_64-MacOSX/lib/libopencore-amrwb.a" \
-output "${OUTPUT_DIR}/fat/libopencore-amrwb-macos.a"
# For iOS device
cp "${OUTPUT_DIR}/build-iphoneos-arm64/iphoneos-arm64-iPhoneOS/lib/libopencore-amrnb.a" "${OUTPUT_DIR}/fat/libopencore-amrnb-iphoneos.a"
cp "${OUTPUT_DIR}/build-iphoneos-arm64/iphoneos-arm64-iPhoneOS/lib/libopencore-amrwb.a" "${OUTPUT_DIR}/fat/libopencore-amrwb-iphoneos.a"
# For iOS simulator
lipo -create \
"${OUTPUT_DIR}/build-iphonesimulator-x86_64/iphonesimulator-x86_64-iPhoneSimulator/lib/libopencore-amrnb.a" \
"${OUTPUT_DIR}/build-iphonesimulator-arm64/iphonesimulator-arm64-iPhoneSimulator/lib/libopencore-amrnb.a" \
-output "${OUTPUT_DIR}/fat/libopencore-amrnb-iphonesimulator.a"
lipo -create \
"${OUTPUT_DIR}/build-iphonesimulator-x86_64/iphonesimulator-x86_64-iPhoneSimulator/lib/libopencore-amrwb.a" \
"${OUTPUT_DIR}/build-iphonesimulator-arm64/iphonesimulator-arm64-iPhoneSimulator/lib/libopencore-amrwb.a" \
-output "${OUTPUT_DIR}/fat/libopencore-amrwb-iphonesimulator.a"
declare -A ARCHITECTURES=(
["macos"]="arm64 x86_64"
["iphoneos"]="arm64"
["iphonesimulator"]="x86_64 arm64"
)
LIBRARIES=("libopencore-amrnb" "libopencore-amrwb")
for lib in "${LIBRARIES[@]}"; do
# For macOS
lipo -create $(for arch in ${ARCHITECTURES["macos"]}; do echo "${OUTPUT_DIR}/build-macosx-${arch}/macosx-${arch}-MacOSX/lib/${lib}.a"; done) \
-output "${OUTPUT_DIR}/fat/${lib}-macos.a"
# For iOS device
cp "${OUTPUT_DIR}/build-iphoneos-arm64/iphoneos-arm64-iPhoneOS/lib/${lib}.a" "${OUTPUT_DIR}/fat/${lib}-iphoneos.a"
# For iOS simulator
lipo -create $(for arch in ${ARCHITECTURES["iphonesimulator"]}; do echo "${OUTPUT_DIR}/build-iphonesimulator-${arch}/iphonesimulator-${arch}-iPhoneSimulator/lib/${lib}.a"; done) \
-output "${OUTPUT_DIR}/fat/${lib}-iphonesimulator.a"
done
- name: Create XCFrameworks
run: |
Expand Down

0 comments on commit de42012

Please sign in to comment.