Skip to content

Commit 658566a

Browse files
committed
build: add --shared-lief configure flag
PR-URL: #61536 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 6521f88 commit 658566a

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

configure.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,28 @@
349349
dest='shared_libuv_libpath',
350350
help='a directory to search for the shared libuv DLL')
351351

352+
shared_optgroup.add_argument('--shared-lief',
353+
action='store_true',
354+
dest='shared_lief',
355+
default=None,
356+
help='link to a shared lief DLL instead of static linking')
357+
358+
shared_optgroup.add_argument('--shared-lief-includes',
359+
action='store',
360+
dest='shared_lief_includes',
361+
help='directory containing lief header files')
362+
363+
shared_optgroup.add_argument('--shared-lief-libname',
364+
action='store',
365+
dest='shared_lief_libname',
366+
default='LIEF',
367+
help='alternative lib name to link to [default: %(default)s]')
368+
369+
shared_optgroup.add_argument('--shared-lief-libpath',
370+
action='store',
371+
dest='shared_lief_libpath',
372+
help='a directory to search for the shared lief DLL')
373+
352374
shared_optgroup.add_argument('--shared-nbytes',
353375
action='store_true',
354376
dest='shared_nbytes',
@@ -1933,6 +1955,14 @@ def without_ssl_error(option):
19331955

19341956
configure_library('openssl', o)
19351957

1958+
def configure_lief(o):
1959+
if options.without_lief:
1960+
if options.shared_lief:
1961+
error('--without-lief is incompatible with --shared-lief')
1962+
return
1963+
1964+
configure_library('lief', o, pkgname='LIEF')
1965+
19361966
def configure_sqlite(o):
19371967
o['variables']['node_use_sqlite'] = b(not options.without_sqlite)
19381968
if options.without_sqlite:
@@ -2390,6 +2420,7 @@ def make_bin_override():
23902420
configure_library('nghttp2', output, pkgname='libnghttp2')
23912421
configure_library('nghttp3', output, pkgname='libnghttp3')
23922422
configure_library('ngtcp2', output, pkgname='libngtcp2')
2423+
configure_lief(output);
23932424
configure_sqlite(output);
23942425
configure_library('uvwasi', output)
23952426
configure_library('zstd', output, pkgname='libzstd')

node.gyp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
'node_shared_hdr_histogram%': 'false',
1919
'node_shared_http_parser%': 'false',
2020
'node_shared_libuv%': 'false',
21+
'node_shared_lief%': 'false',
2122
'node_shared_merve%': 'false',
2223
'node_shared_nbytes%': 'false',
2324
'node_shared_nghttp2%': 'false',
@@ -995,6 +996,13 @@
995996
'<@(node_quic_sources)',
996997
],
997998
}],
999+
[ 'node_use_lief=="true" and node_shared_lief=="false"', {
1000+
'defines': [ 'HAVE_LIEF=1' ],
1001+
'dependencies': [ 'deps/LIEF/lief.gyp:liblief' ],
1002+
}],
1003+
[ 'node_use_lief=="true" and node_shared_lief=="true"', {
1004+
'defines': [ 'HAVE_LIEF=1' ],
1005+
}],
9981006
[ 'node_use_sqlite=="true"', {
9991007
'sources': [
10001008
'<@(node_sqlite_sources)',

0 commit comments

Comments
 (0)