1# Copyright (c) 2022-2025 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("//arkcompiler/toolchain/toolchain.gni") 15 16ohos_source_set("ark_debugger_static") { 17 stack_protector_ret = true 18 defines = [] 19 20 if (is_mingw || is_mac) { 21 cflags = [ "-std=c++17" ] 22 } 23 24 include_dirs = [ 25 "$toolchain_root", 26 "$toolchain_root/websocket", 27 ] 28 29 if (target_os == "android" && !ark_standalone_build) { 30 libs = [ "log" ] 31 } 32 33 deps = [ "../websocket:libwebsocket_server" ] 34 sources = [ 35 "../common/log_wrapper.cpp", 36 "inspector.cpp", 37 "init_static.cpp", 38 "library_loader.cpp", 39 "ws_server.cpp", 40 ] 41 42 # hiviewdfx libraries 43 external_deps = hiviewdfx_ext_deps 44 external_deps += [ "bounds_checking_function:libsec_shared" ] 45 deps += hiviewdfx_deps 46 47 if (is_ohos && is_standard_system && !is_arkui_x) { 48 defines += [ "ENABLE_FFRT_INTERFACES" ] 49 external_deps += [ "ffrt:libffrt" ] 50 } 51 52 configs = [ "..:ark_toolchain_common_config" ] 53 subsystem_name = "arkcompiler" 54 part_name = "toolchain" 55} 56 57ohos_shared_library("ark_debugger") { 58 stack_protector_ret = true 59 deps = [ ":ark_debugger_static" ] 60 61 if (is_mingw) { 62 ldflags = [ 63 "-lwsock32", 64 "-lws2_32", 65 ] 66 } 67 if (enable_hilog) { 68 external_deps = [ "hilog:libhilog" ] 69 } 70 subsystem_name = "arkcompiler" 71 part_name = "toolchain" 72 output_name = "ark_inspector" 73} 74 75ohos_source_set("connectserver_debugger_static") { 76 stack_protector_ret = true 77 defines = [] 78 79 if (is_mingw || is_mac) { 80 if (is_mingw) { 81 lib_dirs = [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib" ] 82 libs = [ "wsock32" ] 83 } 84 85 cflags = [ "-std=c++17" ] 86 } 87 88 include_dirs = [ 89 "$toolchain_root", 90 "$toolchain_root/websocket", 91 ] 92 93 external_deps = [] 94 if (is_arkui_x && target_os == "ios") { 95 external_deps += [ "cJSON:cjson_static" ] 96 } else { 97 external_deps += [ "cJSON:cjson" ] 98 } 99 100 deps = [ "../websocket:libwebsocket_server" ] 101 sources = [ 102 "../common/log_wrapper.cpp", 103 "../tooling/dynamic/base/pt_json.cpp", 104 "connect_inspector.cpp", 105 "connect_server.cpp", 106 ] 107 108 if (target_os == "ios") { 109 sources -= [ "../common/log_wrapper.cpp" ] 110 } 111 112 # hiviewdfx libraries 113 external_deps += hiviewdfx_ext_deps 114 external_deps += [ "bounds_checking_function:libsec_shared" ] 115 deps += hiviewdfx_deps 116 configs = [ "..:ark_toolchain_common_config" ] 117 subsystem_name = "arkcompiler" 118 part_name = "toolchain" 119} 120 121ohos_shared_library("connectserver_debugger") { 122 deps = [ ":connectserver_debugger_static" ] 123 if (enable_hilog) { 124 external_deps = [ "hilog:libhilog" ] 125 } 126 subsystem_name = "arkcompiler" 127 part_name = "toolchain" 128 output_name = "ark_connect_inspector" 129} 130