Skip to content

Commit 5e3988d

Browse files
committed
build: turn warnings into errors for node sources
This commit attempts to turn compilation warnings into errors for node's source code. The motivation for this is to enable these errors to be reported by CI runs on pull requests and be able to fix them before they land.
1 parent 5a4f24e commit 5e3988d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

common.gypi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,12 @@
218218
# Forcibly disable -Werror. We support a wide range of compilers, it's
219219
# simply not feasible to squelch all warnings, never mind that the
220220
# libraries in deps/ are not under our control.
221-
'cflags!': ['-Werror'],
221+
'conditions': [
222+
['_target_name!="<(node_lib_target_name)" or '
223+
'_target_name!="<(node_core_target_name)"', {
224+
'cflags!': ['-Werror'],
225+
}],
226+
],
222227
'msvs_settings': {
223228
'VCCLCompilerTool': {
224229
'BufferSecurityCheck': 'true',

node.gyp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@
346346
'node.gypi'
347347
],
348348

349+
'cflags': [ '-Werror', ],
350+
349351
'include_dirs': [
350352
'src',
351353
'deps/v8/include'
@@ -528,6 +530,8 @@
528530
'node.gypi',
529531
],
530532

533+
'cflags': [ '-Werror', ],
534+
531535
'include_dirs': [
532536
'src',
533537
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h

0 commit comments

Comments
 (0)