]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Only build libmount python module if python was found
authorFabian Vogt <fvogt@suse.de>
Wed, 7 Feb 2024 10:48:33 +0000 (11:48 +0100)
committerFabian Vogt <fvogt@suse.de>
Wed, 7 Feb 2024 10:50:04 +0000 (11:50 +0100)
The extension_module call was in the wrong place.

libmount/python/meson.build

index c5feb7bccd8a54f46f7656241a4022d52828fbdf..e1a79d187d26ee961be73bce40e8bcb95f309478 100644 (file)
@@ -17,23 +17,23 @@ if LINUX
   pylibmount_sources += 'context.c'
 endif
 
-python.extension_module(
-  'pylibmount',
-  pylibmount_sources,
-  include_directories : [dir_include, dir_libmount],
-  subdir : 'libmount',
-  link_with : lib_mount,
-  dependencies : python.dependency(),
-  c_args : [
-    '-Wno-cast-function-type',
+if build_python
+  python.extension_module(
+    'pylibmount',
+    pylibmount_sources,
+    include_directories : [dir_include, dir_libmount],
+    subdir : 'libmount',
+    link_with : lib_mount,
+    dependencies : python.dependency(),
+    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)
 
-if build_python
   python.install_sources(
     '__init__.py',
     subdir : 'libmount',