gplugin/gplugin

closing merged branch
draft bugfix/clang-format-tweaks
2020-07-14, Gary Kramlich
731607ef94c6
closing merged branch
if get_option('python3')
if not get_option('gobject-introspection')
error('Python plugin requires GObject Introspection.')
endif
GPLUGIN_PYTHON3_SOURCES = [
'gplugin-python3-core.c',
'gplugin-python3-loader.c',
'gplugin-python3-plugin.c',
'gplugin-python3-utils.c',
]
GPLUGIN_PYTHON3_HEADERS = [
'gplugin-python3-loader.h',
'gplugin-python3-plugin.h',
'gplugin-python3-utils.h',
]
PYTHON3 = dependency('python3-embed', version: '>=3.5.0', required: false)
if not PYTHON3.found()
PYTHON3 = dependency('python3', version: '>=3.5.0')
endif
PYGOBJECT = dependency('pygobject-3.0', version: '>=3.0.0')
# Compile and run our python-gi test program
python3_gi_test = compiler.run(files('gplugin-python3-test-pygobject.c'),
dependencies : [GLIB, PYTHON3, PYGOBJECT],
name : 'Python3 GI')
if not python3_gi_test.compiled() or python3_gi_test.returncode() != 0
error('pygobject does not work with Python3')
endif
# Now add our libraries
gplugin_python3_inc = include_directories('.')
gplugin_python3 = shared_library('gplugin-python3',
GPLUGIN_PYTHON3_SOURCES,
GPLUGIN_PYTHON3_HEADERS,
name_prefix : '',
dependencies : [PYTHON3, PYGOBJECT, gplugin_dep],
install : true,
install_dir : join_paths(get_option('libdir'), 'gplugin')
)
gplugin_python3_dep = declare_dependency(
include_directories : gplugin_python3_inc,
link_with : gplugin_python3,
)
gplugin_python3_static = static_library('gplugin-python3-static',
GPLUGIN_PYTHON3_SOURCES,
GPLUGIN_PYTHON3_HEADERS,
dependencies : [PYTHON3, PYGOBJECT, gplugin_dep],
)
gplugin_python3_static_dep = declare_dependency(
include_directories : gplugin_python3_inc,
link_with : gplugin_python3_static,
)
endif # python3
subdir('tests')