meson: Do not auto build rawimporter when building gluploader

No need to auto build rawimporter if we are building gluploader as it
will be always loaded on startup, but never used.

Skip the build of it when its meson option is set to "auto".
This commit is contained in:
Rafał Dzięgiel
2022-05-06 11:34:46 +02:00
parent b37ab432d7
commit 5b9e7eacba

View File

@@ -1,21 +1,13 @@
gst_clapper_gl_base_importer_dep = dependency('', required: false) gst_clapper_gl_base_importer_dep = dependency('', required: false)
if not get_option('rawimporter').disabled()
library(
'gstclapperrawimporter',
'gstclapperrawimporter.c',
dependencies: gst_clapper_sink_dep,
include_directories: configinc,
c_args: gst_clapper_plugin_args,
install: true,
install_dir: gst_clapper_importers_libdir,
)
endif
plugin_needs_gl_base = ( plugin_needs_gl_base = (
not get_option('glimporter').disabled() not get_option('glimporter').disabled()
or not get_option('gluploader').disabled() or not get_option('gluploader').disabled()
) )
plugin_gl_support_required = (
get_option('glimporter').enabled()
or get_option('gluploader').enabled()
)
gst_plugin_gl_deps = [gstgl_dep, gstglproto_dep] gst_plugin_gl_deps = [gstgl_dep, gstglproto_dep]
have_gtk_gl_windowing = false have_gtk_gl_windowing = false
@@ -39,6 +31,10 @@ if gst_gl_have_window_wayland and gst_gl_have_platform_egl
endif endif
endif endif
if plugin_gl_support_required and not have_gtk_gl_windowing
error('GL-based importer was enabled, but support for current GL windowing is missing')
endif
if gst_gl_have_platform_egl if gst_gl_have_platform_egl
gst_plugin_gl_deps += gstglegl_dep gst_plugin_gl_deps += gstglegl_dep
endif endif
@@ -48,11 +44,9 @@ gst_clapper_gl_base_importer_deps = [
] + gst_plugin_gl_deps ] + gst_plugin_gl_deps
foreach dep : gst_clapper_gl_base_importer_deps foreach dep : gst_clapper_gl_base_importer_deps
if not dep.found() or not have_gtk_gl_windowing if not dep.found()
if get_option('glimporter').enabled() if plugin_gl_support_required
error('GL importer was enabled, but required dependencies were not found') error('GL-based importer was enabled, but required dependencies were not found')
elif get_option('gluploader').enabled()
error('GL uploader was enabled, but required dependencies were not found')
endif endif
plugin_needs_gl_base = false plugin_needs_gl_base = false
endif endif
@@ -73,7 +67,12 @@ if plugin_needs_gl_base
) )
endif endif
if not get_option('glimporter').disabled() and gst_clapper_gl_base_importer_dep.found() build_glimporter = (
not get_option('glimporter').disabled()
and gst_clapper_gl_base_importer_dep.found()
)
if build_glimporter
library( library(
'gstclapperglimporter', 'gstclapperglimporter',
'gstclapperglimporter.c', 'gstclapperglimporter.c',
@@ -85,7 +84,12 @@ if not get_option('glimporter').disabled() and gst_clapper_gl_base_importer_dep.
) )
endif endif
if not get_option('gluploader').disabled() and gst_clapper_gl_base_importer_dep.found() build_gluploader = (
not get_option('gluploader').disabled()
and gst_clapper_gl_base_importer_dep.found()
)
if build_gluploader
library( library(
'gstclappergluploader', 'gstclappergluploader',
'gstclappergluploader.c', 'gstclappergluploader.c',
@@ -96,3 +100,21 @@ if not get_option('gluploader').disabled() and gst_clapper_gl_base_importer_dep.
install_dir: gst_clapper_importers_libdir, install_dir: gst_clapper_importers_libdir,
) )
endif endif
# No need to auto build rawimporter if we are building gluploader
build_rawimporter = (
not get_option('rawimporter').disabled()
and (not build_gluploader or get_option('rawimporter').enabled())
)
if build_rawimporter
library(
'gstclapperrawimporter',
'gstclapperrawimporter.c',
dependencies: gst_clapper_sink_dep,
include_directories: configinc,
c_args: gst_clapper_plugin_args,
install: true,
install_dir: gst_clapper_importers_libdir,
)
endif