1# Copyright (c) 2021 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 14DSOFTBUS_ROOT_PATH = "./../../.." 15import("$DSOFTBUS_ROOT_PATH/dsoftbus.gni") 16 17NSTACKX_ROOT = "$DSOFTBUS_ROOT_PATH/components/nstackx" 18 19if (defined(ohos_lite)) { 20 import("//build/lite/config/component/lite_component.gni") 21 22 shared_library("nstackx_congestion.open") { 23 if (ohos_kernel_type == "liteos_a") { 24 cflags = [ 25 "-Wall", 26 "-D_GNU_SOURCE", 27 "-DNSTACKX_WITH_LITEOS", 28 "-DLWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS", 29 "-DLWIP_LITEOS_A_COMPAT", 30 "-DMBEDTLS_INCLUDED", 31 "-DENABLE_USER_LOG", 32 ] 33 cflags_cc = cflags 34 include_dirs = [ 35 "$NSTACKX_ROOT/nstackx_util/interface", 36 "$NSTACKX_ROOT/nstackx_util/platform/liteos", 37 "interface", 38 "platform/liteos", 39 ] 40 sources = [ 41 "core/nstackx_congestion.c", 42 "platform/liteos/sys_congestion.c", 43 ] 44 deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open" ] 45 external_deps = [ "bounds_checking_function:libsec_shared" ] 46 } else if (ohos_kernel_type == "linux") { 47 cflags = [ 48 "-Wall", 49 "-DNSTACKX_WITH_HMOS_LINUX", 50 "-DMBEDTLS_INCLUDED", 51 "-DENABLE_USER_LOG", 52 ] 53 cflags_cc = cflags 54 include_dirs = [ 55 "$NSTACKX_ROOT/nstackx_util/interface", 56 "$NSTACKX_ROOT/nstackx_util/platform/unix", 57 "interface", 58 "platform/unix", 59 ] 60 sources = [ 61 "core/nstackx_congestion.c", 62 "platform/unix/sys_congestion.c", 63 ] 64 deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open" ] 65 external_deps = [ "bounds_checking_function:libsec_shared" ] 66 } 67 } 68} else { 69 import("//build/ohos.gni") 70 71 ohos_shared_library("nstackx_congestion.open") { 72 sanitize = { 73 cfi = true 74 cfi_cross_dso = true 75 debug = false 76 } 77 branch_protector_ret = "pac_ret" 78 79 cflags = [ 80 "-Wall", 81 "-DMBEDTLS_INCLUDED", 82 "-DNSTACKX_WITH_HMOS_LINUX", 83 "-DENABLE_USER_LOG", 84 ] 85 cflags_cc = cflags 86 include_dirs = [ 87 "$NSTACKX_ROOT/nstackx_util/interface", 88 "$NSTACKX_ROOT/nstackx_util/platform/unix", 89 "interface", 90 "platform/unix", 91 ] 92 sources = [ 93 "core/nstackx_congestion.c", 94 "platform/unix/sys_congestion.c", 95 ] 96 97 deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open" ] 98 external_deps = [ "bounds_checking_function:libsec_shared" ] 99 if (is_standard_system) { 100 external_deps += [ "c_utils:utils" ] 101 } 102 innerapi_tags = [ "platformsdk_indirect" ] 103 part_name = "dsoftbus" 104 subsystem_name = "communication" 105 } 106} 107