diff --git a/interfaces/innerkits/rust/BUILD.gn b/interfaces/innerkits/rust/BUILD.gn index e847b7e15eea4857345595a4a0387e1b887e3415..7c0c83f547f2f8cb45c5926722bc6a9ee8a250e0 100644 --- a/interfaces/innerkits/rust/BUILD.gn +++ b/interfaces/innerkits/rust/BUILD.gn @@ -45,9 +45,15 @@ ohos_static_library("samgr_rust_cpp") { "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", - "rust_cxx:cxx_cppdeps", ] + if (defined(global_parts_info) && + !defined(global_parts_info.third_party_rust_cxx)) { + deps += [ "//third_party/rust/crates/cxx:cxx_cppdeps" ] + } else { + external_deps += [ "rust_cxx:cxx_cppdeps" ] + } + subsystem_name = "systemabilitymgr" part_name = "samgr" } @@ -60,11 +66,17 @@ ohos_rust_shared_library("samgr_rust") { external_deps = [ "hilog:hilog_rust", "ipc:ipc_rust", - "rust_cxx:lib", ] deps = [ ":samgr_rust_cpp" ] + if (defined(global_parts_info) && + !defined(global_parts_info.third_party_rust_cxx)) { + deps += [ "//third_party/rust/crates/cxx:lib" ] + } else { + external_deps += [ "rust_cxx:lib" ] + } + crate_name = "samgr" install_images = [ system_base_dir ]