Skip to content

Commit

Permalink
C APIのビルドに関するドキュメントのヘッダファイル周りを更新
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Jul 1, 2024
1 parent dc587ae commit e99b293
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,15 @@ model フォルダにある onnx モデルはダミーのため、ノイズの
cargo build --release -p voicevox_core_c_api --features load-onnxruntime
```

DLL 用のヘッダファイルは [crates/voicevox_core_c_api/include/voicevox_core.h](https://github.com/VOICEVOX/voicevox_core/tree/main/crates/voicevox_core_c_api/include/voicevox_core.h) にあります。
DLL 用のヘッダファイルの雛形は [crates/voicevox_core_c_api/include/voicevox_core.h](https://github.com/VOICEVOX/voicevox_core/tree/main/crates/voicevox_core_c_api/include/voicevox_core.h) にあります。
詳しくは[feature-options.md](./docs/feature-options.md)を参照してください。

```bash
# ヘッダファイルを加工し、マクロ`VOICEVOX_LOAD_ONNXRUNTIME`を宣言
sed 's:^//\(#define VOICEVOX_LOAD_ONNXRUNTIME\)$:\1:' \
crates/voicevox_core_c_api/include/voicevox_core.h \
> ./voicevox_core.h
```

## コアライブラリのテスト

Expand Down
6 changes: 6 additions & 0 deletions docs/feature-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ Rust API(`voicevox_core`)およびC API(`voicevox_core_c_api`)におい

```console
cargo build --release -p voicevox_core_c_api --features load-onnxruntime
sed 's:^//\(#define VOICEVOX_LOAD_ONNXRUNTIME\)$:\1:' \
crates/voicevox_core_c_api/include/voicevox_core.h \
> ./voicevox_core.h
```

```console
cargo build --release -p voicevox_core_c_api --features link-onnxruntime
sed 's:^//\(#define VOICEVOX_LINK_ONNXRUNTIME\)$:\1:' \
crates/voicevox_core_c_api/include/voicevox_core.h \
> ./voicevox_core.h
```

C APIのリリースでは`dlopen`の利用が厳しいiOSでのみ`link-onnxruntime`で、その他は`load-onnxruntime`
Expand Down

0 comments on commit e99b293

Please sign in to comment.