1# Copyright (c) 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_base/netmanager_base_config.gni") 16 17ohos_shared_library("cj_net_connection_ffi") { 18 sanitize = { 19 cfi = true 20 cfi_cross_dso = true 21 boundary_sanitize = true 22 all_ubsan = true 23 debug = false 24 } 25 26 branch_protector_ret = "pac_ret" 27 28 include_dirs = [ 29 "include", 30 "$NETMANAGER_BASE_ROOT/utils/log/include", 31 "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include", 32 "$NETMANAGER_BASE_ROOT/utils/common_utils/include", 33 ] 34 35 sources = [ 36 "src/net_connection_callback.cpp", 37 "src/net_connection_ffi.cpp", 38 "src/net_connection_impl.cpp", 39 ] 40 41 cflags = [ 42 "-fstack-protector-strong", 43 "-D_FORTIFY_SOURCE=2", 44 "-O2", 45 ] 46 47 cflags_cc = [ 48 "-fvisibility=hidden", 49 "-fstack-protector-strong", 50 "-D_FORTIFY_SOURCE=2", 51 "-O2", 52 ] 53 54 deps = [ 55 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 56 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 57 ] 58 59 external_deps = [ 60 "c_utils:utils", 61 "hilog:libhilog", 62 "ipc:ipc_core", 63 "napi:cj_bind_ffi", 64 "napi:cj_bind_native", 65 ] 66 67 defines = [] 68 69 if (build_ohos_sdk) { 70 defines += [ "PREVIEWER" ] 71 sources = [ "src/net_connection_mock.cpp" ] 72 } 73 74 if (current_os == "ohos") { 75 defines += [ "OHOS_PLATFORM" ] 76 } 77 78 if (current_os == "mingw") { 79 defines += [ "WINDOWS_PLATFORM" ] 80 } 81 82 innerapi_tags = [ "platformsdk" ] 83 part_name = "netmanager_base" 84 subsystem_name = "communication" 85} 86