# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") NETMANAGER_EXT_NAPI_ROOT = "$NETMANAGER_EXT_ROOT/frameworks/js/napi/" ohos_shared_library("vpn") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" sources = [ "src/context/destroy_context.cpp", "src/context/prepare_context.cpp", "src/context/protect_context.cpp", "src/context/setup_context.cpp", "src/vpn_async_work.cpp", "src/vpn_connection.cpp", "src/vpn_exec.cpp", "src/vpn_module.cpp", "src/vpn_monitor.cpp", ] include_dirs = [ "$NETMANAGER_EXT_NAPI_ROOT/vpn/include", "$NETMANAGER_EXT_NAPI_ROOT/vpn/include/context", "$NETMANAGER_BASE_ROOT/utils/common_utils/include", "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include", "$NETMANAGER_BASE_ROOT/utils/napi_utils/include", "$BASE_INNERKITS_ROOT/netvpnclient/include", "$BASE_INNERKITS_ROOT/netvpnclient/include/ipc", ] cflags = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] deps = [ "$NETMANAGER_EXT_ROOT/interfaces/innerkits/netvpnclient:net_vpn_manager_if", "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "napi:ace_napi", "netmanager_base:napi_utils", "netmanager_base:net_manager_common", ] relative_install_dir = "module/net" part_name = "netmanager_ext" subsystem_name = "communication" }