]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Fix build-python option
authorJordan Williams <jordan@jwillikers.com>
Thu, 9 May 2024 20:57:12 +0000 (15:57 -0500)
committerJordan Williams <jordan@jwillikers.com>
Thu, 9 May 2024 21:01:15 +0000 (16:01 -0500)
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 <jordan@jwillikers.com>
libmount/python/meson.build

index 72985eca6b2144ce3c3e82053af86890e1ce9b8b..5dcdf807da89b168e2b7261111076951bc4e59cb 100644 (file)
@@ -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)