• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//foundation/communication/netstack/netstack_config.gni")
16
17config("net_ssl_config") {
18  include_dirs = [ "$NETSTACK_DIR/interfaces/innerkits/net_ssl/include" ]
19
20  cflags = []
21  if (is_double_framework) {
22    cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ]
23  }
24  if (target_cpu == "arm") {
25    cflags += [ "-DBINDER_IPC_32BIT" ]
26  }
27  if (is_standard_system) {
28    cflags += [ "-DCONFIG_STANDARD_SYSTEM" ]
29  }
30  if (defined(build_public_version) && build_public_version) {
31    cflags += [ "-DBUILD_PUBLIC_VERSION" ]
32  }
33
34  if (is_mingw) {
35    defines = [ "WINDOWS_PLATFORM" ]
36  } else if (is_mac) {
37    defines = [ "MAC_PLATFORM" ]
38  }
39}
40
41ohos_shared_library("net_ssl") {
42  sources = [
43    "$NETSTACK_NATIVE_ROOT/net_ssl/net_ssl.cpp",
44    "$NETSTACK_NATIVE_ROOT/net_ssl/net_ssl_verify_cert.cpp",
45  ]
46
47  include_dirs = [
48    "$SUBSYSTEM_DIR/ipc/interfaces/innerkits/ipc_core/include",
49    "$THIRD_PARTY_ROOT/openssl/include",
50    "$NETSTACK_NATIVE_ROOT/net_ssl/include",
51    "$NETSTACK_DIR/utils/log/include",
52  ]
53  cflags = [
54    "-fstack-protector-strong",
55    "-D_FORTIFY_SOURCE=2",
56    "-O2",
57  ]
58  cflags_cc = [
59    "-fstack-protector-strong",
60    "-D_FORTIFY_SOURCE=2",
61    "-O2",
62  ]
63
64  version_script = "libnet_ssl.map"
65
66  public_configs = [ ":net_ssl_config" ]
67
68  deps = [
69    "$THIRD_PARTY_ROOT/openssl:libcrypto_shared",
70    "$THIRD_PARTY_ROOT/openssl:libssl_shared",
71  ]
72
73  external_deps = [
74    "hilog:libhilog",
75    "ipc:ipc_core",
76  ]
77
78  innerapi_tags = [ "platformsdk" ]
79  part_name = "netstack"
80  subsystem_name = "communication"
81}
82