From b66b70d62e50923502aeb3f6420a5f9c20f769d3 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Thu, 9 May 2024 15:57:12 -0500 Subject: [PATCH] meson: Fix build-python option The build-python option is for controlling whether or not pylibmount is built. Unfortunately, commit b6799cc rendered the option unused. This change uses the build-python option again. Signed-off-by: Jordan Williams --- libmount/python/meson.build | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/libmount/python/meson.build b/libmount/python/meson.build index 72985eca6..5dcdf807d 100644 --- a/libmount/python/meson.build +++ b/libmount/python/meson.build @@ -1,4 +1,6 @@ -build_python = python.found() +if get_option('build-python').disabled() + subdir_done() +endif pylibmount_sources = ''' pylibmount.c @@ -11,24 +13,22 @@ if LINUX pylibmount_sources += 'context.c' endif -if build_python - python.extension_module( - 'pylibmount', - pylibmount_sources, - include_directories : [dir_include], - subdir : 'libmount', - dependencies : [mount_dep, python.dependency(embed: true)], - c_args : [ - '-Wno-cast-function-type', +python.extension_module( + 'pylibmount', + pylibmount_sources, + include_directories : [dir_include], + subdir : 'libmount', + dependencies : [mount_dep, python.dependency(embed: true)], + c_args : [ + '-Wno-cast-function-type', - # https://github.com/util-linux/util-linux/issues/2366 - python.language_version().version_compare('>=3.12') ? - [ '-Wno-error=redundant-decls' ] : [], - ], - install : true) + # https://github.com/util-linux/util-linux/issues/2366 + python.language_version().version_compare('>=3.12') ? + [ '-Wno-error=redundant-decls' ] : [], + ], + install : true) - python.install_sources( - '__init__.py', - subdir : 'libmount', - pure : false) -endif +python.install_sources( + '__init__.py', + subdir : 'libmount', + pure : false) -- 2.47.2