Skip to content

Commit cd192cd

Browse files
authored
build: load gtest_main using pkg-config
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #66675 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 1bc3cda commit cd192cd

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎configure.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
shared_optgroup.add_argument('--shared-gtest-libname',
320320
action='store',
321321
dest='shared_gtest_libname',
322-
default='gtest',
322+
default='gtest_main,gtest',
323323
help='alternative lib name to link to [default: %(default)s]')
324324

325325
shared_optgroup.add_argument('--shared-gtest-libpath',
@@ -2968,7 +2968,7 @@ def make_bin_override():
29682968
configure_library('cares', output, pkgname='libcares')
29692969
# Only cctest uses gtest; keep it out of the node binary's link line.
29702970
output['variables']['node_shared_gtest_libraries'] = []
2971-
configure_library('gtest', output, libraries_key='node_shared_gtest_libraries')
2971+
configure_library('gtest', output, ['gtest_main', 'gtest'], 'node_shared_gtest_libraries')
29722972
configure_library('hdr_histogram', output)
29732973
configure_library('highway', output, pkgname='libhwy')
29742974
configure_library('merve', output)

‎node.gyp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@
13881388
],
13891389
}],
13901390
[ 'node_shared_gtest=="true"', {
1391-
'libraries': [ '-lgtest_main', '<@(node_shared_gtest_libraries)' ],
1391+
'libraries': [ '<@(node_shared_gtest_libraries)' ],
13921392
}],
13931393
[ 'node_use_bundled_v8!="false" and node_shared_abseil=="false"', {
13941394
'dependencies': [ 'tools/v8_gypfiles/abseil.gyp:abseil' ],

0 commit comments

Comments
 (0)