• 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"
17if (defined(ohos_lite)) {
18  import("//build/lite/config/component/lite_component.gni")
19  config("dfile_lite_config") {
20    cflags = [
21      "-Wall",
22      "-fno-lto",
23      "-D_GNU_SOURCE",
24      "-DNSTACKX_WITH_LITEOS",
25      "-DLWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS",
26      "-DLWIP_LITEOS_A_COMPAT",
27      "-DMBEDTLS_INCLUDED",
28    ]
29    cflags_cc = cflags
30  }
31
32  config("dfile_linux_config") {
33    cflags = [
34      "-Wall",
35      "-fno-lto",
36      "-DNSTACKX_WITH_HMOS_LINUX",
37      "-DMBEDTLS_INCLUDED",
38    ]
39    cflags_cc = cflags
40  }
41  shared_library("nstackx_dfile.open") {
42    if (ohos_kernel_type == "liteos_a") {
43      configs += [ ":dfile_lite_config" ]
44      include_dirs = [
45        "include",
46        "interface",
47        "$NSTACKX_ROOT/nstackx_congestion/interface/",
48        "$NSTACKX_ROOT/nstackx_core",
49        "$NSTACKX_ROOT/nstackx_util/interface",
50        "$NSTACKX_ROOT/nstackx_util/platform/liteos",
51        "//third_party/bounds_checking_function/include/",
52      ]
53      sources = [
54        "$NSTACKX_ROOT/nstackx_core/platform/liteos/dfile/sys_dfile.c",
55        "$NSTACKX_ROOT/nstackx_core/platform/liteos/dfile/sys_dfile_session.c",
56        "$NSTACKX_ROOT/nstackx_core/platform/liteos/dfile/sys_file_manager.c",
57        "core/nstackx_dfile.c",
58        "core/nstackx_dfile_config.c",
59        "core/nstackx_dfile_control.c",
60        "core/nstackx_dfile_frame.c",
61        "core/nstackx_dfile_mp.c",
62        "core/nstackx_dfile_retransmission.c",
63        "core/nstackx_dfile_send.c",
64        "core/nstackx_dfile_session.c",
65        "core/nstackx_dfile_transfer.c",
66        "core/nstackx_file_list.c",
67        "core/nstackx_file_manager.c",
68        "core/nstackx_file_manager_client.c",
69      ]
70      deps = [
71        "$NSTACKX_ROOT/nstackx_congestion:nstackx_congestion.open",
72        "$NSTACKX_ROOT/nstackx_util:nstackx_util.open",
73        "//third_party/mbedtls",
74      ]
75    } else if (ohos_kernel_type == "linux") {
76      configs += [ ":dfile_linux_config" ]
77      include_dirs = [
78        "include",
79        "interface",
80        "$NSTACKX_ROOT/nstackx_congestion/interface/",
81        "$NSTACKX_ROOT/nstackx_core",
82        "$NSTACKX_ROOT/nstackx_util/interface",
83        "$NSTACKX_ROOT/nstackx_util/platform/unix",
84        "//third_party/bounds_checking_function/include/",
85      ]
86      sources = [
87        "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_dfile.c",
88        "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_dfile_session.c",
89        "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_file_manager.c",
90        "core/nstackx_dfile.c",
91        "core/nstackx_dfile_config.c",
92        "core/nstackx_dfile_control.c",
93        "core/nstackx_dfile_frame.c",
94        "core/nstackx_dfile_mp.c",
95        "core/nstackx_dfile_retransmission.c",
96        "core/nstackx_dfile_send.c",
97        "core/nstackx_dfile_session.c",
98        "core/nstackx_dfile_transfer.c",
99        "core/nstackx_file_list.c",
100        "core/nstackx_file_manager.c",
101        "core/nstackx_file_manager_client.c",
102      ]
103      deps = [
104        "$NSTACKX_ROOT/nstackx_congestion:nstackx_congestion.open",
105        "$NSTACKX_ROOT/nstackx_util:nstackx_util.open",
106        "//third_party/mbedtls",
107      ]
108    }
109  }
110} else {
111  import("//build/ohos.gni")
112
113  ohos_shared_library("nstackx_dfile.open") {
114    cflags = [
115      "-Wall",
116      "-DMBEDTLS_INCLUDED",
117      "-DNSTACKX_WITH_HMOS_LINUX",
118    ]
119    cflags_cc = cflags
120    include_dirs = [
121      "include",
122      "interface",
123      "$NSTACKX_ROOT/nstackx_congestion/interface/",
124      "$NSTACKX_ROOT/nstackx_core",
125      "$NSTACKX_ROOT/nstackx_util/interface",
126      "$NSTACKX_ROOT/nstackx_util/platform/unix",
127      "//utils/native/base/include/",
128    ]
129    sources = [
130      "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_dfile.c",
131      "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_dfile_session.c",
132      "$NSTACKX_ROOT/nstackx_core/platform/unix/dfile/sys_file_manager.c",
133      "core/nstackx_dfile.c",
134      "core/nstackx_dfile_config.c",
135      "core/nstackx_dfile_control.c",
136      "core/nstackx_dfile_frame.c",
137      "core/nstackx_dfile_mp.c",
138      "core/nstackx_dfile_retransmission.c",
139      "core/nstackx_dfile_send.c",
140      "core/nstackx_dfile_session.c",
141      "core/nstackx_dfile_transfer.c",
142      "core/nstackx_file_list.c",
143      "core/nstackx_file_manager.c",
144      "core/nstackx_file_manager_client.c",
145    ]
146    deps = [
147      "$NSTACKX_ROOT/nstackx_congestion:nstackx_congestion.open",
148      "$NSTACKX_ROOT/nstackx_util:nstackx_util.open",
149      "//third_party/mbedtls",
150      "//utils/native/base:utilsecurec_shared",
151    ]
152    part_name = "dsoftbus_standard"
153    subsystem_name = "communication"
154  }
155}
156