meson: Fix disabling of the python support

Cannot call python.dependency() if the python module was not found.
This commit is contained in:
Nirbheek Chauhan 2019-11-07 16:54:32 +05:30
parent 35d140ad92
commit eb1345703d

View file

@ -129,7 +129,11 @@ has_python = false
if build_gir
pymod = import('python')
python = pymod.find_installation(required: get_option('python'))
python_dep = python.dependency(required : get_option('python'))
if python.found()
python_dep = python.dependency(required : get_option('python'))
else
python_dep = dependency('', required: false)
endif
if python_dep.found()
python_abi_flags = python.get_variable('ABIFLAGS', '')
pylib_loc = get_option('libpython-dir')