Commit cd192cd4429 for nodejs
commit cd192cd4429475f644270e791a9b802778ef4e78
Author: Antoine du Hamel <duhamelantoine1995@gmail.com>
Date: Mon Oct 19 10:58:24 2026 +0200
build: load `gtest_main` using pkg-config
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66675
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
diff --git a/configure.py b/configure.py
index dc4bc3cd6b7..e353748d8b7 100755
--- a/configure.py
+++ b/configure.py
@@ -319,7 +319,7 @@ shared_optgroup.add_argument('--shared-gtest-includes',
shared_optgroup.add_argument('--shared-gtest-libname',
action='store',
dest='shared_gtest_libname',
- default='gtest',
+ default='gtest_main,gtest',
help='alternative lib name to link to [default: %(default)s]')
shared_optgroup.add_argument('--shared-gtest-libpath',
@@ -2968,7 +2968,7 @@ configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc'])
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 a626477c380..a8ec3d5351a 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' ],