Skip to content

Commit 323b2ba

Browse files
committed
fix: build.rsの出力パス修正
1 parent 6ed4bf1 commit 323b2ba

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

crates/cevio-ai-sys/build.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1+
use std::{env, path::PathBuf};
2+
13
fn main() {
24
println!("cargo:rerun-if-changed=.windows/winmd/CeVIO.Talk.RemoteService2.winmd");
35
println!("cargo:rerun-if-changed=build.rs");
4-
println!("cargo:rustc-if-changed=src/bindings.rs");
6+
7+
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs");
58

69
let warnings = windows_bindgen::bindgen([
710
"--in",
811
"default",
912
".windows/winmd/CeVIO.Talk.RemoteService2.winmd",
1013
"--out",
11-
"src/bindings.rs",
14+
out_path.to_str().unwrap(),
1215
"--filter",
1316
"CeVIO.Talk.RemoteService2",
1417
"--reference",
1518
"windows,skip-root,Windows",
19+
"--no-allow"
1620
]);
1721

1822
warnings.iter().for_each(|warning| {

crates/cevio-ai-sys/src/lib.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
//! このクレートが公開する COM インターフェースは本質的に unsafe です。`unsafe_send` フィーチャが有効な場合、
1717
//! 特定のインターフェースが `Mutex` でラップされることを前提として `Send` が実装されます。
1818
19+
mod bindings {
20+
#![allow(
21+
non_snake_case,
22+
non_upper_case_globals,
23+
non_camel_case_types,
24+
dead_code,
25+
clippy::all
26+
)]
27+
28+
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
29+
}
30+
1931
pub use bindings::CeVIO::Talk::RemoteService2::{
2032
IPhonemeData2, IPhonemeDataArray2, IServiceControl2, IServiceControl2V40,
2133
IServiceControl2V40Part, ISpeakingState2, IStringArray2, ITalker2, ITalker2V40,
@@ -33,5 +45,3 @@ unsafe impl Send for IServiceControl2V40 {}
3345

3446
#[cfg(feature = "unsafe_send")]
3547
unsafe impl Send for ITalker2V40 {}
36-
37-
mod bindings;

0 commit comments

Comments
 (0)