build: add build option suppress_all_error_on_warn
Add an option to suppress cases where warnings are on by default Signed-off-by: Michael Dawson <midawson@redhat.com> PR-URL: https://github.com/nodejs/node/pull/56647 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
parent
f2d274753a
commit
e6f1ddf33f
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
'clang%': 0,
|
'clang%': 0,
|
||||||
'error_on_warn%': 'false',
|
'error_on_warn%': 'false',
|
||||||
|
'suppress_all_error_on_warn%': 'false',
|
||||||
|
|
||||||
'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)',
|
'openssl_product': '<(STATIC_LIB_PREFIX)openssl<(STATIC_LIB_SUFFIX)',
|
||||||
'openssl_no_asm%': 0,
|
'openssl_no_asm%': 0,
|
||||||
|
@ -149,6 +149,12 @@ parser.add_argument('--error-on-warn',
|
|||||||
default=None,
|
default=None,
|
||||||
help='Turn compiler warnings into errors for node core sources.')
|
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',
|
parser.add_argument('--gdb',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
dest='gdb',
|
dest='gdb',
|
||||||
@ -1397,7 +1403,10 @@ def configure_node(o):
|
|||||||
o['variables']['node_use_amaro'] = b(not options.without_amaro)
|
o['variables']['node_use_amaro'] = b(not options.without_amaro)
|
||||||
o['variables']['debug_node'] = b(options.debug_node)
|
o['variables']['debug_node'] = b(options.debug_node)
|
||||||
o['default_configuration'] = 'Debug' if options.debug else 'Release'
|
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']['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)
|
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()
|
host_arch = host_arch_win() if os.name == 'nt' else host_arch_cc()
|
||||||
|
5
node.gyp
5
node.gyp
@ -871,8 +871,6 @@
|
|||||||
'openssl_default_cipher_list%': '',
|
'openssl_default_cipher_list%': '',
|
||||||
},
|
},
|
||||||
|
|
||||||
'cflags': ['-Werror=unused-result'],
|
|
||||||
|
|
||||||
'defines': [
|
'defines': [
|
||||||
'NODE_ARCH="<(target_arch)"',
|
'NODE_ARCH="<(target_arch)"',
|
||||||
'NODE_PLATFORM="<(OS)"',
|
'NODE_PLATFORM="<(OS)"',
|
||||||
@ -893,6 +891,9 @@
|
|||||||
'NODE_OPENSSL_DEFAULT_CIPHER_LIST="<(openssl_default_cipher_list)"'
|
'NODE_OPENSSL_DEFAULT_CIPHER_LIST="<(openssl_default_cipher_list)"'
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
|
[ 'suppress_all_error_on_warn=="false"', {
|
||||||
|
'cflags': ['-Werror=unused-result'],
|
||||||
|
}],
|
||||||
[ 'error_on_warn=="true"', {
|
[ 'error_on_warn=="true"', {
|
||||||
'cflags': ['-Werror'],
|
'cflags': ['-Werror'],
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user