# 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/netstack/netstack_config.gni") config("net_ssl_config") { include_dirs = [ "$NETSTACK_DIR/interfaces/innerkits/net_ssl/include" ] cflags = [] if (is_double_framework) { cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] } if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } if (is_standard_system) { cflags += [ "-DCONFIG_STANDARD_SYSTEM" ] } if (defined(build_public_version) && build_public_version) { cflags += [ "-DBUILD_PUBLIC_VERSION" ] } if (is_mingw) { defines = [ "WINDOWS_PLATFORM" ] } else if (is_mac) { defines = [ "MAC_PLATFORM" ] } } ohos_shared_library("net_ssl") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" sources = [ "$NETSTACK_NATIVE_ROOT/net_ssl/net_ssl.cpp", "$NETSTACK_NATIVE_ROOT/net_ssl/net_ssl_verify_cert.cpp", ] include_dirs = [ "$SUBSYSTEM_DIR/ipc/interfaces/innerkits/ipc_core/include", "$THIRD_PARTY_ROOT/openssl/include", "$NETSTACK_NATIVE_ROOT/net_ssl/include", "$NETSTACK_DIR/utils/log/include", ] cflags = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] cflags_cc = [ "-fstack-protector-strong", "-D_FORTIFY_SOURCE=2", "-O2", ] version_script = "libnet_ssl.map" public_configs = [ ":net_ssl_config" ] external_deps = [ "bounds_checking_function:libsec_shared", "hilog:libhilog", "ipc:ipc_core", "openssl:libcrypto_shared", "openssl:libssl_shared", ] innerapi_tags = [ "platformsdk" ] part_name = "netstack" subsystem_name = "communication" }