From: Fabian Vogt Date: Wed, 7 Feb 2024 10:48:33 +0000 (+0100) Subject: meson: Only build libmount python module if python was found X-Git-Tag: v2.42-start~540^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=974e1c40e93f7fc916a8211330a1afef2ad7927e;p=thirdparty%2Futil-linux.git meson: Only build libmount python module if python was found The extension_module call was in the wrong place. --- diff --git a/libmount/python/meson.build b/libmount/python/meson.build index c5feb7bccd..e1a79d187d 100644 --- a/libmount/python/meson.build +++ b/libmount/python/meson.build @@ -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',