From bd692c4b1a8df76a4ffe18857b893ced26ca1000 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Wed, 31 Oct 2018 14:09:03 -0500 Subject: [PATCH] tools: fix c++ code coverage on macOS Recent libtool on macOS does not support the --coverage flag that was being passed through in the final linking stage. This change patches gyp-mac-tool to not pass the --coverage flag through to libtool. It is now possible to generate code coverage for src/ on macOS. Fixes: https://github.com/nodejs/node/issues/19057 --- tools/gyp/pylib/gyp/xcode_emulation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py index 9481423228ab47..f43c864e5fdb56 100644 --- a/tools/gyp/pylib/gyp/xcode_emulation.py +++ b/tools/gyp/pylib/gyp/xcode_emulation.py @@ -949,6 +949,8 @@ def GetLibtoolflags(self, configname): libtoolflags = [] for libtoolflag in self._Settings().get('OTHER_LDFLAGS', []): + if libtoolflag == "--coverage": + continue libtoolflags.append(libtoolflag) # TODO(thakis): ARCHS?