From 817b9cf2c75baf19f9d5e8fb956a0544024c8160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E5=B0=8F=E6=9E=97?= Date: Thu, 19 Jun 2025 11:05:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E7=94=A8=E5=85=BC=E5=AE=B9=E6=80=A7?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=BC=95=E5=85=A5rust=5Flibc=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I06af3d83582dd686d4fcab5fc0df2ae67f1e337c Signed-off-by: 姜小林 --- interfaces/kits/rust/BUILD.gn | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/interfaces/kits/rust/BUILD.gn b/interfaces/kits/rust/BUILD.gn index 654f0d8c6..afaa3df58 100644 --- a/interfaces/kits/rust/BUILD.gn +++ b/interfaces/kits/rust/BUILD.gn @@ -24,10 +24,15 @@ ohos_rust_shared_ffi("rust_file") { sources = [ "src/lib.rs" ] crate_name = "rust_file" rustflags = [ "-Zstack-protector=all" ] - external_deps = [ - "hilog:hilog_rust", - "rust_libc:lib", - ] + deps = [] + external_deps = [ "hilog:hilog_rust" ] + + if (defined(global_parts_info) && !defined(global_parts_info.third_party_rust_libc)) { + deps += [ "//third_party/rust/crates/libc:lib" ] + } else { + external_deps += [ "rust_libc:lib" ] + } + innerapi_tags = [ "platformsdk" ] public_configs = [ ":public_config" ] } -- Gitee