Skip to content

Commit

Permalink
xcframeworkにmodulemapを追加 (#579)
Browse files Browse the repository at this point in the history
Co-authored-by: Hiroshiba <[email protected]>
  • Loading branch information
fuziki and Hiroshiba authored Aug 23, 2023
1 parent 27aa840 commit e571d70
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ jobs:
needs: build_and_deploy
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Set ASSET_NAME env var
run: echo "ASSET_NAME=voicevox_core-ios-xcframework-cpu-${{ env.VERSION }}" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v2
Expand All @@ -362,11 +363,18 @@ jobs:
- name: Create XCFramework
run: |
mkdir -p "artifact/${{ env.ASSET_NAME }}"
# 必要なファイルだけコピー
mkdir -p "Headers-sim"
cp -v artifact/voicevox_core-x86_64-apple-ios/voicevox_core.h "Headers-sim"
cp -v crates/voicevox_core_c_api/xcframework/Headers/module.modulemap "Headers-sim"
mkdir -p "Headers-aarch64"
cp -v artifact/voicevox_core-aarch64-apple-ios/voicevox_core.h "Headers-aarch64"
cp -v crates/voicevox_core_c_api/xcframework/Headers/module.modulemap "Headers-aarch64"
xcodebuild -create-xcframework \
-library "artifact/voicevox_core-sim/libvoicevox_core.dylib" \
-headers "artifact/voicevox_core-x86_64-apple-ios/voicevox_core.h" \
-headers "Headers-sim" \
-library "artifact/voicevox_core-aarch64-apple-ios/libvoicevox_core.dylib" \
-headers "artifact/voicevox_core-aarch64-apple-ios/voicevox_core.h" \
-headers "Headers-aarch64" \
-output "artifact/${{ env.ASSET_NAME }}/voicevox_core.xcframework"
- name: Archive artifact
run: |
Expand Down
5 changes: 5 additions & 0 deletions crates/voicevox_core_c_api/xcframework/Headers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# xcframeworkのHeadersに追加されるファイル
## module.modulemap

C言語やObjective-Cのモジュールが、ライブラリ内の公開インターフェースを表現するために使用されます。
これにより、外部のコードがこのライブラリを利用する際に、必要なインクルードや参照を容易にすることができます。
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module VoicevoxCore {
header "voicevox_core.h"
export *
}

0 comments on commit e571d70

Please sign in to comment.