1# Copyright (c) 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("//arkcompiler/toolchain/toolchain.gni") 15import("//build/ohos.gni") 16import("//foundation/arkui/ace_engine/ace_config.gni") 17 18config("ark_debugger_config") { 19 cflags_cc = [ 20 "-fexceptions", 21 "-fno-complete-member-pointers", 22 "-Wno-implicit-fallthrough", 23 "-fvisibility=default", 24 "-frtti", 25 ] 26} 27 28config("ark_platform_config") { 29 defines = [] 30 if (is_ohos) { 31 defines += [ 32 "OHOS_PLATFORM", 33 "UNIX_PLATFORM", 34 ] 35 } else if (is_mingw) { 36 defines += [ "WINDOWS_PLATFORM" ] 37 } else if (is_mac) { 38 defines += [ 39 "MAC_PLATFORM", 40 "UNIX_PLATFORM", 41 ] 42 } else if (target_os == "android") { 43 defines += [ 44 "ANDROID_PLATFORM", 45 "UNIX_PLATFORM", 46 ] 47 } else if (target_os == "ios") { 48 defines += [ 49 "UNIX_PLATFORM", 50 "IOS_PLATFORM", 51 ] 52 } else { 53 defines += [ "UNIX_PLATFORM" ] 54 } 55} 56 57ohos_shared_library("ark_debugger") { 58 deps = [ ":ark_debugger_static" ] 59 60 if (is_mingw || is_mac) { 61 if (is_mingw) { 62 platform = "windows" 63 ldflags = [ 64 "-lwsock32", 65 "-lws2_32", 66 ] 67 } else { 68 platform = "mac" 69 } 70 deps += [ 71 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_$platform", 72 ] 73 } else if (target_os == "android") { 74 aosp_deps = [ "shared_library:liblog" ] 75 } else { 76 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 77 } 78 79 part_name = "toolchain" 80 subsystem_name = "arkcompiler" 81} 82 83ohos_source_set("ark_debugger_static") { 84 deps = [] 85 defines = [] 86 configs = [] 87 88 defines += [ "ACE_LOG_TAG=\"ArkDebugger\"" ] 89 90 if (is_mingw || is_mac) { 91 cflags = [ "-std=c++17" ] 92 } 93 94 include_dirs = [ 95 "$toolchain_root", 96 "$toolchain_root/websocket", 97 ] 98 99 deps += [ "$toolchain_root/websocket:websocket" ] 100 sources = [ 101 "inspector.cpp", 102 "library_loader.cpp", 103 "ws_server.cpp", 104 ] 105 if (is_ohos) { 106 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 107 } else if (target_os == "android") { 108 sources += [ "log_wrapper.cpp" ] 109 } else { 110 sources += [ "log_wrapper.cpp" ] 111 include_dirs += [ 112 "//arkcompiler/toolchain", 113 "//arkcompiler/ets_runtime", 114 "//arkcompiler/runtime_core", 115 ] 116 configs += [ sdk_libc_secshared_config ] 117 public_deps = [ sdk_libc_secshared_dep ] 118 } 119 120 configs += [ 121 ":ark_debugger_config", 122 ":ark_platform_config", 123 ] 124} 125