meson: support building python

This commit is contained in:
Adrien Béraud committed 2024-03-24 23:26:05 -04:00
1 parent 5a4c599139
commit 5dc162a4ec
2 files changed
+16 -1

No files matched your search

+15 -1
View File
@@ -1,4 +1,4 @@
project('opendht', 'c', 'cpp',
project('opendht', 'c', 'cpp', 'cython',
version: '3.1.8',
default_options: [
'cpp_std=c++17',
@@ -98,6 +98,20 @@ if get_option('c').enabled()
endif
endif
if get_option('python').require(get_option('indexation').enabled(), error_message: 'python requires indexation').allowed()
py = import('python').find_installation()
dep_py = py.dependency()
py.extension_module(
'opendht',
'python/opendht.pyx',
include_directories : opendht_interface_inc,
override_options : ['cython_language=cpp'],
link_with : [opendht],
dependencies : [msgpack, fmt, dep_py],
install : true
)
endif
if get_option('tools').enabled()
dhtnode = executable('dhtnode', 'tools/dhtnode.cpp',
include_directories : opendht_interface_inc,
+1
View File
@@ -4,3 +4,4 @@ option('peer_discovery', type : 'feature', value : 'enabled')
option('tools', type : 'feature', value : 'enabled')
option('c', type : 'feature', value : 'enabled')
option('indexation', type : 'feature', value : 'enabled')
option('python', type : 'feature', value : 'enabled')