• 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        "-DENABLE_USER_LOG",
31      ]
32      cflags_cc = cflags
33      include_dirs = [
34        "$NSTACKX_ROOT/nstackx_util/interface",
35        "$NSTACKX_ROOT/nstackx_util/platform/liteos",
36        "//third_party/bounds_checking_function/include/",
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    } else if (ohos_kernel_type == "linux") {
46      cflags = [
47        "-Wall",
48        "-DNSTACKX_WITH_HMOS_LINUX",
49        "-DMBEDTLS_INCLUDED",
50        "-DENABLE_USER_LOG",
51      ]
52      cflags_cc = cflags
53      include_dirs = [
54        "$NSTACKX_ROOT/nstackx_util/interface",
55        "$NSTACKX_ROOT/nstackx_util/platform/unix",
56        "//third_party/bounds_checking_function/include/",
57        "interface",
58        "platform/unix",
59      ]
60      sources = [
61        "core/nstackx_congestion.c",
62        "platform/unix/sys_congestion.c",
63      ]
64
65      deps = [ "$NSTACKX_ROOT/nstackx_util:nstackx_util.open" ]
66    }
67  }
68} else {
69  import("//build/ohos.gni")
70
71  ohos_shared_library("nstackx_congestion.open") {
72    cflags = [
73      "-Wall",
74      "-DMBEDTLS_INCLUDED",
75      "-DNSTACKX_WITH_HMOS_LINUX",
76      "-DENABLE_USER_LOG",
77    ]
78    cflags_cc = cflags
79    include_dirs = [
80      "$NSTACKX_ROOT/nstackx_util/interface",
81      "$NSTACKX_ROOT/nstackx_util/platform/unix",
82      "//commonlibrary/c_utils/base/include/",
83      "//third_party/bounds_checking_function/include",
84      "interface",
85      "platform/unix",
86    ]
87    sources = [
88      "core/nstackx_congestion.c",
89      "platform/unix/sys_congestion.c",
90    ]
91
92    deps = [
93      "$NSTACKX_ROOT/nstackx_util:nstackx_util.open",
94      "//third_party/bounds_checking_function:libsec_shared",
95    ]
96    part_name = "dsoftbus"
97    subsystem_name = "communication"
98  }
99}
100