• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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_shared_library("websocket") {
18  include_dirs = [
19    "async_context/include",
20    "async_work/include",
21    "constant/include",
22    "websocket_exec/include",
23    "websocket_module/include",
24    "$THIRD_PARTY_ROOT/libwebsockets/include",
25  ]
26
27  sources = [
28    "async_context/src/close_context.cpp",
29    "async_context/src/connect_context.cpp",
30    "async_context/src/send_context.cpp",
31    "async_work/src/websocket_async_work.cpp",
32    "constant/src/constant.cpp",
33    "websocket_exec/src/websocket_exec.cpp",
34    "websocket_module/src/websocket_module.cpp",
35  ]
36
37  defines = [ "OHOS_LIBWEBSOCKETS=1" ]
38
39  cflags = [
40    "-fstack-protector-strong",
41    "-D_FORTIFY_SOURCE=2",
42    "-O2",
43  ]
44
45  cflags_cc = [
46    "-fstack-protector-strong",
47    "-D_FORTIFY_SOURCE=2",
48    "-O2",
49  ]
50
51  deps = [
52    "$NETSTACK_DIR/utils/napi_utils:napi_utils",
53    "$THIRD_PARTY_ROOT/libwebsockets:websockets",
54    "$THIRD_PARTY_ROOT/openssl:libssl_shared",
55  ]
56
57  external_deps = [
58    "hilog:libhilog",
59    "napi:ace_napi",
60  ]
61
62  relative_install_dir = "module/net"
63  part_name = "netstack"
64  subsystem_name = "communication"
65}
66