1# Copyright (c) 2021-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/netstack/netstack_config.gni") 16 17TLS = "$NETSTACK_NATIVE_ROOT/tls_socket" 18TLS_NAPI = "$NETSTACK_DIR/frameworks/js/napi/tls" 19 20tls_sources = [ 21 "$TLS/src/secure_data.cpp", 22 "$TLS/src/socket_error.cpp", 23 "$TLS/src/tls_certificate.cpp", 24 "$TLS/src/tls_configuration.cpp", 25 "$TLS/src/tls_context.cpp", 26 "$TLS/src/tls_key.cpp", 27 "$TLS/src/tls_socket.cpp", 28 "$TLS/src/tls_utils.cpp", 29] 30 31tls_napi_sources = [ 32 "$TLS_NAPI/src/context/tls_bind_context.cpp", 33 "$TLS_NAPI/src/context/tls_connect_context.cpp", 34 "$TLS_NAPI/src/context/tls_extra_context.cpp", 35 "$TLS_NAPI/src/context/tls_napi_context.cpp", 36 "$TLS_NAPI/src/context/tls_send_context.cpp", 37 "$TLS_NAPI/src/monitor.cpp", 38 "$TLS_NAPI/src/tlssocket_async_work.cpp", 39 "$TLS_NAPI/src/tlssocket_exec.cpp", 40 "$TLS_NAPI/src/tlssocket_module.cpp", 41] 42 43ohos_shared_library("socket") { 44 include_dirs = [ 45 "$TLS/include", 46 "$TLS_NAPI/include", 47 "$TLS_NAPI/include/context", 48 "$NETSTACK_INNERKITS_DIR/tls_socket/include", 49 "$NETSTACK_DIR/utils/napi_utils/include", 50 "async_context/include", 51 "async_work/include", 52 "constant/include", 53 "socket_exec/include", 54 "socket_module/include", 55 "options/include", 56 "task_queue/include", 57 ] 58 59 sources = [ 60 "async_context/src/bind_context.cpp", 61 "async_context/src/common_context.cpp", 62 "async_context/src/connect_context.cpp", 63 "async_context/src/tcp_extra_context.cpp", 64 "async_context/src/tcp_send_context.cpp", 65 "async_context/src/udp_extra_context.cpp", 66 "async_context/src/udp_send_context.cpp", 67 "async_work/src/socket_async_work.cpp", 68 "options/src/extra_options_base.cpp", 69 "options/src/net_address.cpp", 70 "options/src/socket_remote_info.cpp", 71 "options/src/socket_state_base.cpp", 72 "options/src/tcp_connect_options.cpp", 73 "options/src/tcp_extra_options.cpp", 74 "options/src/tcp_send_options.cpp", 75 "options/src/udp_extra_options.cpp", 76 "options/src/udp_send_options.cpp", 77 "socket_exec/src/socket_exec.cpp", 78 "socket_module/src/socket_module.cpp", 79 ] 80 sources += tls_sources 81 sources += tls_napi_sources 82 83 deps = [ 84 "$NETSTACK_DIR/utils:stack_utils_common", 85 "$NETSTACK_DIR/utils/napi_utils:napi_utils", 86 "$THIRD_PARTY_ROOT/openssl:libcrypto_shared", 87 "$THIRD_PARTY_ROOT/openssl:libssl_shared", 88 ] 89 90 external_deps = [ 91 "c_utils:utils", 92 "hiviewdfx_hilog_native:libhilog", 93 "napi:ace_napi", 94 ] 95 96 relative_install_dir = "module/net" 97 part_name = "netstack" 98 subsystem_name = "communication" 99} 100