Skip to content

Commit 3fe4498

Browse files
refackBridgeAR
authored andcommitted
build: fix c++ code coverage on macOS
PR-URL: #24520 Reviewed-By: Anna Henningsen <[email protected]>
1 parent be54dc0 commit 3fe4498

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

node.gypi

+11-8
Original file line numberDiff line numberDiff line change
@@ -274,25 +274,28 @@
274274
'-Wl,--whole-archive <(v8_base)',
275275
'-Wl,--no-whole-archive' ]
276276
}],
277-
[ 'OS in "mac freebsd linux" and node_shared=="false"'
278-
' and coverage=="true"', {
277+
[ 'coverage=="true" and node_shared=="false" and OS in "mac freebsd linux"', {
278+
'cflags!': [ '-O3' ],
279279
'ldflags': [ '--coverage',
280280
'-g',
281281
'-O0' ],
282282
'cflags': [ '--coverage',
283283
'-g',
284284
'-O0' ],
285-
'cflags!': [ '-O3' ],
286285
'xcode_settings': {
287-
'OTHER_LDFLAGS': [
288-
'--coverage',
289-
],
290-
'OTHER_CFLAGS+': [
286+
'OTHER_CFLAGS': [
291287
'--coverage',
292288
'-g',
293289
'-O0'
294290
],
295-
}
291+
},
292+
'conditions': [
293+
[ '_type=="executable"', {
294+
'xcode_settings': {
295+
'OTHER_LDFLAGS': [ '--coverage', ],
296+
},
297+
}],
298+
],
296299
}],
297300
[ 'OS=="sunos"', {
298301
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],

0 commit comments

Comments
 (0)