# 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("//arkcompiler/ets_runtime/js_runtime_config.gni") import("//build/ohos.gni") is_cross_platform_build = defined(build_cross_platform_version) && build_cross_platform_version config("ark_ecma_debugger_config") { configs = [ "//arkcompiler/ets_runtime:ark_jsruntime_common_config", "//arkcompiler/ets_runtime:ark_jsruntime_public_config", ] include_dirs = [ ".", "//third_party/cJSON", ] } 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", ] } source_set("libark_ecma_debugger_set") { sources = debugger_sources public_configs = [ ":ark_ecma_debugger_config" ] deps = [ "$ark_root/libpandafile:arkfile_header_deps", "//third_party/libuv:uv", ] if (is_cross_platform_build) { deps += [ "//third_party/cJSON:cjson_static" ] } else { deps += [ "//third_party/cJSON:cjson" ] } if (is_mingw || is_mac) { if (is_mingw) { platform = "windows" } else { platform = "mac" } deps += [ "$ark_root/libpandafile:libarkfile_static", "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_$platform", ] defines = [ "ENABLE_HILOG" ] } if (is_ohos && is_standard_system) { if (enable_hilog) { defines = [ "ENABLE_HILOG" ] include_dirs = [ "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" ] } 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" ] } ohos_shared_library("libark_ecma_debugger") { deps = [ ":libark_ecma_debugger_set", "//arkcompiler/ets_runtime:libark_jsruntime", "//third_party/libuv:uv", ] install_enable = true if (is_ohos && is_standard_system) { if (enable_hilog) { external_deps = [ "hiviewdfx_hilog_native:libhilog" ] } } if (!is_mingw && !is_mac) { output_extension = "so" } if (!is_standard_system) { relative_install_dir = "ark" } part_name = "toolchain" subsystem_name = "arkcompiler" } source_set("libark_ecma_debugger_test_set") { sources = debugger_sources public_configs = [ ":ark_ecma_debugger_config" ] defines = [ "DEBUGGER_TEST" ] if (is_ohos && is_standard_system) { if (enable_hilog) { defines += [ "ENABLE_HILOG" ] include_dirs = [ "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" ] } } deps = [ "$ark_root/libpandafile:arkfile_header_deps", "//third_party/libuv:uv", ] if (is_cross_platform_build) { deps += [ "//third_party/cJSON:cjson_static" ] } else { deps += [ "//third_party/cJSON:cjson" ] } } ohos_shared_library("libark_ecma_debugger_test") { deps = [ ":libark_ecma_debugger_test_set", "//arkcompiler/ets_runtime:libark_jsruntime_test", "//third_party/libuv:uv", ] if (is_ohos && is_standard_system) { if (enable_hilog) { external_deps = [ "hiviewdfx_hilog_native:libhilog" ] } } public_configs = [ ":ark_ecma_debugger_config" ] install_enable = false output_extension = "so" subsystem_name = "test" }