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