1# Copyright (c) 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") 16 17config("policy_config") { 18 visibility = [ ":policy" ] 19 20 include_dirs = [ 21 "include", 22 "include/context", 23 "$INNERKITS_ROOT/include", 24 "$NETMANAGER_BASE_ROOT/utils/log/include", 25 ] 26 27 cflags = [ 28 "-Wall", 29 "-Werror", 30 "-g3", 31 "-fstack-protector-strong", 32 "-D_FORTIFY_SOURCE=2", 33 "-O2", 34 ] 35 36 cflags_cc = [ 37 "-fstack-protector-strong", 38 "-D_FORTIFY_SOURCE=2", 39 "-O2", 40 ] 41} 42 43ohos_shared_library("policy") { 44 sanitize = { 45 cfi = true 46 cfi_cross_dso = true 47 boundary_sanitize = true 48 all_ubsan = true 49 debug = false 50 } 51 52 sources = [ 53 "src/context/get_net_quota_policies_context.cpp", 54 "src/context/get_policy_by_uid_context.cpp", 55 "src/context/get_uids_by_policy_context.cpp", 56 "src/context/is_uid_net_allowed_context.cpp", 57 "src/context/restore_all_policies_context.cpp", 58 "src/context/set_bg_policy_context.cpp", 59 "src/context/set_device_idle_allow_list_context.cpp", 60 "src/context/set_net_quota_policies_context.cpp", 61 "src/context/set_policy_by_uid_context.cpp", 62 "src/context/set_power_save_allow_list_context.cpp", 63 "src/context/update_remind_policy_context.cpp", 64 "src/net_policy_callback_observer.cpp", 65 "src/netpolicy_async_work.cpp", 66 "src/netpolicy_exec.cpp", 67 "src/netpolicy_module.cpp", 68 "src/policy_observer_wrapper.cpp", 69 ] 70 71 configs = [ ":policy_config" ] 72 73 deps = [ 74 "$INNERKITS_ROOT/netpolicyclient:net_policy_manager_if", 75 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 76 ] 77 78 external_deps = [ 79 "c_utils:utils", 80 "hilog:libhilog", 81 "ipc:ipc_core", 82 "napi:ace_napi", 83 ] 84 relative_install_dir = "module/net" 85 part_name = "netmanager_base" 86 87 subsystem_name = "communication" 88} 89