diff --git a/meson.build b/meson.build index c9a260572bb976fa33084440ffcb92f7522d34ff..0f806db3072ba836a789639ff6b5037c3578f344 100644 --- a/meson.build +++ b/meson.build @@ -74,26 +74,45 @@ opendht = shared_library('opendht', install : true) 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() dhtnode = executable('dhtnode', 'tools/dhtnode.cpp', include_directories : opendht_interface_inc, link_with : opendht, - dependencies : [readline, msgpack, fmt], + dependencies : [readline, msgpack, fmt, openssl], install : true) dhtchat = executable('dhtchat', 'tools/dhtchat.cpp', include_directories : opendht_interface_inc, link_with : opendht, - dependencies : [readline, msgpack, fmt], + dependencies : [readline, msgpack, fmt, openssl], install : true) dhtscanner = executable('dhtscanner', 'tools/dhtscanner.cpp', include_directories : opendht_interface_inc, link_with : opendht, - dependencies : [readline, msgpack, fmt], + dependencies : [readline, msgpack, fmt, openssl], install : true) if http_parser.found() durl = executable('durl', 'tools/durl.cpp', - include_directories : opendht_interface_inc, - link_with : opendht, - dependencies : [msgpack, openssl]) + include_directories : opendht_interface_inc, + link_with : opendht, + dependencies : [msgpack, openssl]) endif endif diff --git a/meson_options.txt b/meson.options similarity index 82% rename from meson_options.txt rename to meson.options index 290179549a9300ee60606a38aec4a735c3e22394..7bed03d1b39ab20793bde3e74a9ba0481fba9295 100644 --- a/meson_options.txt +++ b/meson.options @@ -2,3 +2,4 @@ option('proxy_client', type : 'feature', value : 'disabled') option('proxy_server', type : 'feature', value : 'disabled') option('peer_discovery', type : 'feature', value : 'enabled') option('tools', type : 'feature', value : 'enabled') +option('c', type : 'feature', value : 'enabled')