1# Copyright (c) 2023 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("net_conn_manager_if_config") { 18 include_dirs = [ 19 "include", 20 "include/ipc", 21 "$EXT_INNERKITS_ROOT/include", 22 "$NETMANAGER_EXT_ROOT/utils/log/include", 23 ] 24 25 defines = [] 26 if (is_double_framework) { 27 defines += [ "CONFIG_DUAL_FRAMEWORK" ] 28 } 29 if (target_cpu == "arm") { 30 defines += [ "BINDER_IPC_32BIT" ] 31 } 32 if (is_standard_system) { 33 defines += [ "CONFIG_STANDARD_SYSTEM" ] 34 } 35 if (defined(build_public_version) && build_public_version) { 36 defines += [ "BUILD_PUBLIC_VERSION" ] 37 } 38 39 cflags = [ 40 "-fstack-protector-strong", 41 "-D_FORTIFY_SOURCE=2", 42 "-O2", 43 ] 44 45 cflags_cc = [ 46 "-fstack-protector-strong", 47 "-D_FORTIFY_SOURCE=2", 48 "-O2", 49 ] 50} 51 52ohos_source_set("netfirewall_parcel") { 53 sanitize = { 54 cfi = true 55 cfi_cross_dso = true 56 debug = false 57 } 58 59 sources = [ "$NETFIREWALL_EXTENSION_SOURCE_DIR/src/netfirewall_common.cpp" ] 60 61 include_dirs = [ 62 "$EXT_INNERKITS_ROOT/include", 63 "$EXT_INNERKITS_ROOT/netfirewallclient/include", 64 "$NETMANAGER_EXT_ROOT/utils/log/include", 65 ] 66 67 external_deps = [ 68 "c_utils:utils", 69 "hilog:libhilog", 70 "netmanager_base:net_conn_parcel", 71 "netmanager_base:net_native_manager_if", 72 ] 73 74 part_name = "netmanager_ext" 75 subsystem_name = "communication" 76} 77 78ohos_shared_library("netfirewall_manager_if") { 79 sanitize = { 80 cfi = true 81 cfi_cross_dso = true 82 debug = false 83 } 84 85 if (netmanager_ext_feature_net_firewall) { 86 sources = [ 87 "$NETFIREWALL_EXTENSION_SOURCE_DIR/src/netfirewall_client.cpp", 88 "$NETFIREWALL_EXTENSION_SOURCE_DIR/src/netfirewall_proxy.cpp", 89 ] 90 91 public_configs = [ 92 ":net_conn_manager_if_config", 93 "$NETMANAGER_EXT_ROOT/resource:coverage_flags", 94 ] 95 96 deps = [ ":netfirewall_parcel" ] 97 98 external_deps = [ 99 "hilog:libhilog", 100 "ipc:ipc_single", 101 "netmanager_base:net_native_manager_if", 102 "samgr:samgr_proxy", 103 ] 104 105 defines = [ 106 "NETMGR_LOG_TAG = \"NetFirewallManager\"", 107 "LOG_DOMAIN = 0xD0015B0", 108 ] 109 110 if (enable_netmgr_ext_debug) { 111 defines += [ "NETMGR_DEBUG" ] 112 } 113 114 part_name = "netmanager_ext" 115 subsystem_name = "communication" 116 } 117} 118