• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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
17ohos_shared_library("cj_net_network_security_ffi") {
18  sanitize = {
19    cfi = true
20    cfi_cross_dso = true
21    debug = false
22  }
23
24  branch_protector_ret = "pac_ret"
25
26  include_dirs = [
27    "include",
28    "$NETSTACK_DIR/utils/common_utils/include",
29  ]
30  sources = [
31    "src/net_network_security_ffi.cpp",
32  ]
33
34  defines = []
35
36  cflags = [
37    "-fstack-protector-strong",
38    "-D_FORTIFY_SOURCE=2",
39    "-O2",
40  ]
41
42  cflags_cc = [
43    "-fvisibility=hidden",
44    "-fstack-protector-strong",
45    "-D_FORTIFY_SOURCE=2",
46    "-O2",
47  ]
48
49  deps = [ "$NETSTACK_DIR/interfaces/innerkits/net_ssl:net_ssl" ]
50
51  external_deps = [
52    "hilog:libhilog",
53    "napi:ace_napi",
54    "napi:cj_bind_ffi",
55    "napi:cj_bind_native",
56    "openssl:libcrypto_shared",
57    "openssl:libssl_shared",
58    "samgr:samgr_proxy",
59  ]
60
61  if (defined(global_parts_info) &&
62      defined(global_parts_info.communication_netmanager_base) &&
63      global_parts_info.communication_netmanager_base) {
64    external_deps += [
65      "netmanager_base:net_conn_manager_if",
66      "netmanager_base:net_security_config_if",
67    ]
68    defines += [ "HAS_NETMANAGER_BASE=1" ]
69  } else {
70    defines += [ "HAS_NETMANAGER_BASE=0" ]
71  }
72
73  innerapi_tags = [ "platformsdk" ]
74  part_name = "netstack"
75  subsystem_name = "communication"
76}
77