添加缺失的依赖

Signed-off-by: wangmeng <wangmeng259@huawei.com>
This commit is contained in:
wangmeng
2025-11-20 17:01:11 +08:00
parent c9ba8c1ee3
commit f88c7d28ae
2 changed files with 2 additions and 22 deletions
+2 -5
View File
@@ -24,10 +24,7 @@ ohos_cargo_crate("lib") {
cargo_pkg_authors = "David Tolnay <dtolnay@gmail.com>"
cargo_pkg_name = "cxx"
cargo_pkg_description = "Safe interop between Rust and C++"
deps = [
"//third_party/rust/crates/cxx/macro:macro_lib(${host_toolchain})",
":cxx_cppdeps"
]
deps = [ "//third_party/rust/crates/cxx/macro:macro_lib(${host_toolchain})" ]
features = [
"alloc",
"std",
@@ -51,7 +48,7 @@ ohos_static_library("cxx_cppdeps") {
"//third_party/rust/crates/cxx/include/cxx.h",
"//third_party/rust/crates/cxx/src/cxx.cc",
]
deps = []
deps = [ "//third_party/rust/crates/cxx:lib" ]
if (is_win) {
defines += [ "CXX_RS_EXPORT=__declspec(dllexport)" ]
} else {
-17
View File
@@ -9,23 +9,6 @@ fn main() {
let manifest_dir_opt = env::var_os("CARGO_MANIFEST_DIR").map(PathBuf::from);
let manifest_dir = manifest_dir_opt.as_deref().unwrap_or(Path::new(""));
cc::Build::new()
.file(manifest_dir.join("src/cxx.cc"))
.cpp(true)
.cpp_link_stdlib(None) // linked via link-cplusplus crate
.std(cxxbridge_flags::STD)
.warnings_into_errors(cfg!(deny_warnings))
.compile("cxxbridge1");
println!("cargo:rerun-if-changed=src/cxx.cc");
println!("cargo:rerun-if-changed=include/cxx.h");
println!("cargo:rustc-cfg=built_with_cargo");
if let Some(manifest_dir) = &manifest_dir_opt {
let cxx_h = manifest_dir.join("include").join("cxx.h");
println!("cargo:HEADER={}", cxx_h.to_string_lossy());
}
if let Some(rustc) = rustc_version() {
if rustc.minor >= 80 {
println!("cargo:rustc-check-cfg=cfg(built_with_cargo)");