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/frameworks/js/napi/connection/async_context/include", 31 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection/async_work/include", 32 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection/connection_exec/include", 33 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection/connection_module/include", 34 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection/net_handle_interface/include", 35 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection/observer/include", 36 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection/options/include", 37 ] 38 39 sources = [ 40 "src/net_connection_callback.cpp", 41 "src/net_connection_ffi.cpp", 42 "src/net_connection_impl.cpp", 43 ] 44 45 cflags = [ 46 "-fstack-protector-strong", 47 "-D_FORTIFY_SOURCE=2", 48 "-O2", 49 ] 50 51 cflags_cc = [ 52 "-fvisibility=hidden", 53 "-fstack-protector-strong", 54 "-D_FORTIFY_SOURCE=2", 55 "-O2", 56 ] 57 58 deps = [ 59 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 60 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection:connection", 61 "$NETMANAGER_BASE_ROOT/frameworks/js/napi/connection:connection_if", 62 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 63 "$NETMANAGER_BASE_ROOT/utils/napi_utils:napi_utils", 64 ] 65 66 external_deps = [ 67 "c_utils:utils", 68 "hilog:libhilog", 69 "ipc:ipc_core", 70 "ipc:ipc_napi", 71 "napi:ace_napi", 72 "napi:cj_bind_ffi", 73 "napi:cj_bind_native", 74 "samgr:samgr_proxy", 75 ] 76 77 defines = [] 78 79 if (build_ohos_sdk) { 80 defines += [ "PREVIEWER" ] 81 sources = [ "src/net_connection_mock.cpp" ] 82 } 83 84 if (current_os == "ohos") { 85 defines += [ "OHOS_PLATFORM" ] 86 } 87 88 if (current_os == "mingw") { 89 defines += [ "WINDOWS_PLATFORM" ] 90 } 91 92 innerapi_tags = [ "platformsdk" ] 93 part_name = "netmanager_base" 94 subsystem_name = "communication" 95} 96