1# Copyright 2016 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/v8.gni") 6 7_inspector_protocol = v8_path_prefix + "/third_party/inspector_protocol" 8import("$_inspector_protocol/inspector_protocol.gni") 9 10_protocol_generated = [ 11 "protocol/Forward.h", 12 "protocol/Protocol.cpp", 13 "protocol/Protocol.h", 14 "protocol/Console.cpp", 15 "protocol/Console.h", 16 "protocol/Debugger.cpp", 17 "protocol/Debugger.h", 18 "protocol/HeapProfiler.cpp", 19 "protocol/HeapProfiler.h", 20 "protocol/Profiler.cpp", 21 "protocol/Profiler.h", 22 "protocol/Runtime.cpp", 23 "protocol/Runtime.h", 24 "protocol/Schema.cpp", 25 "protocol/Schema.h", 26 "../../include/inspector/Debugger.h", 27 "../../include/inspector/Runtime.h", 28 "../../include/inspector/Schema.h", 29] 30 31action("protocol_compatibility") { 32 visibility = [ ":*" ] # Only targets in this file can depend on this. 33 script = "$_inspector_protocol/CheckProtocolCompatibility.py" 34 inputs = [ 35 "js_protocol.json", 36 ] 37 _stamp = "$target_gen_dir/js_protocol.stamp" 38 outputs = [ 39 _stamp, 40 ] 41 args = [ 42 "--stamp", 43 rebase_path(_stamp, root_build_dir), 44 rebase_path("js_protocol.json", root_build_dir), 45 ] 46} 47 48inspector_protocol_generate("protocol_generated_sources") { 49 visibility = [ ":*" ] # Only targets in this file can depend on this. 50 deps = [ 51 ":protocol_compatibility", 52 ] 53 54 inspector_protocol_dir = _inspector_protocol 55 out_dir = target_gen_dir 56 config_file = "inspector_protocol_config.json" 57 inputs = [ 58 "js_protocol.json", 59 "inspector_protocol_config.json", 60 ] 61 outputs = _protocol_generated 62} 63 64action("inspector_injected_script") { 65 visibility = [ ":*" ] # Only targets in this file can depend on this. 66 script = "build/xxd.py" 67 inputs = [ 68 "injected-script-source.js", 69 ] 70 outputs = [ 71 "$target_gen_dir/injected-script-source.h", 72 ] 73 args = [ 74 "InjectedScriptSource_js", 75 rebase_path("injected-script-source.js", root_build_dir), 76 rebase_path("$target_gen_dir/injected-script-source.h", root_build_dir), 77 ] 78} 79 80action("inspector_debugger_script") { 81 visibility = [ ":*" ] # Only targets in this file can depend on this. 82 script = "build/xxd.py" 83 inputs = [ 84 "debugger-script.js", 85 ] 86 outputs = [ 87 "$target_gen_dir/debugger-script.h", 88 ] 89 args = [ 90 "DebuggerScript_js", 91 rebase_path("debugger-script.js", root_build_dir), 92 rebase_path("$target_gen_dir/debugger-script.h", root_build_dir), 93 ] 94} 95 96config("inspector_config") { 97 visibility = [ ":*" ] # Only targets in this file can depend on this. 98 cflags = [] 99 if (is_win) { 100 cflags += [ 101 "/wd4267", # Truncation from size_t to int. 102 "/wd4305", # Truncation from 'type1' to 'type2'. 103 "/wd4324", # Struct padded due to declspec(align). 104 "/wd4714", # Function marked forceinline not inlined. 105 "/wd4800", # Value forced to bool. 106 "/wd4996", # Deprecated function call. 107 ] 108 } 109 if (is_component_build) { 110 defines = [ "BUILDING_V8_SHARED" ] 111 } 112} 113 114v8_source_set("inspector") { 115 deps = [ 116 ":inspector_debugger_script", 117 ":inspector_injected_script", 118 ":protocol_generated_sources", 119 ] 120 configs = [ ":inspector_config" ] 121 include_dirs = [ 122 "../..", 123 "../../include", 124 "$target_gen_dir/../..", 125 "$target_gen_dir/../../include", 126 ] 127 sources = rebase_path(_protocol_generated, ".", target_gen_dir) 128 sources += [ 129 "../../include/v8-inspector-protocol.h", 130 "../../include/v8-inspector.h", 131 ] 132 sources += get_target_outputs(":inspector_injected_script") 133 sources += get_target_outputs(":inspector_debugger_script") 134 sources += [ 135 "injected-script-native.cc", 136 "injected-script-native.h", 137 "injected-script.cc", 138 "injected-script.h", 139 "inspected-context.cc", 140 "inspected-context.h", 141 "java-script-call-frame.cc", 142 "java-script-call-frame.h", 143 "remote-object-id.cc", 144 "remote-object-id.h", 145 "script-breakpoint.h", 146 "search-util.cc", 147 "search-util.h", 148 "string-16.cc", 149 "string-16.h", 150 "string-util.cc", 151 "string-util.h", 152 "test-interface.cc", 153 "test-interface.h", 154 "v8-console-agent-impl.cc", 155 "v8-console-agent-impl.h", 156 "v8-console-message.cc", 157 "v8-console-message.h", 158 "v8-console.cc", 159 "v8-console.h", 160 "v8-debugger-agent-impl.cc", 161 "v8-debugger-agent-impl.h", 162 "v8-debugger-script.cc", 163 "v8-debugger-script.h", 164 "v8-debugger.cc", 165 "v8-debugger.h", 166 "v8-function-call.cc", 167 "v8-function-call.h", 168 "v8-heap-profiler-agent-impl.cc", 169 "v8-heap-profiler-agent-impl.h", 170 "v8-injected-script-host.cc", 171 "v8-injected-script-host.h", 172 "v8-inspector-impl.cc", 173 "v8-inspector-impl.h", 174 "v8-inspector-session-impl.cc", 175 "v8-inspector-session-impl.h", 176 "v8-internal-value-type.cc", 177 "v8-internal-value-type.h", 178 "v8-profiler-agent-impl.cc", 179 "v8-profiler-agent-impl.h", 180 "v8-regex.cc", 181 "v8-regex.h", 182 "v8-runtime-agent-impl.cc", 183 "v8-runtime-agent-impl.h", 184 "v8-schema-agent-impl.cc", 185 "v8-schema-agent-impl.h", 186 "v8-stack-trace-impl.cc", 187 "v8-stack-trace-impl.h", 188 "v8-value-copier.cc", 189 "v8-value-copier.h", 190 "wasm-translation.cc", 191 "wasm-translation.h", 192 ] 193} 194