From ff637f14e6ab00e2ad170ff2eeaa0b5b93c1114d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 13 Apr 2017 22:31:44 +0200 Subject: [PATCH] build: disable -O3 for C++ coverage The `cflags` for `--coverage` included `-O0` so far, but that was overridden by a later `-O3`. Resolve that by adding `'cflags!': [ '-O3' ]` and increase coverage accuracy. Ref: https://coverage.nodejs.org/ PR-URL: https://github.com/nodejs/node/pull/12406 Reviewed-By: Refael Ackermann Reviewed-By: Benjamin Gruenbaum Reviewed-By: Michael Dawson Reviewed-By: James M Snell --- node.gypi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node.gypi b/node.gypi index d704834bd338a6..6aaabeed42aac1 100644 --- a/node.gypi +++ b/node.gypi @@ -323,7 +323,8 @@ '-O0' ], 'cflags': [ '--coverage', '-g', - '-O0' ] + '-O0' ], + 'cflags!': [ '-O3' ] }], [ 'OS=="sunos"', { 'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],