# 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") shared_library("nstackx_congestion.open") { if (ohos_kernel_type == "liteos_a") { cflags = [ "-Wall", "-D_GNU_SOURCE", "-DNSTACKX_WITH_LITEOS", "-DLWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS", "-DLWIP_LITEOS_A_COMPAT", "-DMBEDTLS_INCLUDED", "-DENABLE_USER_LOG", ] cflags_cc = cflags include_dirs = [ "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/liteos", "interface", "platform/liteos", ] sources = [ "core/nstackx_congestion.c", "platform/liteos/sys_congestion.c", ] deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open" ] external_deps = [ "bounds_checking_function:libsec_shared" ] } else if (ohos_kernel_type == "linux") { cflags = [ "-Wall", "-DNSTACKX_WITH_HMOS_LINUX", "-DMBEDTLS_INCLUDED", "-DENABLE_USER_LOG", ] cflags_cc = cflags include_dirs = [ "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/unix", "interface", "platform/unix", ] sources = [ "core/nstackx_congestion.c", "platform/unix/sys_congestion.c", ] deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open" ] external_deps = [ "bounds_checking_function:libsec_shared" ] } } } else { import("//build/ohos.gni") ohos_shared_library("nstackx_congestion.open") { sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" cflags = [ "-Wall", "-DMBEDTLS_INCLUDED", "-DNSTACKX_WITH_HMOS_LINUX", "-DENABLE_USER_LOG", ] cflags_cc = cflags include_dirs = [ "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/unix", "interface", "platform/unix", ] sources = [ "core/nstackx_congestion.c", "platform/unix/sys_congestion.c", ] deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open" ] external_deps = [ "bounds_checking_function:libsec_shared" ] if (is_standard_system) { external_deps += [ "c_utils:utils" ] } innerapi_tags = [ "platformsdk_indirect" ] part_name = "dsoftbus" subsystem_name = "communication" } }