# Copyright (c) 2021 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. DSOFTBUS_ROOT_PATH = "./../../../.." import("$DSOFTBUS_ROOT_PATH/dsoftbus.gni") NSTACKX_ROOT = "$DSOFTBUS_ROOT_PATH/components/nstackx" if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") config("dfile_lite_config") { cflags = [ "-Wall", "-fno-lto", "-D_GNU_SOURCE", "-DNSTACKX_WITH_LITEOS", "-DLWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS", "-DLWIP_LITEOS_A_COMPAT", "-DMBEDTLS_INCLUDED", "-DDFILE_ENABLE_HIDUMP", ] cflags_cc = cflags } config("dfile_linux_config") { cflags = [ "-Wall", "-fno-lto", "-DNSTACKX_WITH_HMOS_LINUX", "-DMBEDTLS_INCLUDED", "-DENABLE_USER_LOG", ] cflags_cc = cflags } shared_library("nstackx_dfile.open") { if (ohos_kernel_type == "liteos_a") { configs += [ ":dfile_lite_config" ] include_dirs = [ "include", "interface", "$NSTACKX_ROOT/nstackx_congestion/interface/", "$NSTACKX_ROOT/nstackx_core", "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/liteos", ] sources = [ "$NSTACKX_ROOT/nstackx_core/platform/liteos/dfile/sys_dfile.c", "$NSTACKX_ROOT/nstackx_core/platform/liteos/dfile/sys_dfile_session.c", "$NSTACKX_ROOT/nstackx_core/platform/liteos/dfile/sys_file_manager.c", "core/nstackx_dfile.c", "core/nstackx_dfile_config.c", "core/nstackx_dfile_control.c", "core/nstackx_dfile_dfx.c", "core/nstackx_dfile_frame.c", "core/nstackx_dfile_log.c", "core/nstackx_dfile_mp.c", "core/nstackx_dfile_retransmission.c", "core/nstackx_dfile_send.c", "core/nstackx_dfile_session.c", "core/nstackx_dfile_transfer.c", "core/nstackx_file_list.c", "core/nstackx_file_manager.c", "core/nstackx_file_manager_client.c", ] deps = [ "$NSTACKX_ROOT/nstackx_congestion:nstackx_congestion.open", "$NSTACKX_ROOT/nstackx_util:nstackx_util.open", ] external_deps = [ "bounds_checking_function:libsec_shared", "mbedtls:mbedtls_shared", ] } else if (ohos_kernel_type == "linux") { configs += [ ":dfile_linux_config" ] include_dirs = [ "include", "interface", "$NSTACKX_ROOT/nstackx_congestion/interface/", "$NSTACKX_ROOT/nstackx_core", "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/unix", ] sources = [ "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_dfile.c", "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_dfile_session.c", "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_file_manager.c", "core/nstackx_dfile.c", "core/nstackx_dfile_config.c", "core/nstackx_dfile_control.c", "core/nstackx_dfile_dfx.c", "core/nstackx_dfile_frame.c", "core/nstackx_dfile_log.c", "core/nstackx_dfile_mp.c", "core/nstackx_dfile_retransmission.c", "core/nstackx_dfile_send.c", "core/nstackx_dfile_session.c", "core/nstackx_dfile_transfer.c", "core/nstackx_file_list.c", "core/nstackx_file_manager.c", "core/nstackx_file_manager_client.c", ] deps = [ "$NSTACKX_ROOT/nstackx_congestion:nstackx_congestion.open", "$NSTACKX_ROOT/nstackx_util:nstackx_util.open", ] external_deps = [ "bounds_checking_function:libsec_shared", "mbedtls:mbedtls_shared", ] } } } else { import("//build/ohos.gni") ohos_shared_library("nstackx_dfile.open") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" cflags = [ "-Wall", "-DNSTACKX_WITH_HMOS_LINUX", "-DDFILE_ENABLE_HIDUMP", "-DENABLE_USER_LOG", "-DSSL_AND_CRYPTO_INCLUDED", ] cflags_cc = cflags include_dirs = [ "include", "interface", "$NSTACKX_ROOT/nstackx_congestion/interface/", "$NSTACKX_ROOT/nstackx_core", "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/unix", ] sources = [ "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_dfile.c", "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_dfile_session.c", "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_file_manager.c", "core/nstackx_dfile.c", "core/nstackx_dfile_config.c", "core/nstackx_dfile_control.c", "core/nstackx_dfile_dfx.c", "core/nstackx_dfile_frame.c", "core/nstackx_dfile_log.c", "core/nstackx_dfile_mp.c", "core/nstackx_dfile_retransmission.c", "core/nstackx_dfile_send.c", "core/nstackx_dfile_session.c", "core/nstackx_dfile_transfer.c", "core/nstackx_file_list.c", "core/nstackx_file_manager.c", "core/nstackx_file_manager_client.c", ] deps = [ "$NSTACKX_ROOT/nstackx_congestion:nstackx_congestion.open", "$NSTACKX_ROOT/nstackx_util:nstackx_util.open", ] external_deps = [ "bounds_checking_function:libsec_shared", "openssl:libcrypto_shared", ] if (is_standard_system) { external_deps += [ "c_utils:utils" ] } innerapi_tags = [ "platformsdk_indirect" ] part_name = "dsoftbus" subsystem_name = "communication" } }