python: don't require a Python lib in case we don't link against it. Fixes #4841

In case extensions aren't linked against libpython we can't assume one exists at
all or is available in a known directory.
pull/4883/head
Christoph Reiter 6 years ago committed by Jussi Pakkanen
parent 69cb314718
commit 1bd14b52b2
  1. 7
      mesonbuild/modules/python.py

@ -60,6 +60,7 @@ class PythonDependency(ExternalDependency):
self.pkgdep = None self.pkgdep = None
self.variables = python_holder.variables self.variables = python_holder.variables
self.paths = python_holder.paths self.paths = python_holder.paths
self.link_libpython = python_holder.link_libpython
if mesonlib.version_compare(self.version, '>= 3.0'): if mesonlib.version_compare(self.version, '>= 3.0'):
self.major_version = 3 self.major_version = 3
else: else:
@ -149,11 +150,11 @@ class PythonDependency(ExternalDependency):
libdirs = [] libdirs = []
largs = self.clib_compiler.find_library(libname, environment, libdirs) largs = self.clib_compiler.find_library(libname, environment, libdirs)
if largs is not None:
self.is_found = largs is not None
if self.is_found:
self.link_args = largs self.link_args = largs
self.is_found = largs is not None or not self.link_libpython
inc_paths = mesonlib.OrderedSet([ inc_paths = mesonlib.OrderedSet([
self.variables.get('INCLUDEPY'), self.variables.get('INCLUDEPY'),
self.paths.get('include'), self.paths.get('include'),

Loading…
Cancel
Save