• 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
16ctrl_include = [
17  "../nstackx_util/interface",
18  "interface",
19  "include",
20  "include/coap_discover",
21  "//third_party/libcoap/include",
22  "//third_party/cJSON",
23  "//third_party/bounds_checking_function/include",
24]
25
26cflags = [ "-Wall" ]
27include_dirs = []
28
29if (defined(ohos_lite)) {
30  import("//build/lite/config/component/lite_component.gni")
31  config("dfinder_interface") {
32    include_dirs = [ "interface" ]
33  }
34  shared_library("nstackx_ctrl") {
35    sources = [
36      "core/coap_discover/coap_app.c",
37      "core/coap_discover/coap_client.c",
38      "core/coap_discover/coap_discover.c",
39      "core/coap_discover/json_payload.c",
40      "core/nstackx_common.c",
41      "core/nstackx_database.c",
42      "core/nstackx_device.c",
43      "core/nstackx_smartgenius.c",
44    ]
45    include_dirs += ctrl_include
46    public_configs = [ ":dfinder_interface" ]
47    deps = [
48      "../nstackx_util:nstackx_util.open",
49      "//build/lite/config/component/cJSON:cjson_shared",
50      "//third_party/bounds_checking_function:libsec_shared",
51      "//third_party/libcoap:libcoap",
52    ]
53    if (ohos_kernel_type == "liteos_a") {
54      defines = [
55        "NSTACKX_WITH_LITEOS",
56        "LWIP_LITEOS_A_COMPAT",
57      ]
58    }
59    cflags += [
60      "-fPIC",
61      "-std=c99",
62    ]
63    cflags_cc = cflags
64    ldflags = [ "-fPIC" ]
65  }
66} else {
67  import("//build/ohos.gni")
68
69  config("dfinder_interface") {
70    include_dirs = [ "interface" ]
71  }
72  ohos_shared_library("nstackx_ctrl") {
73    cflags_cc = cflags
74    sources = [
75      "core/coap_discover/coap_app.c",
76      "core/coap_discover/coap_client.c",
77      "core/coap_discover/coap_discover.c",
78      "core/coap_discover/json_payload.c",
79      "core/nstackx_common.c",
80      "core/nstackx_database.c",
81      "core/nstackx_device.c",
82      "core/nstackx_smartgenius.c",
83    ]
84    include_dirs += [
85      "//third_party/bounds_checking_function/include",
86      "../nstackx_util/platform/unix",
87    ]
88    include_dirs += ctrl_include
89    public_configs = [ ":dfinder_interface" ]
90    deps = [
91      "../nstackx_util:nstackx_util.open",
92      "//third_party/bounds_checking_function:libsec_static",
93      "//third_party/cJSON:cjson_static",
94      "//third_party/libcoap:libcoap",
95    ]
96    subsystem_name = "communication"
97    part_name = "dsoftbus_standard"
98  }
99}
100