# 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. import("//foundation/communication/dsoftbus/dsoftbus.gni") NSTACKX_ROOT = "//foundation/communication/dsoftbus/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", ] cflags_cc = cflags include_dirs = [ "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/liteos", "//third_party/bounds_checking_function/include/", "interface", "platform/liteos", ] sources = [ "core/nstackx_congestion.c", "platform/liteos/sys_congestion.c", ] deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open", "//third_party/mbedtls", ] } else if (ohos_kernel_type == "linux") { cflags = [ "-Wall", "-DNSTACKX_WITH_HMOS_LINUX", "-DMBEDTLS_INCLUDED", ] cflags_cc = cflags include_dirs = [ "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/unix", "//third_party/bounds_checking_function/include/", "interface", "platform/unix", ] sources = [ "core/nstackx_congestion.c", "platform/unix/sys_congestion.c", ] deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open", "//third_party/mbedtls", ] } } } else { import("//build/ohos.gni") ohos_shared_library("nstackx_congestion.open") { cflags = [ "-Wall", "-DMBEDTLS_INCLUDED", "-DNSTACKX_WITH_HMOS_LINUX", ] cflags_cc = cflags include_dirs = [ "$NSTACKX_ROOT/nstackx_util/interface", "$NSTACKX_ROOT/nstackx_util/platform/unix", "//utils/native/base/include/", "interface", "platform/unix", ] sources = [ "core/nstackx_congestion.c", "platform/unix/sys_congestion.c", ] deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open", "//third_party/mbedtls", "//utils/native/base:utilsecurec_shared", ] part_name = "dsoftbus_standard" subsystem_name = "communication" } }