1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//build/test.gni") 16 17ohos_rust_shared_library("ylong_http_client_inner") { 18 part_name = "ylong_http" 19 subsystem_name = "commonlibrary" 20 21 crate_name = "ylong_http_client_inner" 22 edition = "2021" 23 24 features = [ 25 "async", 26 "c_openssl_3_0", 27 "http1_1", 28 "ylong_base", 29 "__c_openssl", 30 "__tls", 31 ] 32 33 sources = [ "src/lib.rs" ] 34 deps = [ 35 "../ylong_http:ylong_http", 36 "//third_party/openssl:libcrypto_shared", 37 "//third_party/openssl:libssl_shared", 38 "//third_party/rust/crates/libc:lib", 39 ] 40 external_deps = [ "ylong_runtime:ylong_runtime" ] 41} 42 43ohos_rust_unittest("rust_ylong_http_client_test_ut") { 44 module_out_path = "ylong_http/ylong_http_client" 45 46 rustflags = [ 47 "--cfg=feature=\"async\"", 48 "--cfg=feature=\"http1_1\"", 49 "--cfg=feature=\"c_openssl_3_0\"", 50 "--cfg=feature=\"__tls\"", 51 "--cfg=feature=\"__c_openssl\"", 52 "--cfg=feature=\"ylong_base\"", 53 ] 54 55 sources = [ "src/lib.rs" ] 56 deps = [ 57 "../ylong_http:ylong_http", 58 "//third_party/openssl:libcrypto_shared", 59 "//third_party/openssl:libssl_shared", 60 "//third_party/rust/crates/libc:lib", 61 ] 62 external_deps = [ "ylong_runtime:ylong_runtime" ] 63} 64 65group("unittest") { 66 testonly = true 67 deps = [ 68 ":rust_ylong_http_client_test_ut", 69 "../ylong_http:rust_ylong_http_test_ut", 70 ] 71} 72