diff --git a/ylong_http_client/BUILD.gn b/ylong_http_client/BUILD.gn index ffb399e2902f038182301b5fc85da59b93824531..b713ed10d69ae66e5e78494d141086fee566b1a7 100644 --- a/ylong_http_client/BUILD.gn +++ b/ylong_http_client/BUILD.gn @@ -32,15 +32,18 @@ ohos_rust_shared_library("ylong_http_client_inner") { ] sources = [ "src/lib.rs" ] - deps = [ - "../ylong_http:ylong_http", - "//third_party/rust/crates/libc:lib", - ] + deps = [ "../ylong_http:ylong_http" ] external_deps = [ "openssl:libcrypto_shared", "openssl:libssl_shared", "ylong_runtime:ylong_runtime", ] + if (defined(global_parts_info) && + !defined(global_parts_info.third_party_rust_cxx)) { + deps += [ "//third_party/rust/crates/libc:lib" ] + } else { + external_deps += [ "rust_libc:lib" ] + } } ohos_rust_unittest("rust_ylong_http_client_test_ut") { @@ -59,13 +62,18 @@ ohos_rust_unittest("rust_ylong_http_client_test_ut") { sources = [ "src/lib.rs" ] deps = [ "../ylong_http:ylong_http", - "//third_party/rust/crates/libc:lib", ] external_deps = [ "openssl:libcrypto_shared", "openssl:libssl_shared", "ylong_runtime:ylong_runtime", ] + if (defined(global_parts_info) && + !defined(global_parts_info.third_party_rust_cxx)) { + deps += [ "//third_party/rust/crates/libc:lib" ] + } else { + external_deps += [ "rust_libc:lib" ] + } } group("unittest") {