fix(build): 在运行时解析编解码依赖源码路径

hwcodec 与 libyuv 构建脚本在运行时读取 CARGO_MANIFEST_DIR,避免复用或迁移构建产物后继续引用旧源码目录。
This commit is contained in:
mofeng-git
2026-09-05 14:10:53 +08:00
parent dbe5672df4
commit d67a3ab7f8
2 changed files with 9 additions and 7 deletions

View File

@@ -5,7 +5,8 @@ use std::{
};
fn main() {
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
// Read the current source path when running, since build artifacts may move.
let manifest_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let cpp_dir = manifest_dir.join("cpp");
println!("cargo:rerun-if-changed=cpp/yuv_ffi.h");