# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//arkcompiler/toolchain/toolchain.gni") config("websocket_private_config") { defines = [] if (is_mingw || is_mac) { cflags = [ "-std=c++17" ] } cflags_cc = [ "-Wno-vla-extension" ] } websocket_configs = [ "..:ark_toolchain_common_config", ":websocket_private_config", ] websocket_deps = [] # hiviewdfx libraries websocket_ext_deps = hiviewdfx_ext_deps if (is_arkui_x && target_os == "ios") { websocket_ext_deps += [ "openssl:libcrypto_static" ] } else if (is_mingw) { websocket_ext_deps += [ "openssl:libcrypto_restool" ] } else { websocket_ext_deps += [ "openssl:libcrypto_shared" ] } websocket_ext_deps += [ "bounds_checking_function:libsec_shared" ] websocket_base_source = toolchain_platform_source + [ "frame_builder.cpp", "handshake_helper.cpp", "http.cpp", "network.cpp", "websocket_base.cpp", ] ohos_source_set("websocket_base") { stack_protector_ret = true configs = websocket_configs external_deps = websocket_ext_deps deps = websocket_deps if (target_os == "android" && !ark_standalone_build) { libs = [ "log" ] } sources = websocket_base_source subsystem_name = "arkcompiler" part_name = "toolchain" } config("websocket_public_config") { visibility = [ ":*" ] include_dirs = [ "$toolchain_root/websocket" ] } websocket_server_source = websocket_base_source + [ "server/websocket_server.cpp" ] ohos_static_library("libwebsocket_server") { stack_protector_ret = true configs = websocket_configs public_configs = [ ":websocket_public_config" ] external_deps = websocket_ext_deps deps = websocket_deps if (target_os == "android" && !ark_standalone_build) { libs = [ "log" ] } sources = websocket_server_source subsystem_name = "arkcompiler" part_name = "toolchain" } ohos_source_set("websocket_client") { stack_protector_ret = true configs = websocket_configs public_configs = [ ":websocket_public_config" ] external_deps = websocket_ext_deps deps = websocket_deps deps += [ ":websocket_base" ] if (target_os == "android" && !ark_standalone_build) { libs = [ "log" ] } sources = [ "client/websocket_client.cpp" ] subsystem_name = "arkcompiler" part_name = "toolchain" }