meson: Fix disabling of the python support
authorNirbheek Chauhan <nirbheek@centricular.com>
Thu, 7 Nov 2019 11:24:32 +0000 (16:54 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Thu, 7 Nov 2019 11:24:32 +0000 (16:54 +0530)
Cannot call python.dependency() if the python module was not found.

meson.build

index 2704edd90e1068aeb8210986138849efaddaf351..8df03d905a420f239a1db1155ef3f4f0477f2e09 100644 (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')