Skip to content
Snippets Groups Projects
Commit 6a6816ad authored by Adrien Béraud's avatar Adrien Béraud
Browse files

build/meson: allow to build c binding

parent 372c87ac
No related branches found
No related tags found
No related merge requests found
...@@ -74,21 +74,40 @@ opendht = shared_library('opendht', ...@@ -74,21 +74,40 @@ opendht = shared_library('opendht',
install : true) install : true)
readline = meson.get_compiler('c').find_library('readline', required: get_option('tools')) readline = meson.get_compiler('c').find_library('readline', required: get_option('tools'))
if get_option('c').enabled()
opendht_c = shared_library('opendht-c',
['c/opendht.cpp', 'c/opendht_c.h'],
include_directories : opendht_interface_inc,
link_with : opendht,
dependencies : [msgpack, fmt],
cpp_args : ['-DOPENDHT_C_BUILD', '-Dopendht_c_EXPORTS'],
install : true)
if get_option('tools').enabled()
dhtcnode = executable('dhtcnode', 'tools/dhtcnode.c',
include_directories : ['c', opendht_interface_inc],
link_with : opendht_c,
dependencies : [readline],
install : true)
endif
endif
if get_option('tools').enabled() if get_option('tools').enabled()
dhtnode = executable('dhtnode', 'tools/dhtnode.cpp', dhtnode = executable('dhtnode', 'tools/dhtnode.cpp',
include_directories : opendht_interface_inc, include_directories : opendht_interface_inc,
link_with : opendht, link_with : opendht,
dependencies : [readline, msgpack, fmt], dependencies : [readline, msgpack, fmt, openssl],
install : true) install : true)
dhtchat = executable('dhtchat', 'tools/dhtchat.cpp', dhtchat = executable('dhtchat', 'tools/dhtchat.cpp',
include_directories : opendht_interface_inc, include_directories : opendht_interface_inc,
link_with : opendht, link_with : opendht,
dependencies : [readline, msgpack, fmt], dependencies : [readline, msgpack, fmt, openssl],
install : true) install : true)
dhtscanner = executable('dhtscanner', 'tools/dhtscanner.cpp', dhtscanner = executable('dhtscanner', 'tools/dhtscanner.cpp',
include_directories : opendht_interface_inc, include_directories : opendht_interface_inc,
link_with : opendht, link_with : opendht,
dependencies : [readline, msgpack, fmt], dependencies : [readline, msgpack, fmt, openssl],
install : true) install : true)
if http_parser.found() if http_parser.found()
durl = executable('durl', 'tools/durl.cpp', durl = executable('durl', 'tools/durl.cpp',
......
...@@ -2,3 +2,4 @@ option('proxy_client', type : 'feature', value : 'disabled') ...@@ -2,3 +2,4 @@ option('proxy_client', type : 'feature', value : 'disabled')
option('proxy_server', type : 'feature', value : 'disabled') option('proxy_server', type : 'feature', value : 'disabled')
option('peer_discovery', type : 'feature', value : 'enabled') option('peer_discovery', type : 'feature', value : 'enabled')
option('tools', type : 'feature', value : 'enabled') option('tools', type : 'feature', value : 'enabled')
option('c', type : 'feature', value : 'enabled')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment