mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
build: do not include shared gtest in node link path
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/66626 Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
2 files changed
+11
-7
No files matched your search
+9
-6
@@ -1903,9 +1903,10 @@ def configure_napi(output):
|
||||
version = getnapibuildversion.get_napi_version()
|
||||
output['variables']['napi_build_version'] = version
|
||||
|
||||
def configure_library(lib, output, pkgname=None):
|
||||
def configure_library(lib, output, pkgname=None, libraries_key='libraries'):
|
||||
shared_lib = 'shared_' + lib
|
||||
output['variables']['node_' + shared_lib] = b(getattr(options, shared_lib))
|
||||
libraries = output[libraries_key]
|
||||
|
||||
if getattr(options, shared_lib):
|
||||
(pkg_libs, pkg_cflags, pkg_libpath, _) = pkg_config(pkgname or lib)
|
||||
@@ -1924,17 +1925,17 @@ def configure_library(lib, output, pkgname=None):
|
||||
output['msvs_settings']['VCLinkerTool']['AdditionalOptions'] += [
|
||||
f"/LIBPATH:{options.__dict__[shared_lib + '_libpath']}"]
|
||||
else:
|
||||
output['libraries'] += [
|
||||
libraries += [
|
||||
f"-L{options.__dict__[shared_lib + '_libpath']}"]
|
||||
elif pkg_libpath:
|
||||
output['libraries'] += [pkg_libpath]
|
||||
libraries += [pkg_libpath]
|
||||
|
||||
default_libs = getattr(options, shared_lib + '_libname')
|
||||
|
||||
if default_libs:
|
||||
output['libraries'] += [f'-l{l}' for l in default_libs.split(',')]
|
||||
libraries += [f'-l{l}' for l in default_libs.split(',')]
|
||||
elif pkg_libs:
|
||||
output['libraries'] += pkg_libs.split()
|
||||
libraries += pkg_libs.split()
|
||||
|
||||
|
||||
def configure_v8(o, configs):
|
||||
@@ -2526,7 +2527,9 @@ configure_library('simdjson', output)
|
||||
configure_library('simdutf', output)
|
||||
configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc'])
|
||||
configure_library('cares', output, pkgname='libcares')
|
||||
configure_library('gtest', output)
|
||||
# Only cctest uses gtest; keep it out of the node binary's link line.
|
||||
output['variables']['node_shared_gtest_libraries'] = []
|
||||
configure_library('gtest', output, 'node_shared_gtest_libraries')
|
||||
configure_library('hdr_histogram', output)
|
||||
configure_library('merve', output)
|
||||
configure_library('nbytes', output)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
'node_shared_brotli%': 'false',
|
||||
'node_shared_cares%': 'false',
|
||||
'node_shared_gtest%': 'false',
|
||||
'node_shared_gtest_libraries%': [],
|
||||
'node_shared_hdr_histogram%': 'false',
|
||||
'node_shared_http_parser%': 'false',
|
||||
'node_shared_libuv%': 'false',
|
||||
@@ -1309,7 +1310,7 @@
|
||||
],
|
||||
}],
|
||||
[ 'node_shared_gtest=="true"', {
|
||||
'libraries': [ '-lgtest_main' ],
|
||||
'libraries': [ '-lgtest_main', '<@(node_shared_gtest_libraries)' ],
|
||||
}],
|
||||
[ 'node_shared_hdr_histogram=="false"', {
|
||||
'dependencies': [
|
||||
|
||||
Reference in new issue
Block a user