# 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") import("//build/ohos.gni") import("//foundation/arkui/ace_engine/ace_config.gni") config("ark_debugger_config") { cflags_cc = [ "-fexceptions", "-fno-complete-member-pointers", "-Wno-implicit-fallthrough", "-fvisibility=default", "-frtti", ] } config("ark_platform_config") { defines = [] if (is_ohos) { defines += [ "OHOS_PLATFORM", "UNIX_PLATFORM", ] } else if (is_mingw) { defines += [ "WINDOWS_PLATFORM" ] } else if (is_mac) { defines += [ "MAC_PLATFORM", "UNIX_PLATFORM", ] } else if (target_os == "android") { defines += [ "ANDROID_PLATFORM", "UNIX_PLATFORM", ] } else if (target_os == "ios") { defines += [ "UNIX_PLATFORM", "IOS_PLATFORM", ] } else { defines += [ "UNIX_PLATFORM" ] } } ohos_shared_library("ark_debugger") { deps = [ ":ark_debugger_static" ] if (is_mingw || is_mac) { if (is_mingw) { platform = "windows" ldflags = [ "-lwsock32", "-lws2_32", ] } else { platform = "mac" } deps += [ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_$platform", ] } else if (target_os == "android") { aosp_deps = [ "shared_library:liblog" ] } else { external_deps = [ "hiviewdfx_hilog_native:libhilog" ] } part_name = "toolchain" subsystem_name = "arkcompiler" } ohos_source_set("ark_debugger_static") { deps = [] defines = [] configs = [] defines += [ "ACE_LOG_TAG=\"ArkDebugger\"" ] if (is_mingw || is_mac) { cflags = [ "-std=c++17" ] } include_dirs = [ "$toolchain_root", "$toolchain_root/websocket", ] deps += [ "$toolchain_root/websocket:websocket" ] sources = [ "inspector.cpp", "library_loader.cpp", "ws_server.cpp", ] if (is_ohos) { external_deps = [ "hiviewdfx_hilog_native:libhilog" ] } else if (target_os == "android") { sources += [ "log_wrapper.cpp" ] } else { sources += [ "log_wrapper.cpp" ] include_dirs += [ "//arkcompiler/toolchain", "//arkcompiler/ets_runtime", "//arkcompiler/runtime_core", ] configs += [ sdk_libc_secshared_config ] public_deps = [ sdk_libc_secshared_dep ] } configs += [ ":ark_debugger_config", ":ark_platform_config", ] }