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 "http2", 29 "ylong_base", 30 "__c_openssl", 31 "__tls", 32 ] 33 34 sources = [ "src/lib.rs" ] 35 deps = [ "../ylong_http:ylong_http" ] 36 external_deps = [ 37 "openssl:libcrypto_shared", 38 "openssl:libssl_shared", 39 "rust_libc:lib", 40 "ylong_runtime:ylong_runtime", 41 ] 42} 43 44ohos_rust_unittest("rust_ylong_http_client_test_ut") { 45 module_out_path = "ylong_http/ylong_http" 46 47 rustflags = [ 48 "--cfg=feature=\"async\"", 49 "--cfg=feature=\"http1_1\"", 50 "--cfg=feature=\"http2\"", 51 "--cfg=feature=\"c_openssl_3_0\"", 52 "--cfg=feature=\"__tls\"", 53 "--cfg=feature=\"__c_openssl\"", 54 "--cfg=feature=\"ylong_base\"", 55 ] 56 57 sources = [ "src/lib.rs" ] 58 deps = [ 59 "../ylong_http:ylong_http", 60 ] 61 external_deps = [ 62 "openssl:libcrypto_shared", 63 "openssl:libssl_shared", 64 "rust_libc:lib", 65 "ylong_runtime:ylong_runtime", 66 ] 67} 68 69group("unittest") { 70 testonly = true 71 deps = [] 72 if (!use_clang_coverage) { 73 deps += [ 74 ":rust_ylong_http_client_test_ut", 75 "../ylong_http:rust_ylong_http_test_ut", 76 ] 77 } 78} 79