File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 2626 'uv_library%' : 'static_library' ,
2727
2828 'clang%' : 0 ,
29+ 'error_on_warn%' : '0' ,
2930
3031 'openssl_fips%' : '' ,
3132 'openssl_no_asm%' : 0 ,
219220 # simply not feasible to squelch all warnings, never mind that the
220221 # libraries in deps/ are not under our control.
221222 'conditions' : [
222- ['_target_name!="<(node_lib_target_name)" or '
223- '_target_name!="<(node_core_target_name)"' , {
223+ [ 'error_on_warn=="true" and '
224+ '(_target_name!="<(node_lib_target_name)" or '
225+ '_target_name!="<(node_core_target_name)")' , {
224226 'cflags!' : ['-Werror' ],
225227 }],
226228 ],
Original file line number Diff line number Diff line change 117117 choices = valid_os ,
118118 help = 'operating system to build for ({0})' .format (', ' .join (valid_os )))
119119
120+ parser .add_option ('--error-on-warn' ,
121+ action = 'store_true' ,
122+ dest = 'error_on_warn' ,
123+ help = 'Turn compiler warnings into errors for node core sources.' )
124+
120125parser .add_option ('--gdb' ,
121126 action = 'store_true' ,
122127 dest = 'gdb' ,
@@ -1018,6 +1023,7 @@ def configure_node(o):
10181023 o ['variables' ]['node_install_npm' ] = b (not options .without_npm )
10191024 o ['variables' ]['debug_node' ] = b (options .debug_node )
10201025 o ['default_configuration' ] = 'Debug' if options .debug else 'Release'
1026+ o ['variables' ]['error_on_warn' ] = b (options .error_on_warn )
10211027
10221028 host_arch = host_arch_win () if os .name == 'nt' else host_arch_cc ()
10231029 target_arch = options .dest_cpu or host_arch
Original file line number Diff line number Diff line change 346346 'node.gypi'
347347 ],
348348
349- 'cflags' : [ '-Werror' , ],
350-
351349 'include_dirs' : [
352350 'src' ,
353351 'deps/v8/include'
377375 'msvs_disabled_warnings!' : [4244 ],
378376
379377 'conditions' : [
378+ [ 'error_on_warn=="true"' , {
379+ 'cflags' : ['-Werror' ],
380+ }],
380381 [ 'node_intermediate_lib_type=="static_library" and '
381382 'node_shared=="true" and OS=="aix"' , {
382383 # For AIX, shared lib is linked by static lib and .exp. In the
530531 'node.gypi' ,
531532 ],
532533
533- 'cflags' : [ '-Werror' , ],
534-
535534 'include_dirs' : [
536535 'src' ,
537536 '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
753752 'msvs_disabled_warnings!' : [4244 ],
754753
755754 'conditions' : [
755+ [ 'error_on_warn=="true"' , {
756+ 'cflags' : ['-Werror' ],
757+ }],
756758 [ 'node_builtin_modules_path!=""' , {
757759 'defines' : [ 'NODE_BUILTIN_MODULES_PATH="<(node_builtin_modules_path)"' ]
758760 }],
You can’t perform that action at this time.
0 commit comments