• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cflags = [
2  "-DCOAP_SUPPORT_SOCKET_BROADCAST",
3  "-DCOAP_USER_DEFAULT_PORT=5684",
4  "-Wall",
5  "-fPIC",
6]
7
8cflags_cc = cflags
9
10config("libcoap_config") {
11  include_dirs = [
12    "include",
13    "//third_party/bounds_checking_function/include",
14  ]
15  if (defined(ohos_lite)) {
16    defines = [ "_GNU_SOURCE" ]
17  }
18}
19
20src = [
21  "src/coap_address.c",
22  "src/coap_async.c",
23  "src/coap_block.c",
24  "src/coap_cache.c",
25  "src/coap_debug.c",
26  "src/coap_dtls.c",
27  "src/coap_event.c",
28  "src/coap_hashkey.c",
29  "src/coap_io.c",
30  "src/coap_layers.c",
31  "src/coap_notls.c",
32  "src/coap_netif.c",
33  "src/coap_prng.c",
34  "src/coap_session.c",
35  "src/coap_tcp.c",
36  "src/coap_time.c",
37  "src/coap_encode.c",
38  "src/coap_mem.c",
39  "src/coap_net.c",
40  "src/coap_option.c",
41  "src/coap_oscore.c",
42  "src/coap_pdu.c",
43  "src/coap_resource.c",
44  "src/coap_str.c",
45  "src/coap_subscribe.c",
46  "src/coap_uri.c",
47  "src/coap_ws.c",
48]
49
50source_set("libcoap_src") {
51  sources = src
52  configs += [ ":libcoap_config" ]
53}
54
55deps_with_static = [
56  ":libcoap_src",
57  "//third_party/bounds_checking_function:libsec_static",
58]
59
60deps_with_shared = [
61  ":libcoap_src",
62  "//third_party/bounds_checking_function:libsec_shared",
63]
64
65if (defined(ohos_lite)) {
66  import("//build/lite/config/component/lite_component.gni")
67
68  static_library("libcoap_static") {
69    deps = deps_with_static
70    public_configs = [ ":libcoap_config" ]
71  }
72
73  shared_library("libcoap") {
74    deps = deps_with_shared
75    public_configs = [ ":libcoap_config" ]
76  }
77} else {
78  import("//build/ohos.gni")
79
80  ohos_static_library("libcoap_static") {
81    deps = deps_with_static
82    public_configs = [ ":libcoap_config" ]
83  }
84
85  ohos_shared_library("libcoap") {
86    deps = deps_with_shared
87    public_configs = [ ":libcoap_config" ]
88    subsystem_name = "thirdparty"
89    innerapi_tags = [ "platformsdk_indirect" ]
90    if (!defined(oem_commercial_build) || !oem_commercial_build) {
91      defines = [ "STANDARD_SYSTEM_ENABLE" ]
92    }
93    part_name = "libcoap"
94  }
95}
96