From d4799b9624dd093011fe0643e31f12b1c38646df Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 12 Oct 2026 10:51:38 +0200 Subject: [PATCH] build: load `gtest_main` using pkg-config Signed-off-by: Antoine du Hamel --- configure.py | 4 ++-- node.gyp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.py b/configure.py index fb742692f530..138de2d8d5a3 100755 --- a/configure.py +++ b/configure.py @@ -319,7 +319,7 @@ shared_optgroup.add_argument('--shared-gtest-libname', action='store', dest='shared_gtest_libname', - default='gtest', + default=None, help='alternative lib name to link to [default: %(default)s]') shared_optgroup.add_argument('--shared-gtest-libpath', @@ -2968,7 +2968,7 @@ def make_bin_override(): configure_library('cares', output, pkgname='libcares') # Only cctest uses gtest; keep it out of the node binary's link line. output['variables']['node_shared_gtest_libraries'] = [] -configure_library('gtest', output, libraries_key='node_shared_gtest_libraries') +configure_library('gtest', output, ['gtest_main', 'gtest'], 'node_shared_gtest_libraries') configure_library('hdr_histogram', output) configure_library('highway', output, pkgname='libhwy') configure_library('merve', output) diff --git a/node.gyp b/node.gyp index a626477c3805..a8ec3d5351a5 100644 --- a/node.gyp +++ b/node.gyp @@ -1388,7 +1388,7 @@ ], }], [ 'node_shared_gtest=="true"', { - 'libraries': [ '-lgtest_main', '<@(node_shared_gtest_libraries)' ], + 'libraries': [ '<@(node_shared_gtest_libraries)' ], }], [ 'node_use_bundled_v8!="false" and node_shared_abseil=="false"', { 'dependencies': [ 'tools/v8_gypfiles/abseil.gyp:abseil' ],