1# Copyright 2019 the V8 project authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import("../../gni/snapshot_toolchain.gni") 6import("../../gni/v8.gni") 7 8config("internal_config") { 9 visibility = [ ":*" ] # Only targets in this file can depend on this. 10 11 if (is_component_build) { 12 defines = [ "BUILDING_V8_DEBUG_HELPER" ] 13 } 14 15 configs = [ "../..:v8_tracing_config" ] 16 17 include_dirs = [ 18 ".", 19 "../..", 20 "$target_gen_dir", 21 "$target_gen_dir/../..", 22 ] 23} 24 25# This config should be applied to code using v8_debug_helper. 26config("external_config") { 27 if (is_component_build) { 28 defines = [ "USING_V8_DEBUG_HELPER" ] 29 } 30 31 configs = [ "../..:external_config" ] 32 33 include_dirs = [ "." ] 34} 35 36action("run_mkgrokdump") { 37 testonly = true 38 visibility = [ ":*" ] 39 40 deps = [ 41 "../..:run_mksnapshot_default", 42 "../../test/mkgrokdump:mkgrokdump($v8_generator_toolchain)", 43 ] 44 45 script = "../run.py" 46 47 outputs = [ "$target_gen_dir/v8heapconst.py" ] 48 49 args = [ 50 "./" + rebase_path( 51 get_label_info( 52 "../../test/mkgrokdump:mkgrokdump($v8_generator_toolchain)", 53 "root_out_dir") + "/mkgrokdump", 54 root_build_dir), 55 "--outfile", 56 rebase_path("$target_gen_dir/v8heapconst.py", root_build_dir), 57 ] 58} 59 60action("gen_heap_constants") { 61 testonly = true 62 visibility = [ ":*" ] 63 deps = [ ":run_mkgrokdump" ] 64 script = "gen-heap-constants.py" 65 outputs = [ "$target_gen_dir/heap-constants-gen.cc" ] 66 args = [ 67 rebase_path(target_gen_dir, root_build_dir), 68 rebase_path("$target_gen_dir/heap-constants-gen.cc", root_build_dir), 69 ] 70} 71 72v8_component("v8_debug_helper") { 73 testonly = true 74 75 public = [ "debug-helper.h" ] 76 77 sources = [ 78 "$target_gen_dir/../../torque-generated/class-debug-readers.cc", 79 "$target_gen_dir/../../torque-generated/class-debug-readers.h", 80 "$target_gen_dir/../../torque-generated/debug-macros.cc", 81 "$target_gen_dir/../../torque-generated/debug-macros.h", 82 "$target_gen_dir/../../torque-generated/instance-types.h", 83 "$target_gen_dir/heap-constants-gen.cc", 84 "compiler-types.cc", 85 "debug-helper-internal.cc", 86 "debug-helper-internal.h", 87 "debug-helper.h", 88 "get-object-properties.cc", 89 "heap-constants.cc", 90 "heap-constants.h", 91 "list-object-classes.cc", 92 ] 93 94 deps = [ 95 ":gen_heap_constants", 96 "../..:generate_bytecode_builtins_list", 97 "../..:run_torque", 98 "../..:v8_headers", 99 "../..:v8_internal_headers", 100 "../..:v8_libbase", 101 "../..:v8_shared_internal_headers", 102 "../..:v8_tracing", 103 ] 104 105 configs = [ ":internal_config" ] 106 if (v8_enable_i18n_support) { 107 configs += [ "//third_party/icu:icu_config" ] 108 } 109 110 remove_configs = [ "//build/config/compiler:no_rtti" ] 111 configs += [ "//build/config/compiler:rtti" ] 112 113 public_configs = [ ":external_config" ] 114} 115