tools: add v8windbg target · nodejs/node@377bdb9
1+{
2+'variables': {
3+'V8_ROOT': '../../deps/v8',
4+'v8_code': 1,
5+ },
6+'includes': ['toolchain.gypi', 'features.gypi'],
7+'targets': [
8+ {
9+# Intermediate target to build v8windbg.dll.
10+# This prevents the dependent settings like node.gypi to link the v8windbg.dll
11+# to the dependent. v8windbg.dll is only supposed to be loaded by WinDbg at debug time.
12+'target_name': 'build_v8windbg',
13+'type': 'none',
14+'hard_dependency': 1,
15+'dependencies': [
16+'v8windbg',
17+ ],
18+ }, # build_v8windbg
19+ {
20+'target_name': 'v8windbg',
21+'type': 'shared_library',
22+'include_dirs': [
23+'<(V8_ROOT)',
24+'<(V8_ROOT)/include',
25+ ],
26+'dependencies': [
27+'v8_debug_helper',
28+'v8.gyp:v8_libbase',
29+ ],
30+'sources': [
31+'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/v8windbg/BUILD.gn" "v8windbg_base.*?sources = ")',
32+'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/v8windbg/BUILD.gn" "v8_shared_library..v8windbg.*?sources = ")',
33+ ],
34+"link_settings": {
35+"libraries": [
36+"-lDbgEng.lib",
37+"-lDbgModel.lib",
38+"-lRuntimeObject.lib",
39+"-lcomsuppwd.lib",
40+ ],
41+ },
42+ }, # v8windbg
43+ {
44+'target_name': 'v8_debug_helper',
45+'type': 'static_library',
46+'include_dirs': [
47+'<(V8_ROOT)',
48+'<(V8_ROOT)/include',
49+ ],
50+'dependencies': [
51+'gen_heap_constants',
52+53+'abseil.gyp:abseil',
54+'v8.gyp:generate_bytecode_builtins_list',
55+'v8.gyp:run_torque',
56+'v8.gyp:v8_maybe_icu',
57+'v8.gyp:fp16',
58+'v8.gyp:v8_libbase',
59+'v8.gyp:v8_snapshot',
60+ ],
61+'sources': [
62+'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/tools/debug_helper/BUILD.gn" "\"v8_debug_helper_internal\".*?sources = ")',
63+"<(SHARED_INTERMEDIATE_DIR)/torque-generated/class-debug-readers.cc",
64+"<(SHARED_INTERMEDIATE_DIR)/torque-generated/class-debug-readers.h",
65+"<(SHARED_INTERMEDIATE_DIR)/torque-generated/debug-macros.cc",
66+"<(SHARED_INTERMEDIATE_DIR)/torque-generated/debug-macros.h",
67+"<(SHARED_INTERMEDIATE_DIR)/torque-generated/instance-types.h",
68+ ],
69+# Enable RTTI //build/config/compiler:rtti
70+'cflags_cc': [ '-frtti' ],
71+'cflags_cc!': [ '-fno-rtti' ],
72+'xcode_settings': {
73+'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
74+ },
75+'msvs_settings': {
76+'VCCLCompilerTool': {
77+'RuntimeTypeInfo': 'true',
78+ },
79+ },
80+'configurations': {
81+'Release': { # Override target_defaults.Release in common.gypi
82+'msvs_settings': {
83+'VCCLCompilerTool': {
84+'RuntimeTypeInfo': 'true',
85+ },
86+ },
87+ },
88+ },
89+ }, # v8_debug_helper
90+ {
91+'target_name': 'gen_heap_constants',
92+'type': 'none',
93+'hard_dependency': 1,
94+'dependencies': [
95+'run_mkgrokdump',
96+ ],
97+'direct_dependent_settings': {
98+'sources': [
99+'<(SHARED_INTERMEDIATE_DIR)/heap-constants-gen.cc',
100+ ],
101+ },
102+'actions': [
103+ {
104+'action_name': 'run_gen_heap_constants',
105+'inputs': [
106+'<(V8_ROOT)/tools/debug_helper/gen-heap-constants.py',
107+ ],
108+'outputs': [
109+'<(SHARED_INTERMEDIATE_DIR)/heap-constants-gen.cc',
110+ ],
111+'action': [
112+'<(python)',
113+'<(V8_ROOT)/tools/debug_helper/gen-heap-constants.py',
114+'<(SHARED_INTERMEDIATE_DIR)',
115+'<@(_outputs)',
116+ ]
117+ }
118+ ]
119+ }, # gen_heap_constants
120+ {
121+'target_name': 'run_mkgrokdump',
122+'type': 'none',
123+'hard_dependency': 1,
124+'dependencies': [
125+'mkgrokdump',
126+ ],
127+'actions': [
128+ {
129+'action_name': 'run_gen_heap_constants',
130+'inputs': [
131+'<(V8_ROOT)/tools/run.py',
132+ ],
133+'outputs': [
134+'<(SHARED_INTERMEDIATE_DIR)/v8heapconst.py',
135+ ],
136+'action': [
137+'<(python)',
138+'<(V8_ROOT)/tools/run.py',
139+'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mkgrokdump<(EXECUTABLE_SUFFIX)',
140+'--outfile',
141+'<@(_outputs)',
142+ ]
143+ }
144+ ]
145+ }, # run_mkgrokdump
146+ {
147+'target_name': 'mkgrokdump',
148+'type': 'executable',
149+'include_dirs': [
150+'<(V8_ROOT)',
151+'<(V8_ROOT)/include',
152+ ],
153+'dependencies': [
154+'abseil.gyp:abseil',
155+'v8.gyp:v8_snapshot',
156+'v8.gyp:v8_libbase',
157+'v8.gyp:v8_libplatform',
158+'v8.gyp:v8_maybe_icu',
159+'v8.gyp:fp16',
160+'v8.gyp:generate_bytecode_builtins_list',
161+'v8.gyp:run_torque',
162+ ],
163+'sources': [
164+'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/test/mkgrokdump/BUILD.gn" "mkgrokdump.*?sources = ")',
165+ ]
166+ }, # mkgrokdump
167+ ],
168+}