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