-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS向けのビルドを作る #10
Comments
Issue 作成ありがとうございます! 多くのメッセージが表示されていますが、ほとんどは無視できそうでした。最後の方の bindgen のエラー(以下に記載)が原因のようでした。clang が cstdio を見つけられない、というもののようです。
私の環境でも再現しました。Apple Silicon Mac でも Intel Mac でも同じところで躓くようです(Intel Mac でも aarch64-apple-ios-sim 向けには bindings.rs の生成に成功し、 x86_64-apple-ios 向けには失敗する)。 色々試したところ、M1 MacBook Air では オリジナル:
書き換え後: let target = env::var("TARGET").unwrap();
let mut clang_args = vec![format!("-I{}", include_dir.display())];
if target == "x86_64-apple-ios" {
clang_args.push(format!(
"-I{}/usr/include/c++/v1",
String::from_utf8_lossy(
&Command::new("xcrun")
.args(["--sdk", "iphonesimulator", "--show-sdk-path"])
.output()
.expect("failed to run xcrun command")
.stdout
)
.trim()
));
} |
検証した結果、Intel Mac でもこの対応策が有効であることを確認しました。 |
めちゃくちゃ素人考えなのですが、 |
Rust の Platform Support の一覧を見ていただけるとわかると思うのですが、 一方、aarch64 の方のシミュレータ向けに |
解決策があっという間に見つかって驚きです! ご提案いただいた修正方法ですが、 fn generate_bindings(
allow_dir: impl AsRef<Path>,
include_dirs: impl Iterator<Item = impl AsRef<Path>>,
) {
let include_dir = allow_dir.as_ref();
let clang_arg = &[format!("-I{}", include_dir.display())];
let mut clang_args: Vec<String> = include_dirs
.map(|dir| format!("-I{}", dir.as_ref().display()))
.collect();
clang_args.extend(clang_arg.iter().cloned);
println!("cargo:rerun-if-changed=wrapper.hpp");
// 以下略 //
let mut include_dirs: Vec<PathBuf> = Vec::new(); 以上の点はコミットしてありますので、よければ実際にcloneしてお試しいただけると幸いです。 |
より良い実装方針だと思いました……! 後で確認してみます。続きのやり取りは #9 で行いたいと思います |
#9 で対応されたのでCloseします。 |
VOICEVOX CoreはOpen JTalkに依存しています。
このリポジトリでは、VOICEVOX Coreが利用するOpen JTalkのビルドとRustのバインディングを提供しています。
しかし、iOS向けのビルドは提供されていません。
そこで、open_jtalk-rsをiOSに対応したいと思います。
関連PR
#9
すでにarm64向け実機
arm64-apple-ios
とarm64(Apple Silicon)向けシミュレータarm64-apple-ios-sim
のビルドが可能であることが確認されています。問題
x86_64(Intel Mac)向けシミュレータ
x86_64-apple-ios
のビルドができていません。ビルドができないコミットは 7b4d9e4 です。
エラーログ
実行環境
MacBook Air M2 2022
rustc 1.68.2 (9eb3afe9e 2023-03-27)
cargo 1.68.2 (6feb7c9cf 2023-03-26)
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
cmake version 3.26.1
The text was updated successfully, but these errors were encountered: