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