diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index feae43ba7..bf3e88b4e 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -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 @@ -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: | diff --git a/crates/voicevox_core_c_api/xcframework/Headers/README.md b/crates/voicevox_core_c_api/xcframework/Headers/README.md new file mode 100644 index 000000000..cd3b3f6a0 --- /dev/null +++ b/crates/voicevox_core_c_api/xcframework/Headers/README.md @@ -0,0 +1,5 @@ +# xcframeworkのHeadersに追加されるファイル +## module.modulemap + +C言語やObjective-Cのモジュールが、ライブラリ内の公開インターフェースを表現するために使用されます。 +これにより、外部のコードがこのライブラリを利用する際に、必要なインクルードや参照を容易にすることができます。 diff --git a/crates/voicevox_core_c_api/xcframework/Headers/module.modulemap b/crates/voicevox_core_c_api/xcframework/Headers/module.modulemap new file mode 100644 index 000000000..1b1680b2d --- /dev/null +++ b/crates/voicevox_core_c_api/xcframework/Headers/module.modulemap @@ -0,0 +1,4 @@ +module VoicevoxCore { + header "voicevox_core.h" + export * +}