From ccbbd538d001ae4e17c86839b0583716e0dd3527 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Jun 2020 18:50:55 +0200 Subject: [WIP] Add Python bindings --- meson.build | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index db138663..5aca9e1d 100644 --- a/meson.build +++ b/meson.build @@ -146,7 +146,14 @@ if host_machine.system() != 'windows' endif # Programs used by the build +cython = find_program('cython3', required: get_option('bindings_py')) +doxygen = find_program('doxygen', required: get_option('docs')) mandoc = find_program('mandoc', required: false) +sphinx_build = find_program( + 'sphinx-build', + required: (get_option('docs').enabled() or + (get_option('bindings_py').enabled() and + get_option('tests')))) # Determine library type and the flags needed to build it library_name = versioned_name @@ -261,6 +268,7 @@ if is_variable('cpp') subdir('bindings/cpp') endif +docdir = get_option('datadir') / 'doc' if not get_option('docs').disabled() subdir('doc') endif @@ -271,9 +279,21 @@ endif subdir('schemas') +# Python bindings +py_dep = disabler() +if not get_option('bindings_py').disabled() + pymod = import('python') + py = pymod.find_installation('python3') + py_dep = py.dependency(required: get_option('bindings_py')) + if py_dep.found() and cython.found() + subdir('bindings/python') + endif +endif + if not meson.is_subproject() and meson.version().version_compare('>=0.53.0') summary('Tests', get_option('tests'), bool_yn: true) summary('Tools', get_option('tools'), bool_yn: true) + summary('Python bindings', py_dep.found() and cython.found(), bool_yn: true) summary('Install prefix', get_option('prefix')) -- cgit v1.2.1