]> 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>
Mon, 13 May 2024 12:25:53 +0000 (07:25 -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>
(cherry picked from commit 7e582204cd7cac2b55a2f7c0fb06899fcf7ff5df)

libmount/python/meson.build

index 422ecab8af18aaa5ee6317daa09464e149acab32..a385aae7085d2f49af73ba2eab9c61dcf7ee4493 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,