diff --git a/configure.py b/configure.py index c5025c81eb83bb..beb08df0884f76 100755 --- a/configure.py +++ b/configure.py @@ -89,6 +89,11 @@ dest='debug', help='also build debug build') +parser.add_option('--debug-node', + action='store_true', + dest='debug_node', + help='build the Node.js part of the binary with debugging symbols') + parser.add_option('--dest-cpu', action='store', dest='dest_cpu', @@ -975,6 +980,7 @@ def configure_node(o): o['variables']['node_prefix'] = options.prefix o['variables']['node_install_npm'] = b(not options.without_npm) o['variables']['node_report'] = b(not options.without_report) + o['variables']['debug_node'] = b(options.debug_node) o['default_configuration'] = 'Debug' if options.debug else 'Release' host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc() diff --git a/node.gypi b/node.gypi index a83c63e23da7f7..87bcb37fc7f3d5 100644 --- a/node.gypi +++ b/node.gypi @@ -271,6 +271,16 @@ ], }, }], + [ 'debug_node=="true"', { + 'cflags!': [ '-O3' ], + 'cflags': [ '-g', '-O0' ], + 'defines': [ 'DEBUG' ], + 'xcode_settings': { + 'OTHER_CFLAGS': [ + '-g', '-O0' + ], + }, + }], [ 'coverage=="true" and node_shared=="false" and OS in "mac freebsd linux"', { 'cflags!': [ '-O3' ], 'ldflags': [ '--coverage',