# 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_config") { defines = [] include_dirs = [ "$toolchain_root/inspector", "//third_party/openssl/include", ] if (is_mingw || is_mac) { cflags = [ "-std=c++17" ] } cflags_cc = [ "-Wno-vla-extension" ] } websocket_configs = [ sdk_libc_secshared_config, "..:ark_toolchain_common_config", ":websocket_config", ] websocket_deps = [ sdk_libc_secshared_dep ] if (is_arkui_x && target_os == "ios") { websocket_deps += [ "$ark_third_party_root/openssl:libcrypto_static" ] } else if (is_mingw) { websocket_deps += [ "$ark_third_party_root/openssl:libcrypto_restool" ] } else { websocket_deps += [ "$ark_third_party_root/openssl:libcrypto_shared" ] } # hiviewdfx libraries websocket_ext_deps = hiviewdfx_ext_deps ohos_source_set("websocket_base") { stack_protector_ret = false configs = websocket_configs external_deps = websocket_ext_deps deps = websocket_deps if (target_os == "android" && !ark_standalone_build) { libs = [ "log" ] } sources = [ "frame_builder.cpp", "handshake_helper.cpp", "http.cpp", "network.cpp", "websocket_base.cpp", ] subsystem_name = "arkcompiler" part_name = "toolchain" } ohos_source_set("websocket_server") { stack_protector_ret = false configs = websocket_configs external_deps = websocket_ext_deps deps = websocket_deps deps += [ ":websocket_base" ] if (target_os == "android" && !ark_standalone_build) { libs = [ "log" ] } sources = [ "server/websocket_server.cpp" ] subsystem_name = "arkcompiler" part_name = "toolchain" } ohos_source_set("websocket_client") { stack_protector_ret = false configs = websocket_configs 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" }