Skip to content

Commit aa45d18

Browse files
committed
build: add --debug-symbols to build with -g without enabling DCHECKs
This is useful when debugging release builds on Linux without enabling DCHECKs.
1 parent dcb9573 commit aa45d18

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

configure.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@
107107
default=None,
108108
help='build the Node.js part of the binary with debugging symbols')
109109

110+
parser.add_argument('--debug-symbols',
111+
action='store_true',
112+
dest='debug_symbols',
113+
default=None,
114+
help='add debugging symbols to release builds (adds -g without enabling DCHECKs)')
115+
110116
parser.add_argument('--dest-cpu',
111117
action='store',
112118
dest='dest_cpu',
@@ -1560,6 +1566,9 @@ def configure_node(o):
15601566
o['variables']['control_flow_guard'] = b(options.enable_cfg)
15611567
o['variables']['node_use_amaro'] = b(not options.without_amaro)
15621568
o['variables']['debug_node'] = b(options.debug_node)
1569+
o['variables']['debug_symbols'] = b(options.debug_symbols)
1570+
if options.debug_symbols:
1571+
o['cflags'] += ['-g']
15631572
o['variables']['build_type%'] = 'Debug' if options.debug else 'Release'
15641573
o['default_configuration'] = 'Debug' if options.debug else 'Release'
15651574
if options.error_on_warn and options.suppress_all_error_on_warn:

0 commit comments

Comments
 (0)