• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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("//build/ohos.gni")
15import("//foundation/communication/netstack/netstack_config.gni")
16
17ohos_ndk_library("libnet_websocket") {
18  output_name = "net_websocket"
19  output_extension = "so"
20  ndk_description_file = "./libwebsocket.ndk.json"
21  min_compact_version = "1"
22  system_capability = "SystemCapability.Communication.NetStack"
23  system_capability_headers = [
24    "network/netstack/net_websocket/net_websocket.h",
25    "network/netstack/net_websocket/net_websocket_type.h",
26  ]
27}
28
29ohos_ndk_headers("websocket_header") {
30  dest_dir = "$ndk_headers_out_dir/network/netstack/net_websocket"
31  sources = [
32    "./include/net_websocket.h",
33    "./include/net_websocket_type.h",
34  ]
35}
36
37ohos_shared_library("net_websocket") {
38  output_extension = "so"
39  include_dirs = [
40    "$NETSTACK_DIR/interfaces/kits/c/net_websocket/include",
41    "$NETSTACK_DIR/interfaces/innerkits/websocket_client/include",
42    "$NETSTACK_DIR/frameworks/native/websocket_client/include",
43    "$NETSTACK_DIR/utils/log/include",
44  ]
45
46  sources = [
47    "src/net_websocket.cpp",
48    "src/net_websocket_adapter.cpp",
49  ]
50
51  deps =
52      [ "$NETSTACK_DIR/interfaces/innerkits/websocket_client:websocket_client" ]
53
54  external_deps = [
55    "c_utils:utils",
56    "hilog:libhilog",
57  ]
58
59  cflags = [
60    "-fstack-protector-strong",
61    "-D_FORTIFY_SOURCE=2",
62    "-O2",
63  ]
64
65  cflags_cc = [
66    "-Wall",
67    "-Werror",
68    "-fstack-protector-strong",
69    "-D_FORTIFY_SOURCE=2",
70    "-O2",
71  ]
72
73  part_name = "netstack"
74  subsystem_name = "communication"
75  relative_install_dir = "ndk"
76}
77