]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Correctly require the Python.h header for the python dependency
authorJordan Williams <jordan@jwillikers.com>
Tue, 7 May 2024 14:40:44 +0000 (09:40 -0500)
committerJordan Williams <jordan@jwillikers.com>
Thu, 9 May 2024 21:49:01 +0000 (16:49 -0500)
The current solution to require the Python.h header works around a bug
in Meson that has been fixed for version 1.4.1 of Meson.
Refer to https://github.com/mesonbuild/meson/issues/12862.
This change uses an explicit check for the Python.h include.
This verifies the required header exists.
This check is only necessary prior to version 1.4.1 of Meson.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
libmount/python/meson.build

index 2c95365ba6d99766d53f0b7a044b75210dce4fff..ece8ecc7cae4168458f144884c7a5399199ba09f 100644 (file)
@@ -18,6 +18,11 @@ python = python_module.find_installation(
     get_option('python'),
     required : true,
     disabler : true)
+if meson.version().version_compare('<1.4.1')
+  cc.has_header('Python.h',
+    include_directories : include_directories(python.get_path('include')),
+    required : true)
+endif
 python.extension_module(
   'pylibmount',
   pylibmount_sources,