1# Copyright (c) 2021-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("//ark/js_runtime/js_runtime_config.gni") 15import("//build/ohos.gni") 16 17config("ark_ecma_debugger_config") { 18 configs = [ 19 "//ark/js_runtime:ark_jsruntime_common_config", 20 "//ark/js_runtime:ark_jsruntime_public_config", 21 "$ark_root/runtime:arkruntime_public_config", 22 ] 23 24 include_dirs = [ 25 ".", 26 "//third_party/boost", 27 "//third_party/cJSON", 28 ] 29} 30 31debugger_sources = [ 32 "agent/debugger_impl.cpp", 33 # "agent/heapprofiler_impl.cpp", 34 # "agent/profiler_impl.cpp", 35 "agent/runtime_impl.cpp", 36 "backend/debugger_executor.cpp", 37 "backend/js_pt_extractor.cpp", 38 "backend/js_pt_hooks.cpp", 39 "base/pt_events.cpp", 40 "base/pt_json.cpp", 41 "base/pt_params.cpp", 42 "base/pt_returns.cpp", 43 "base/pt_script.cpp", 44 "base/pt_types.cpp", 45 "debugger_service.cpp", 46 "dispatcher.cpp", 47 "protocol_handler.cpp", 48] 49 50source_set("libark_ecma_debugger_set") { 51 sources = debugger_sources 52 53 public_configs = [ ":ark_ecma_debugger_config" ] 54 55 deps = [ 56 "$ark_root/libpandabase:libarkbase", 57 "$ark_root/libpandafile:libarkfile", 58 "//third_party/cJSON:cjson_static", 59 ] 60 61 cflags_cc = [ "-fvisibility=hidden" ] 62} 63 64ohos_shared_library("libark_ecma_debugger") { 65 deps = [ 66 ":libark_ecma_debugger_set", 67 "//ark/js_runtime:libark_jsruntime", 68 ] 69 70 install_enable = true 71 72 output_extension = "so" 73 if (!is_standard_system) { 74 relative_install_dir = "ark" 75 } 76 part_name = "ark_js_runtime" 77 subsystem_name = "ark" 78} 79 80source_set("libark_ecma_debugger_test_set") { 81 sources = debugger_sources 82 83 public_configs = [ ":ark_ecma_debugger_config" ] 84 85 defines = [ "DEBUGGER_TEST" ] 86 87 deps = [ 88 "$ark_root/libpandabase:libarkbase", 89 "$ark_root/libpandafile:libarkfile", 90 "//third_party/cJSON:cjson_static", 91 ] 92} 93 94ohos_shared_library("libark_ecma_debugger_test") { 95 deps = [ 96 ":libark_ecma_debugger_test_set", 97 "//ark/js_runtime:libark_jsruntime_test_set", 98 ] 99 100 if (is_standard_system) { 101 deps += [ "$ark_root/runtime:libarkruntime_static" ] 102 } else { 103 deps += [ "$ark_root/runtime:libarkruntime" ] 104 } 105 106 if (is_ohos && is_standard_system) { 107 if (build_public_version) { 108 external_deps = [ 109 "bytrace_standard:bytrace_core", 110 "hitrace_native:libhitrace", 111 ] 112 } 113 } 114 115 public_configs = [ ":ark_ecma_debugger_config" ] 116 117 install_enable = false 118 119 output_extension = "so" 120 subsystem_name = "test" 121} 122