How to make node-waf build binaries with debug symbols?
Question
Running node-waf with --verbose shows it uses g++ with -g. It seems to be default. I can't find an obvious way to tell node-waf to build node.js extensions without debug symbols. Is there a straight forward way?
Edit: I know how to add compiler options. The question would be how to remove a certain option?
Solution
I found the solution myself. Not sure whether this is the best solution. Just overwriting the CXXFLAGS seems to do what I want.
import Options
def set_options(ctx):
ctx.tool_options('compiler_cxx')
ctx.add_option('--mode', action='store', default='release', help='Compile mode: release or debug')
def configure(ctx):
ctx.check_tool('compiler_cxx')
ctx.check_tool('node_addon')
if Options.options.mode == 'release':
ctx.env['CXXFLAGS'] = ['-O3']
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow