1# Copyright (c) 2021-2022 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_base/netmanager_base_config.gni") 16config("netsys_controller_include") { 17 include_dirs = [ 18 "include", 19 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 20 "$INNERKITS_ROOT/netstatsclient/include", 21 ] 22 23 cflags = [ 24 "-fstack-protector-strong", 25 "-D_FORTIFY_SOURCE=2", 26 "-O2", 27 ] 28 29 cflags_cc = [ 30 "-fstack-protector-strong", 31 "-D_FORTIFY_SOURCE=2", 32 "-O2", 33 ] 34} 35 36ohos_shared_library("netsys_controller") { 37 sanitize = { 38 cfi = true 39 cfi_cross_dso = true 40 boundary_sanitize = true 41 all_ubsan = true 42 debug = false 43 } 44 45 all_dependent_configs = [ ":netsys_controller_include" ] 46 sources = [ 47 "src/mock_netsys_native_client.cpp", 48 "src/netsys_controller.cpp", 49 "src/netsys_controller_service_impl.cpp", 50 "src/netsys_native_client.cpp", 51 ] 52 53 include_dirs = [ 54 "include", 55 "$NETCONNMANAGER_SOURCE_DIR/include", 56 "$NETCONNMANAGER_COMMON_DIR/include", 57 "$NETMANAGER_BASE_ROOT/utils/log/include", 58 "$NETSYSNATIVE_INNERKITS_SOURCE_DIR", 59 "$INNERKITS_ROOT/netmanagernative/include", 60 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 61 "$NETSYSNATIVE_SOURCE_DIR/include/manager", 62 ] 63 64 deps = [ 65 "$NETMANAGER_BASE_ROOT/services/netmanagernative:netsys_native_manager", 66 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 67 ] 68 69 external_deps = [ 70 "c_utils:utils", 71 "ipc:ipc_core", 72 "samgr:samgr_proxy", 73 ] 74 75 defines = [ 76 "NETMGR_LOG_TAG = \"NetConnManager\"", 77 "LOG_DOMAIN = 0xD0015B0", 78 ] 79 80 if (enable_netmgr_debug) { 81 defines += [ "NETMGR_DEBUG" ] 82 } 83 84 if (enable_sys_func) { 85 defines += [ "SYS_FUNC" ] 86 } 87 88 external_deps += [ "hilog:libhilog" ] 89 90 innerapi_tags = [ "platformsdk_indirect" ] 91 part_name = "netmanager_base" 92 subsystem_name = "communication" 93} 94