# Copyright (c) 2021-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("../toolchain.gni") config("hiviewdfx_config") { defines = [] if (enable_dump_in_faultlog) { defines += [ "ENABLE_DUMP_IN_FAULTLOG" ] } if (enable_bytrace) { defines += [ "ENABLE_BYTRACE" ] cflags_cc = [ "-Wno-gnu-zero-variadic-macro-arguments" ] } if (enable_hitrace) { defines += [ "ENABLE_HITRACE" ] } if (enable_hilog) { defines += [ "ENABLE_HILOG" ] } include_dirs = [ "$hilog_root/include" ] } config("ark_ecma_debugger_config") { configs = [ ":hiviewdfx_config", "//arkcompiler/ets_runtime:ark_jsruntime_common_config", "//arkcompiler/ets_runtime:ark_jsruntime_public_config", ] include_dirs = [ ".", "//third_party/cJSON", ] if (!is_mingw && !is_mac && target_os != "ios") { include_dirs += [ "//third_party/libuv/include" ] } } debugger_sources = [ "agent/debugger_impl.cpp", "agent/runtime_impl.cpp", "agent/tracing_impl.cpp", "backend/debugger_executor.cpp", "backend/js_pt_hooks.cpp", "backend/js_single_stepper.cpp", "base/pt_base64.cpp", "base/pt_events.cpp", "base/pt_json.cpp", "base/pt_params.cpp", "base/pt_returns.cpp", "base/pt_script.cpp", "base/pt_types.cpp", "debugger_service.cpp", "dispatcher.cpp", "protocol_handler.cpp", ] if (!is_mingw && !is_mac && target_os != "ios") { debugger_sources += [ "agent/heapprofiler_impl.cpp", "agent/profiler_impl.cpp", ] } ohos_source_set("libark_ecma_debugger_set") { stack_protector_ret = false sources = debugger_sources public_configs = [ ":ark_ecma_debugger_config" ] deps = [] if (is_arkui_x && target_os == "ios") { deps += [ "$ark_third_party_root/cJSON:cjson_static" ] } else { deps += [ "$ark_third_party_root/cJSON:cjson" ] } # hiviewdfx libraries external_deps = hiviewdfx_ext_deps if (!is_arkui_x) { external_deps += [ "runtime_core:libarkfile_static" ] } else { deps += [ "$ark_root/libpandafile:libarkfile_static" ] } deps += hiviewdfx_deps if (enable_leak_check) { sources += [ "$js_root/ecmascript/dfx/native_dfx/backtrace.cpp" ] defines += [ "ECMASCRIPT_ENABLE_HANDLE_LEAK_CHECK", "ECMASCRIPT_ENABLE_GLOBAL_LEAK_CHECK", ] } cflags_cc = [ "-fvisibility=hidden" ] subsystem_name = "arkcompiler" part_name = "toolchain" } ohos_shared_library("libark_ecma_debugger") { stack_protector_ret = false deps = [ ":libark_ecma_debugger_set", "$ark_third_party_root/libuv:uv", ] if (is_mac) { deps += [ "$ark_third_party_root/cJSON:cjson_static" ] } install_enable = true # hiviewdfx libraries external_deps = hiviewdfx_ext_deps if (!is_arkui_x) { external_deps += [ "ets_runtime:libark_jsruntime" ] } else { deps += [ "../../ets_runtime:libark_jsruntime" ] } deps += hiviewdfx_deps if (!is_mingw && !is_mac) { output_extension = "so" } if (!is_standard_system) { relative_install_dir = "ark" } subsystem_name = "arkcompiler" part_name = "toolchain" } ohos_shared_library("libark_ecma_debugger_test") { stack_protector_ret = false sources = debugger_sources public_configs = [ ":ark_ecma_debugger_config" ] defines = [ "OHOS_UNIT_TEST" ] deps = [ "$ark_third_party_root/libuv:uv" ] if (is_arkui_x && target_os == "ios") { deps += [ "$ark_third_party_root/cJSON:cjson_static" ] } else { deps += [ "$ark_third_party_root/cJSON:cjson" ] } external_deps = [ "ets_runtime:libark_jsruntime_test" ] # hiviewdfx libraries external_deps += hiviewdfx_ext_deps deps += hiviewdfx_deps install_enable = false output_extension = "so" subsystem_name = "test" }