diff --git a/plugins/agc-godot-editor/native/godot-editor-bridge/src/files.rs b/plugins/agc-godot-editor/native/godot-editor-bridge/src/files.rs index 0cc8e5a53..2a4b98807 100644 --- a/plugins/agc-godot-editor/native/godot-editor-bridge/src/files.rs +++ b/plugins/agc-godot-editor/native/godot-editor-bridge/src/files.rs @@ -343,6 +343,11 @@ pub fn verify_dll_hash(path: &Path, expected: &str) -> Result<(), String> { } /// Godot 4.7 的 Windows 编辑器 loader 只允许在同目录派生 ~ 前缀副本。 +/// +/// 库内只有 Windows 编辑器探测路径会调用它(`platform.rs` 的 `#[cfg(windows)]` 分支); +/// 另由跨平台单测 `official_loader_copy_requires_exact_parent_and_trusted_bytes` 直接覆盖, +/// 因此非 Windows 的库构建不编译它,避免 Linux 目标把它判成 dead code。 +#[cfg(any(windows, test))] pub fn verified_module_path(actual: &Path, descriptor: &Descriptor) -> Result { let key = |p: &Path| { p.to_string_lossy() diff --git a/plugins/agc-unity-editor/native/unity-editor-bridge/tests/protocol.rs b/plugins/agc-unity-editor/native/unity-editor-bridge/tests/protocol.rs index fa377d786..c01b29c10 100644 --- a/plugins/agc-unity-editor/native/unity-editor-bridge/tests/protocol.rs +++ b/plugins/agc-unity-editor/native/unity-editor-bridge/tests/protocol.rs @@ -1,7 +1,9 @@ +#[cfg(all(windows, target_arch = "x86_64"))] use editor_adapter_api::EditorAdapter; use serde_json::json; use std::path::PathBuf; use std::time::{Duration, Instant}; +#[cfg(all(windows, target_arch = "x86_64"))] use unity_editor_bridge::{ configure_helper_candidates, disconnect_unity_editor, execute_unity_editor_code_for_project, UnityEditorAdapter, @@ -25,6 +27,7 @@ fn fixture() -> (tempfile::TempDir, PathBuf) { (directory, executable) } +#[cfg(all(windows, target_arch = "x86_64"))] fn project() -> tempfile::TempDir { let directory = tempfile::tempdir().unwrap(); for path in ["Assets", "Packages", "ProjectSettings"] {