build: fix c++ code coverage on macOS

PR-URL: https://github.com/nodejs/node/pull/24520
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Refael Ackermann 2018-11-20 11:26:48 -05:00 committed by Rich Trott
parent 0d2311820d
commit eb6741b15e

View File

@ -274,25 +274,28 @@
'-Wl,--whole-archive <(v8_base)', '-Wl,--whole-archive <(v8_base)',
'-Wl,--no-whole-archive' ] '-Wl,--no-whole-archive' ]
}], }],
[ 'OS in "mac freebsd linux" and node_shared=="false"' [ 'coverage=="true" and node_shared=="false" and OS in "mac freebsd linux"', {
' and coverage=="true"', { 'cflags!': [ '-O3' ],
'ldflags': [ '--coverage', 'ldflags': [ '--coverage',
'-g', '-g',
'-O0' ], '-O0' ],
'cflags': [ '--coverage', 'cflags': [ '--coverage',
'-g', '-g',
'-O0' ], '-O0' ],
'cflags!': [ '-O3' ],
'xcode_settings': { 'xcode_settings': {
'OTHER_LDFLAGS': [ 'OTHER_CFLAGS': [
'--coverage',
],
'OTHER_CFLAGS+': [
'--coverage', '--coverage',
'-g', '-g',
'-O0' '-O0'
], ],
} },
'conditions': [
[ '_type=="executable"', {
'xcode_settings': {
'OTHER_LDFLAGS': [ '--coverage', ],
},
}],
],
}], }],
[ 'OS=="sunos"', { [ 'OS=="sunos"', {
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ], 'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],