Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions openless-all/app/src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@ fn main() {
#[cfg(target_os = "macos")]
build_qwen_asr_macos();

if target_is_windows_msvc() {
embed_common_controls_v6_manifest_for_tests();
}

tauri_build::build();
}

fn target_is_windows_msvc() -> bool {
std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows")
&& std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc")
}

fn embed_common_controls_v6_manifest_for_tests() {
// Unit test harness 不走 Tauri app manifest;没有 Common Controls v6 时会在
// comctl32!TaskDialogIndirect 的 loader 阶段直接 0xc0000139。
let manifest = std::path::Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap())
.join("windows")
.join("common-controls-v6.manifest");
println!("cargo:rerun-if-changed={}", manifest.display());
println!("cargo:rustc-link-arg=/MANIFEST:EMBED");
println!("cargo:rustc-link-arg=/MANIFESTINPUT:{}", manifest.display());
}

/// 编译 vendored Open-Less/qwen-asr 的 C 源(仅 macOS)。
///
/// 上游 Makefile `make blas` 等价配置:BLAS 加速通过 Accelerate framework,
Expand Down
Loading
Loading