Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

'clang%': 0,
'error_on_warn%': 'false',
'suppress_all_error_on_warn%': 'false',

'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)',
'openssl_no_asm%': 0,
Expand Down
9 changes: 9 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
default=None,
help='Turn compiler warnings into errors for node core sources.')

parser.add_argument('--suppress-all-error-on-warn',
action='store_true',
dest='suppress_all_error_on_warn',
default=False,
help='Suppress cases where compiler warnings are turned into errors by default.')

parser.add_argument('--gdb',
action='store_true',
dest='gdb',
Expand Down Expand Up @@ -1397,7 +1403,10 @@ def configure_node(o):
o['variables']['node_use_amaro'] = b(not options.without_amaro)
o['variables']['debug_node'] = b(options.debug_node)
o['default_configuration'] = 'Debug' if options.debug else 'Release'
if options.error_on_warn and options.suppress_all_error_on_warn:
raise Exception('--error_on_warn is incompatible with --suppress_all_error_on_warn.')
o['variables']['error_on_warn'] = b(options.error_on_warn)
o['variables']['suppress_all_error_on_warn'] = b(options.suppress_all_error_on_warn)
o['variables']['use_prefix_to_find_headers'] = b(options.use_prefix_to_find_headers)

host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc()
Expand Down
5 changes: 3 additions & 2 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,6 @@
'openssl_default_cipher_list%': '',
},

'cflags': ['-Werror=unused-result'],

'defines': [
'NODE_ARCH="<(target_arch)"',
'NODE_PLATFORM="<(OS)"',
Expand All @@ -893,6 +891,9 @@
'NODE_OPENSSL_DEFAULT_CIPHER_LIST="<(openssl_default_cipher_list)"'
]
}],
[ 'suppress_all_error_on_warn=="false"', {
'cflags': ['-Werror=unused-result'],
}],
[ 'error_on_warn=="true"', {
'cflags': ['-Werror'],
'xcode_settings': {
Expand Down
Loading