1# Copyright (c) 2022-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
17config("sharing_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "include",
21    "$NETMANAGER_BASE_ROOT/utils/log/include",
22  ]
23
24  cflags = [
25    "-fstack-protector-strong",
26    "-D_FORTIFY_SOURCE=2",
27    "-O2",
28  ]
29
30  cflags_cc = [
31    "-fstack-protector-strong",
32    "-D_FORTIFY_SOURCE=2",
33    "-O2",
34  ]
35}
36
37ohos_shared_library("sharing") {
38  sanitize = {
39    cfi = true
40    cfi_cross_dso = true
41    debug = false
42  }
43
44  branch_protector_ret = "pac_ret"
45
46  sources = [
47    "src/netshare_async_work.cpp",
48    "src/netshare_callback_observer.cpp",
49    "src/netshare_exec.cpp",
50    "src/netshare_issharing_context.cpp",
51    "src/netshare_module.cpp",
52    "src/netshare_observer_wrapper.cpp",
53    "src/netshare_startsharing_context.cpp",
54  ]
55
56  deps = [
57    "$NETMANAGER_EXT_ROOT/interfaces/innerkits/netshareclient:net_tether_manager_if",
58    "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common",
59  ]
60
61  external_deps = [
62    "c_utils:utils",
63    "hilog:libhilog",
64    "ipc:ipc_core",
65    "napi:ace_napi",
66    "netmanager_base:napi_utils",
67    "netmanager_base:net_manager_common",
68  ]
69
70  configs = [ ":sharing_config" ]
71
72  relative_install_dir = "module/net"
73  part_name = "netmanager_ext"
74  subsystem_name = "communication"
75}
76