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

pull/11/head
Nolan Darilek 2 years ago
parent 00a16c5dd5
commit c21d4a6a38
  1. 4
      Cargo.toml
  2. 10
      build.rs
  3. 2
      src/backends/winrt/bindings.rs
  4. 13
      src/backends/winrt/mod.rs
  5. 13
      winrt_bindings/Cargo.toml
  6. 9
      winrt_bindings/build.rs

@ -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"

@ -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()

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

@ -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};

@ -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"

@ -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,
);
}
Loading…
Cancel
Save