We do, in fact, seem to need 0.9.0-preview.0.

This resolves the previously-noticed bindgen issue, where gdnative and speech-dispatcher require conflicting versions.

The early iOS build failures appear due to attempting to link AppKit on iOS, where it doesn't exist. This seemed to work on Rust 1.45, but now fails on 1.46.

Hopefully, this plus tts-rs changes get this building under iOS again.
This commit is contained in:
Nolan Darilek 2020-09-02 17:49:37 -05:00
parent 2222e3eda7
commit ddfc262278
2 changed files with 7 additions and 8 deletions

View File

@ -9,7 +9,7 @@ crate-type = ["staticlib", "cdylib"]
[dependencies]
env_logger = "0.7"
gdnative = "0.8"
gdnative = "0.9.0-preview.0"
tts = "0.6"
[target.'cfg(windows)'.dependencies]

View File

@ -1,5 +1,4 @@
use gdnative::init::*;
use gdnative::*;
use gdnative::prelude::*;
use tts::{Features, TTS as Tts};
#[derive(NativeClass)]
@ -9,7 +8,7 @@ struct TTS(Tts);
#[methods]
impl TTS {
fn _init(_owner: gdnative::Node) -> Self {
fn new(_owner: &Node) -> Self {
let tts = Tts::default().unwrap();
Self(tts)
}
@ -122,18 +121,18 @@ impl TTS {
}
#[export]
fn speak(&mut self, _owner: Node, message: GodotString, interrupt: bool) {
fn speak(&mut self, _owner: &Node, message: GodotString, interrupt: bool) {
let message = message.to_string();
self.0.speak(message, interrupt).unwrap();
}
#[export]
fn stop(&mut self, _owner: Node) {
fn stop(&mut self, _owner: &Node) {
self.0.stop().unwrap();
}
#[export]
fn is_rate_supported(&mut self, _owner: Node) -> bool {
fn is_rate_supported(&mut self, _owner: &Node) -> bool {
let Features {
rate: rate_supported,
..
@ -142,7 +141,7 @@ impl TTS {
}
}
fn init(handle: gdnative::init::InitHandle) {
fn init(handle: InitHandle) {
env_logger::init();
handle.add_class::<TTS>();
}