1
0
mirror of https://github.com/ndarilek/tts-rs.git synced 2024-11-17 06:29:37 +00:00

Eliminate separate winrt_bindings crate since it no longer seems necessary for fast builds.

This commit is contained in:
Nolan Darilek 2021-03-11 13:21:41 -06:00
parent 00a16c5dd5
commit c21d4a6a38
6 changed files with 22 additions and 29 deletions

View File

@ -23,7 +23,9 @@ env_logger = "0.8"
[target.'cfg(windows)'.dependencies]
tolk = { version = "0.3", optional = true }
windows = "0.4"
tts_winrt_bindings = { version = "0.3", path="winrt_bindings" }
[target.'cfg(windows)'.build-dependencies]
windows = "0.4"
[target.'cfg(target_os = "linux")'.dependencies]
speech-dispatcher = "0.7"

View File

@ -1,5 +1,13 @@
fn main() {
if std::env::var("TARGET").unwrap().contains("-apple") {
if std::env::var("TARGET").unwrap().contains("windows") {
windows::build!(
windows::foundation::{EventRegistrationToken, IAsyncOperation, TypedEventHandler},
windows::media::core::MediaSource,
windows::media::playback::{MediaPlaybackSession, MediaPlaybackState, MediaPlayer, MediaPlayerAudioCategory},
windows::media::speech_synthesis::{SpeechSynthesisStream, SpeechSynthesizer, SpeechSynthesizerOptions},
windows::storage::streams::IRandomAccessStream,
);
} else if std::env::var("TARGET").unwrap().contains("-apple") {
println!("cargo:rustc-link-lib=framework=AVFoundation");
if !std::env::var("CARGO_CFG_TARGET_OS")
.unwrap()

View File

@ -1 +1 @@
::windows::include_bindings!();
::windows::include_bindings!();

View File

@ -5,11 +5,16 @@ use std::sync::Mutex;
use lazy_static::lazy_static;
use log::{info, trace};
use tts_winrt_bindings::windows::media::playback::{
MediaPlaybackState, MediaPlayer, MediaPlayerAudioCategory,
mod bindings;
use bindings::windows::{
foundation::TypedEventHandler,
media::{
core::MediaSource,
playback::{MediaPlaybackState, MediaPlayer, MediaPlayerAudioCategory},
speech_synthesis::SpeechSynthesizer,
},
};
use tts_winrt_bindings::windows::media::speech_synthesis::SpeechSynthesizer;
use tts_winrt_bindings::windows::{foundation::TypedEventHandler, media::core::MediaSource};
use crate::{Backend, BackendId, Error, Features, UtteranceId, CALLBACKS};

View File

@ -1,13 +0,0 @@
[package]
name = "tts_winrt_bindings"
version = "0.3.0"
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
description = "Internal crate used by `tts`"
license = "MIT"
edition = "2018"
[dependencies]
windows = "0.4"
[build-dependencies]
windows = "0.4"

View File

@ -1,9 +0,0 @@
fn main() {
windows::build!(
windows::foundation::{EventRegistrationToken, IAsyncOperation, TypedEventHandler},
windows::media::core::MediaSource,
windows::media::playback::{MediaPlaybackSession, MediaPlaybackState, MediaPlayer, MediaPlayerAudioCategory},
windows::media::speech_synthesis::{SpeechSynthesisStream, SpeechSynthesizer, SpeechSynthesizerOptions},
windows::storage::streams::IRandomAccessStream,
);
}