• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 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/netmanager_ext/netmanager_ext_config.gni")
16
17group("common_target") {
18  deps = [
19    ":net_event_report",
20    ":net_manager_ext_common",
21  ]
22}
23
24config("netmgr_ext_common_config") {
25  include_dirs = [
26    "log/include",
27    "event_report/include",
28  ]
29}
30
31ohos_shared_library("net_manager_ext_common") {
32  sanitize = {
33    cfi = true
34    cfi_cross_dso = true
35    blocklist = "./cfi_blocklist.txt"
36    debug = false
37  }
38
39  branch_protector_ret = "pac_ret"
40
41  sources = [ "log/src/netmgr_ext_log_wrapper.cpp" ]
42
43  defines = [
44    "NETMGR_EXT_LOG_TAG = \"NetMgrExtCommon\"",
45    "LOG_DOMAIN = 0xD0015B0",
46  ]
47
48  if (is_standard_system) {
49    defines += [ "STANDARD_SYSTEM_ENABLE" ]
50  }
51
52  public_configs = [ ":netmgr_ext_common_config" ]
53
54  public_external_deps = [ "c_utils:utils" ]
55
56  cflags = [
57    "-fstack-protector-strong",
58    "-D_FORTIFY_SOURCE=2",
59    "-O2",
60  ]
61
62  if (is_double_framework) {
63    cflags_cc = [ "-DCONFIG_DUAL_FRAMEWORK" ]
64    cflags_cc += [ "-fstack-protector-strong" ]
65  } else {
66    cflags_cc = [ "-fstack-protector-strong" ]
67  }
68
69  cflags_cc += [
70    "-D_FORTIFY_SOURCE=2",
71    "-O2",
72  ]
73
74  if (is_standard_system) {
75    external_deps = [
76      "c_utils:utils",
77      "hilog:libhilog",
78    ]
79  } else {
80    external_deps = [
81      "c_utils:utils",
82      "hilog:libhilog",
83    ]
84  }
85
86  part_name = "netmanager_ext"
87  subsystem_name = "communication"
88}
89
90ohos_shared_library("net_event_report") {
91  sanitize = {
92    cfi = true
93    cfi_cross_dso = true
94    blocklist = "./cfi_blocklist.txt"
95    debug = false
96  }
97
98  branch_protector_ret = "pac_ret"
99
100  cflags = [
101    "-fstack-protector-strong",
102    "-D_FORTIFY_SOURCE=2",
103    "-O2",
104  ]
105
106  cflags_cc = [
107    "-fstack-protector-strong",
108    "-D_FORTIFY_SOURCE=2",
109    "-O2",
110  ]
111
112  sources = [ "event_report/src/net_event_report.cpp" ]
113
114  public_configs = [ ":netmgr_ext_common_config" ]
115
116  external_deps = [ "hisysevent:libhisysevent" ]
117
118  part_name = "netmanager_ext"
119  subsystem_name = "communication"
120}
121