| 1 |
if get_option('build-python').disabled() |
| 2 |
subdir_done() |
| 3 |
endif |
| 4 |
|
| 5 |
pylibmount_sources = ''' |
| 6 |
pylibmount.c |
| 7 |
pylibmount.h |
| 8 |
fs.c |
| 9 |
tab.c |
| 10 |
'''.split() |
| 11 |
|
| 12 |
if LINUX |
| 13 |
pylibmount_sources += 'context.c' |
| 14 |
endif |
| 15 |
|
| 16 |
python_module = import('python') |
| 17 |
python = python_module.find_installation( |
| 18 |
get_option('python'), |
| 19 |
required : true, |
| 20 |
disabler : true) |
| 21 |
if meson.version().version_compare('<1.4.1') |
| 22 |
cc.has_header('Python.h', |
| 23 |
include_directories : include_directories(python.get_path('include')), |
| 24 |
required : true) |
| 25 |
endif |
| 26 |
python.extension_module( |
| 27 |
'pylibmount', |
| 28 |
pylibmount_sources, |
| 29 |
include_directories : [dir_include], |
| 30 |
subdir : 'libmount', |
| 31 |
dependencies : [mount_dep, python.dependency(embed: true)], |
| 32 |
c_args : [ |
| 33 |
'-Wno-cast-function-type', |
| 34 |
|
| 35 |
# https://github.com/util-linux/util-linux/issues/2366 |
| 36 |
python.language_version().version_compare('>=3.12') ? |
| 37 |
[ '-Wno-error=redundant-decls' ] : [], |
| 38 |
], |
| 39 |
install : true) |
| 40 |
|
| 41 |
python.install_sources( |
| 42 |
'__init__.py', |
| 43 |
subdir : 'libmount', |
| 44 |
pure : false) |