Skip to content

Commit c57008e

Browse files
refackBethGriggs
authored andcommitted
build: fix c++ code coverage on macOS
PR-URL: #24520 Reviewed-By: Anna Henningsen <[email protected]>
1 parent 7048cba commit c57008e

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
@@ -269,25 +269,28 @@
269269
'-Wl,--whole-archive <(v8_base)',
270270
'-Wl,--no-whole-archive' ]
271271
}],
272-
[ 'OS in "mac freebsd linux" and node_shared=="false"'
273-
' and coverage=="true"', {
272+
[ 'coverage=="true" and node_shared=="false" and OS in "mac freebsd linux"', {
273+
'cflags!': [ '-O3' ],
274274
'ldflags': [ '--coverage',
275275
'-g',
276276
'-O0' ],
277277
'cflags': [ '--coverage',
278278
'-g',
279279
'-O0' ],
280-
'cflags!': [ '-O3' ],
281280
'xcode_settings': {
282-
'OTHER_LDFLAGS': [
283-
'--coverage',
284-
],
285-
'OTHER_CFLAGS+': [
281+
'OTHER_CFLAGS': [
286282
'--coverage',
287283
'-g',
288284
'-O0'
289285
],
290-
}
286+
},
287+
'conditions': [
288+
[ '_type=="executable"', {
289+
'xcode_settings': {
290+
'OTHER_LDFLAGS': [ '--coverage', ],
291+
},
292+
}],
293+
],
291294
}],
292295
[ 'OS=="sunos"', {
293296
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],

0 commit comments

Comments
 (0)