1 project('gst-plugins-bad', 'c', 'cpp',
3 meson_version : '>= 0.59',
4 default_options : [ 'warning_level=1',
5 'buildtype=debugoptimized' ])
7 gst_version = meson.project_version()
8 version_arr = gst_version.split('.')
9 gst_version_major = version_arr[0].to_int()
10 gst_version_minor = version_arr[1].to_int()
11 gst_version_micro = version_arr[2].to_int()
12 if version_arr.length() == 4
13 gst_version_nano = version_arr[3].to_int()
17 gst_version_is_stable = gst_version_minor.is_even()
18 gst_version_is_dev = gst_version_minor.is_odd() and gst_version_micro < 90
20 glib_req = '>= 2.62.0'
23 if gst_version_is_stable
24 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
26 gst_req = '>= ' + gst_version
31 # maintaining compatibility with the previous libtool versioning
32 # current = minor * 100 + micro
33 curversion = gst_version_minor * 100 + gst_version_micro
34 libversion = '@0@.@1@.0'.format(soversion, curversion)
35 osxversion = curversion + 1
37 plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0')
38 static_build = get_option('default_library') == 'static'
42 cc = meson.get_compiler('c')
43 cxx = meson.get_compiler('cpp')
44 host_system = host_machine.system()
46 if host_system in ['ios', 'darwin']
47 have_objc = add_languages('objc', native: false)
48 have_objcpp = add_languages('objcpp', native: false)
54 cdata = configuration_data()
55 cdata.set('ENABLE_NLS', 1)
57 if cc.get_id() == 'msvc'
59 # Ignore several spurious warnings for things gstreamer does very commonly
60 # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
61 # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
62 # NOTE: Only add warnings here if you are sure they're spurious
63 '/wd4018', # implicit signed/unsigned conversion
64 '/wd4146', # unary minus on unsigned (beware INT_MIN)
65 '/wd4244', # lossy type conversion (e.g. double -> int)
66 '/wd4305', # truncating type conversion (e.g. double -> float)
67 '/wd5051', # attribute 'attribute-name' requires at least 'standard-level'; ignored
68 cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
72 # Enable some warnings on MSVC to match GCC/Clang behaviour
73 msvc_args += cc.get_supported_arguments([
74 '/we4002', # too many actual parameters for macro 'identifier'
75 '/we4003', # not enough actual parameters for macro 'identifier'
76 '/we4013', # 'function' undefined; assuming extern returning int
77 '/we4020', # 'function' : too many actual parameters
78 '/we4027', # function declared without formal parameter list
79 '/we4029', # declared formal parameter list different from definition
80 '/we4033', # 'function' must return a value
81 '/we4045', # 'array' : array bounds overflow
82 '/we4047', # 'operator' : 'identifier1' differs in levels of indirection from 'identifier2'
83 '/we4053', # one void operand for '?:'
84 '/we4062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
85 '/we4098', # 'function' : void function returning a value
86 '/we4101', # 'identifier' : unreferenced local variable
87 '/we4189', # 'identifier' : local variable is initialized but not referenced
90 add_project_arguments(msvc_args, language: ['c', 'cpp'])
91 # Disable SAFESEH with MSVC for plugins and libs that use external deps that
92 # are built with MinGW
93 noseh_link_args = ['/SAFESEH:NO']
95 if cxx.has_argument('-Wno-non-virtual-dtor')
96 add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp')
102 if cc.has_link_argument('-Wl,-Bsymbolic-functions')
103 add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
106 # glib doesn't support unloading, which means that unloading and reloading
107 # any library that registers static types will fail
108 if cc.has_link_argument('-Wl,-z,nodelete')
109 add_project_link_arguments('-Wl,-z,nodelete', language: 'c')
111 if cxx.has_link_argument('-Wl,-z,nodelete')
112 add_project_link_arguments('-Wl,-z,nodelete', language: 'cpp')
116 if cc.has_argument('-fvisibility=hidden')
117 add_project_arguments('-fvisibility=hidden', language: 'c')
118 add_project_arguments('-fvisibility=hidden', language: 'cpp')
120 add_project_arguments('-fvisibility=hidden', language: 'objc')
124 # Disable strict aliasing
125 if cc.has_argument('-fno-strict-aliasing')
126 add_project_arguments('-fno-strict-aliasing', language: 'c')
128 if cxx.has_argument('-fno-strict-aliasing')
129 add_project_arguments('-fno-strict-aliasing', language: 'cpp')
132 # Define G_DISABLE_DEPRECATED for development versions
133 if gst_version_is_dev
134 message('Disabling deprecated GLib API')
135 add_project_arguments('-DG_DISABLE_DEPRECATED', language: 'c')
138 cast_checks = get_option('gobject-cast-checks')
139 if cast_checks.disabled() or (cast_checks.auto() and not gst_version_is_dev)
140 message('Disabling GLib cast checks')
141 add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c')
144 glib_asserts = get_option('glib-asserts')
145 if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev)
146 message('Disabling GLib asserts')
147 add_project_arguments('-DG_DISABLE_ASSERT', language: 'c')
150 glib_checks = get_option('glib-checks')
151 if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
152 message('Disabling GLib checks')
153 add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
157 ['HAVE_DLFCN_H', 'dlfcn.h'],
158 ['HAVE_FCNTL_H', 'fcntl.h'],
159 ['HAVE_INTTYPES_H', 'inttypes.h'],
160 ['HAVE_MEMORY_H', 'memory.h'],
161 ['HAVE_NETINET_IN_H', 'netinet/in.h'],
162 ['HAVE_NETINET_IP_H', 'netinet/ip.h'],
163 ['HAVE_NETINET_TCP_H', 'netinet/tcp.h'],
164 ['HAVE_PTHREAD_H', 'pthread.h'],
165 ['HAVE_STDINT_H', 'stdint.h'],
166 ['HAVE_STDLIB_H', 'stdlib.h'],
167 ['HAVE_STRINGS_H', 'strings.h'],
168 ['HAVE_STRING_H', 'string.h'],
169 ['HAVE_SYS_PARAM_H', 'sys/param.h'],
170 ['HAVE_SYS_SOCKET_H', 'sys/socket.h'],
171 ['HAVE_SYS_STAT_H', 'sys/stat.h'],
172 ['HAVE_SYS_TIME_H', 'sys/time.h'],
173 ['HAVE_SYS_TYPES_H', 'sys/types.h'],
174 ['HAVE_SYS_UTSNAME_H', 'sys/utsname.h'],
175 ['HAVE_UNISTD_H', 'unistd.h'],
176 ['HAVE_WINDOWS_H', 'windows.h'],
177 ['HAVE_WINSOCK2_H', 'winsock2.h'],
178 ['HAVE_WS2TCPIP_H', 'ws2tcpip.h'],
181 foreach h : check_headers
182 if cc.has_header(h.get(1))
183 cdata.set(h.get(0), 1)
188 ['HAVE_DCGETTEXT', 'dcgettext'],
189 ['HAVE_GETPAGESIZE', 'getpagesize'],
190 ['HAVE_GMTIME_R', 'gmtime_r'],
191 ['HAVE_MEMFD_CREATE', 'memfd_create'],
192 ['HAVE_MMAP', 'mmap'],
193 ['HAVE_PIPE2', 'pipe2'],
194 ['HAVE_GETRUSAGE', 'getrusage', '#include<sys/resource.h>'],
197 foreach f : check_functions
202 if cc.has_function(f.get(1), prefix: prefix)
203 cdata.set(f.get(0), 1)
207 cdata.set('SIZEOF_CHAR', cc.sizeof('char'))
208 cdata.set('SIZEOF_INT', cc.sizeof('int'))
209 cdata.set('SIZEOF_LONG', cc.sizeof('long'))
210 cdata.set('SIZEOF_SHORT', cc.sizeof('short'))
211 cdata.set('SIZEOF_VOIDP', cc.sizeof('void*'))
213 cdata.set_quoted('VERSION', gst_version)
214 cdata.set_quoted('PACKAGE', 'gst-plugins-bad')
215 cdata.set_quoted('PACKAGE_VERSION', gst_version)
216 cdata.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/new')
217 cdata.set_quoted('PACKAGE_NAME', 'GStreamer Bad Plug-ins')
218 cdata.set_quoted('GETTEXT_PACKAGE', 'gst-plugins-bad-1.0')
219 cdata.set_quoted('GST_API_VERSION', api_version)
220 cdata.set_quoted('GST_LICENSE', 'LGPL')
221 cdata.set_quoted('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
222 cdata.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
225 '-Wmissing-declarations',
231 '-Wmissing-include-dirs',
239 '-Wmissing-prototypes',
240 '-Wold-style-definition',
243 warning_cxx_flags = [
244 '-Wformat-nonliteral',
247 foreach extra_arg : warning_c_flags
248 if cc.has_argument (extra_arg)
249 add_project_arguments([extra_arg], language: 'c')
253 foreach extra_arg : warning_cxx_flags
254 if cxx.has_argument (extra_arg)
255 add_project_arguments([extra_arg], language: 'cpp')
259 foreach extra_arg : warning_flags
260 if cc.has_argument (extra_arg)
261 add_project_arguments([extra_arg], language: 'c')
263 if cxx.has_argument (extra_arg)
264 add_project_arguments([extra_arg], language: 'cpp')
268 # GStreamer package name and origin url
269 gst_package_name = get_option('package-name')
270 if gst_package_name == ''
271 if gst_version_nano == 0
272 gst_package_name = 'GStreamer Bad Plug-ins source release'
273 elif gst_version_nano == 1
274 gst_package_name = 'GStreamer Bad Plug-ins git'
276 gst_package_name = 'GStreamer Bad Plug-ins prerelease'
279 cdata.set_quoted('GST_PACKAGE_NAME', gst_package_name)
280 cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('package-origin'))
282 # FIXME: This should be exposed as a configuration option
283 if host_system == 'linux'
284 cdata.set_quoted('DEFAULT_VIDEOSRC', 'v4l2src')
285 elif ['darwin', 'ios'].contains(host_system)
286 cdata.set_quoted('DEFAULT_VIDEOSRC', 'avfvideosrc')
287 cdata.set_quoted('GST_EXTRA_MODULE_SUFFIX', '.dylib')
288 # Yes, we set this for iOS too. Same as Autotools.
289 cdata.set('HAVE_OSX', 1)
291 cdata.set_quoted('DEFAULT_VIDEOSRC', 'videotestsrc')
295 gst_dep = dependency('gstreamer-1.0', version : gst_req,
296 fallback : ['gstreamer', 'gst_dep'])
297 gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
298 fallback : ['gstreamer', 'gst_base_dep'])
299 gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req,
300 fallback : ['gstreamer', 'gst_net_dep'])
301 gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
302 fallback : ['gstreamer', 'gst_controller_dep'])
304 gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req,
305 fallback : ['gst-plugins-base', 'pbutils_dep'])
306 gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req,
307 fallback : ['gst-plugins-base', 'allocators_dep'])
308 gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req,
309 fallback : ['gst-plugins-base', 'app_dep'])
310 gstaudio_dep = dependency('gstreamer-audio-1.0', version : gst_req,
311 fallback : ['gst-plugins-base', 'audio_dep'])
312 gstfft_dep = dependency('gstreamer-fft-1.0', version : gst_req,
313 fallback : ['gst-plugins-base', 'fft_dep'])
314 gstriff_dep = dependency('gstreamer-riff-1.0', version : gst_req,
315 fallback : ['gst-plugins-base', 'riff_dep'])
316 gstrtp_dep = dependency('gstreamer-rtp-1.0', version : gst_req,
317 fallback : ['gst-plugins-base', 'rtp_dep'])
318 gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req,
319 fallback : ['gst-plugins-base', 'rtsp_dep'])
320 gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req,
321 fallback : ['gst-plugins-base', 'sdp_dep'])
322 gsttag_dep = dependency('gstreamer-tag-1.0', version : gst_req,
323 fallback : ['gst-plugins-base', 'tag_dep'])
324 gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
325 fallback : ['gst-plugins-base', 'video_dep'])
326 gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
327 required : get_option('tests'),
328 fallback : ['gstreamer', 'gst_check_dep'])
331 gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req,
332 fallback : ['gst-plugins-base', 'gstgl_dep'], required: get_option('gl'))
333 gstglproto_dep = dependency('gstreamer-gl-prototypes-1.0', version : gst_req,
334 fallback : ['gst-plugins-base', 'gstglproto_dep'], required: get_option('gl'))
335 gstglx11_dep = dependency('', required : false)
336 gstglwayland_dep = dependency('', required : false)
337 gstglegl_dep = dependency('', required : false)
340 if gstgl_dep.type_name() == 'pkgconfig'
341 gst_gl_apis = gstgl_dep.get_variable('gl_apis').split()
342 gst_gl_winsys = gstgl_dep.get_variable('gl_winsys').split()
343 gst_gl_platforms = gstgl_dep.get_variable('gl_platforms').split()
345 gstbase = subproject('gst-plugins-base')
346 gst_gl_apis = gstbase.get_variable('enabled_gl_apis')
347 gst_gl_winsys = gstbase.get_variable('enabled_gl_winsys')
348 gst_gl_platforms = gstbase.get_variable('enabled_gl_platforms')
351 message('GStreamer OpenGL window systems: @0@'.format(' '.join(gst_gl_winsys)))
352 message('GStreamer OpenGL platforms: @0@'.format(' '.join(gst_gl_platforms)))
353 message('GStreamer OpenGL apis: @0@'.format(' '.join(gst_gl_apis)))
355 foreach ws : ['x11', 'wayland', 'android', 'cocoa', 'eagl', 'win32', 'dispmanx', 'viv_fb']
356 set_variable('gst_gl_have_window_@0@'.format(ws), gst_gl_winsys.contains(ws))
359 foreach p : ['glx', 'egl', 'cgl', 'eagl', 'wgl']
360 set_variable('gst_gl_have_platform_@0@'.format(p), gst_gl_platforms.contains(p))
363 foreach api : ['gl', 'gles2']
364 set_variable('gst_gl_have_api_@0@'.format(api), gst_gl_apis.contains(api))
367 # Behind specific checks because meson fails at optional dependencies with a
368 # fallback to the same subproject. On the first failure, meson will never
369 # check the system again even if the fallback never existed.
370 # Last checked with meson 0.54.3
371 if gst_gl_have_window_x11
372 gstglx11_dep = dependency('gstreamer-gl-x11-1.0', version : gst_req,
373 fallback : ['gst-plugins-base', 'gstglx11_dep'], required: true)
375 if gst_gl_have_window_wayland
376 gstglwayland_dep = dependency('gstreamer-gl-wayland-1.0', version : gst_req,
377 fallback : ['gst-plugins-base', 'gstglwayland_dep'], required: true)
379 if gst_gl_have_platform_egl
380 gstglegl_dep = dependency('gstreamer-gl-egl-1.0', version : gst_req,
381 fallback : ['gst-plugins-base', 'gstglegl_dep'], required: true)
385 libm = cc.find_library('m', required : false)
386 gio_dep = dependency('gio-2.0', version: glib_req)
387 gmodule_dep = dependency('gmodule-no-export-2.0')
388 # gio-unix-2.0 is used by sys/bluez
390 # Optional dep of ext/gl and gst/librfb
391 x11_dep = dependency('x11', required : get_option('x11'))
393 cdata.set('HAVE_X11', 1)
397 # Solaris and Illumos distros split a lot of networking-related code
398 # into '-lsocket -lnsl'. Anything that calls socketpair(), getifaddr(),
399 # etc. probably needs to include network_deps
401 if host_machine.system() == 'sunos'
403 cc.find_library('socket', required: false),
404 cc.find_library('nsl', required: false)
410 if host_machine.system() == 'windows'
411 winsock2 = [cc.find_library('ws2_32')]
413 building_for_win7 = cc.compiles('''#include <windows.h>
415 #error "unknown minimum supported OS version"
417 #if (WINVER < _WIN32_WINNT_WIN7)
418 #error "Windows 7 API is not guaranteed"
421 name: 'building for Windows 7')
423 if not building_for_win7
424 add_project_arguments([
425 '-D_WIN32_WINNT=_WIN32_WINNT_WIN7',
426 '-DWINVER=_WIN32_WINNT_WIN7',
427 ], language: ['c', 'cpp'])
433 if ['darwin', 'ios'].contains(host_system)
435 error('Building on MacOS/iOS/etc requires an ObjC compiler')
437 if host_system == 'ios'
438 cdata.set('HAVE_IOS', 1)
441 avfoundation_dep = dependency('AVFoundation', required : false)
442 if avfoundation_dep.found()
443 cdata.set('HAVE_AVFOUNDATION', 1)
446 videotoolbox_dep = dependency('VideoToolbox', required : false)
447 if videotoolbox_dep.found()
448 cdata.set('HAVE_VIDEOTOOLBOX', 1)
451 # FIXME: framework.version() returns 'unknown'
452 # if videotoolbox_dep.version().version_compare('>=10.9.6')
453 # cdata.set('HAVE_VIDEOTOOLBOX_10_9_6', 1)
460 # Used by various libraries/elements that use Orc code
461 orc_dep = dependency('orc-0.4', version : orc_req, required : get_option('orc'),
462 fallback : ['orc', 'orc_dep'])
463 orcc = find_program('orcc', required : get_option('orc'))
464 if orc_dep.found() and orcc.found()
466 orcc_args = [orcc, '--include', 'glib.h']
467 cdata.set('HAVE_ORC', 1)
469 message('Orc Compiler not found or disabled, will use backup C code')
470 cdata.set('DISABLE_ORC', 1)
472 cdata.set('GST_ENABLE_EXTRA_CHECKS', not get_option('extra-checks').disabled())
474 gnustl_dep = declare_dependency()
475 if host_system == 'android'
476 gnustl_dep = dependency('gnustl', required : false)
481 # TIZEN_FEATURE_XXX can be generally used for all of modules in this subproject
482 cdata.set('TIZEN_FEATURE_FIX_MEMORY_LEAK', true)
483 cdata.set('TIZEN_FEATURE_FIX_SEG_FAULT', true)
485 # TIZEN_FEATURE_[MODULE]_XXX should be used for a particular module
486 cdata.set('TIZEN_FEATURE_ADAPTIVE_MODIFICATION', true)
487 cdata.set('TIZEN_FEATURE_HLSDEMUX_PROPERTY', true)
488 cdata.set('TIZEN_FEATURE_HLSDEMUX_EMPTY_VTT', true)
489 cdata.set('TIZEN_FEATURE_HLSDEMUX_UPDATE_SEGMENT', true)
490 cdata.set('TIZEN_FEATURE_HLSDEMUX_DISCONT_SEQUENCE', true)
491 cdata.set('TIZEN_FEATURE_HLSDEMUX_UPDATE_MANIFEST', true)
492 cdata.set('TIZEN_FEATURE_TSDEMUX_MODIFICATION', true)
493 cdata.set('TIZEN_FEATURE_TSDEMUX_INVALID_PCR_PID', true)
494 cdata.set('TIZEN_FEATURE_TSDEMUX_LANG_TAG', true)
495 cdata.set('TIZEN_FEATURE_TSDEMUX_UPDATE_PMT', true)
496 cdata.set('TIZEN_FEATURE_TSDEMUX_UPDATE_STREAM', true)
497 cdata.set('TIZEN_FEATURE_HLS_WEBVTT', true)
498 cdata.set('TIZEN_FEATURE_OALSINK_MODIFICATION', true)
499 cdata.set('TIZEN_FEATURE_MPEGDEMUX_MODIFICATION', true)
500 cdata.set('TIZEN_FEATURE_H264PARSE_MODIFICATION', true)
501 cdata.set('TIZEN_FEATURE_AD', true)
502 cdata.set('TIZEN_FEATURE_HLSDEMUX_LANG_TAG', true)
503 cdata.set('TIZEN_FEATURE_HLSDEMUX_DISCONT', true)
504 cdata.set('TIZEN_FEATURE_WEBRTC_MODIFICATION', true)
505 cdata.set('TIZEN_FEATURE_WEBRTC_IMPORT_NETSIM', true)
506 cdata.set('TIZEN_FEATURE_PITCH_AUDIO_META', true)
507 cdata.set('TIZEN_FEATURE_SRT_LATENCY', true)
508 if get_option('tv-profile')
509 cdata.set('TIZEN_PROFILE_TV', true)
510 cdata.set('TIZEN_FEATURE_TRUSTZONE', true)
513 # TIZEN_GLOBAL_BUILD_OPTION
514 cdata.set('TIZEN_FEATURE_BASEPARSE_MODIFICATION', true)
515 cdata.set('TIZEN_FEATURE_WAYLAND_ENHANCEMENT', true)
516 cdata.set('USE_TBM', true)
518 # For plugins from libnice
519 libnice_dep = dependency('nice', version : '>=0.1.17', required : get_option('nice'))
521 # TIZEN BUILD OPTION end
523 # Disable compiler warnings for unused variables and args if gst debug system is disabled
524 if gst_dep.type_name() == 'internal'
525 gst_debug_disabled = not subproject('gstreamer').get_variable('gst_debug')
527 # We can't check that in the case of subprojects as we won't
528 # be able to build against an internal dependency (which is not built yet)
529 gst_debug_disabled = cc.has_header_symbol('gst/gstconfig.h', 'GST_DISABLE_GST_DEBUG', dependencies: gst_dep)
532 if gst_debug_disabled
533 message('GStreamer debug system is disabled')
534 if cc.has_argument('-Wno-unused')
535 add_project_arguments('-Wno-unused', language: 'c')
537 if cxx.has_argument ('-Wno-unused')
538 add_project_arguments('-Wno-unused', language: 'cpp')
541 message('GStreamer debug system is enabled')
544 gst_plugins_bad_args = ['-DHAVE_CONFIG_H']
545 configinc = include_directories('.')
546 libsinc = include_directories('gst-libs')
548 python3 = import('python').find_installation()
550 gir = find_program('g-ir-scanner', required : get_option('introspection'))
551 gnome = import('gnome')
552 build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
553 gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
554 'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
555 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
556 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
557 'gst_init(NULL,NULL);', '--quiet']
559 presetdir = join_paths(get_option('datadir'), 'gstreamer-' + api_version, 'presets')
561 pkgconfig = import('pkgconfig')
562 plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
563 if get_option('default_library') == 'shared'
564 # If we don't build static plugins there is no need to generate pc files
565 plugins_pkgconfig_install_dir = disabler()
568 pkgconfig_variables = ['exec_prefix=${prefix}',
569 'toolsdir=${exec_prefix}/bin',
570 'pluginsdir=${libdir}/gstreamer-1.0',
571 'datarootdir=${prefix}/share',
572 'girdir=${datadir}/gir-1.0',
573 'typelibdir=${libdir}/girepository-1.0']
575 pkgconfig_subdirs = ['gstreamer-1.0']
578 libraries : [gst_dep],
579 variables : pkgconfig_variables,
580 subdirs : pkgconfig_subdirs,
581 name : 'gstreamer-plugins-bad-1.0',
582 description : 'Streaming media framework, bad plugins libraries',
585 gpl_allowed = get_option('gpl').allowed()
596 update_orc_dist_files = find_program('scripts/update-orc-dist-files.py')
598 orc_update_targets = []
599 foreach t : orc_targets
600 orc_name = t.get('name')
601 orc_file = t.get('orc-source')
602 header = t.get('header')
603 source = t.get('source')
604 # alias_target() only works with build targets, so can't use run_target() here
605 orc_update_targets += [
606 custom_target('update-orc-@0@'.format(orc_name),
607 input: [header, source],
608 command: [update_orc_dist_files, orc_file, header, source],
609 output: ['@0@-dist.c'.format(orc_name)]) # not entirely true
613 if orc_update_targets.length() > 0
614 update_orc_dist_target = alias_target('update-orc-dist', orc_update_targets)
618 # xgettext is optional (on Windows for instance)
619 if find_program('xgettext', required : get_option('nls')).found()
626 if gst_version_nano == 0
627 extract_release_date = find_program('scripts/extract-release-date-from-doap-file.py')
628 run_result = run_command(extract_release_date, gst_version, files('gst-plugins-bad.doap'), check: true)
629 release_date = run_result.stdout().strip()
630 cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', release_date)
631 message('Package release date: ' + release_date)
634 if gio_dep.version().version_compare('< 2.67.4')
635 cdata.set('g_memdup2(ptr,sz)', '(G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL)')
638 configure_file(output : 'config.h', configuration : cdata)
640 meson.add_dist_script('scripts/gen-changelog.py', meson.project_name(), '1.20.0', meson.project_version())
646 foreach plugin: plugins
647 pkgconfig.generate(plugin, install_dir: plugins_pkgconfig_install_dir)
648 dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
649 meson.override_dependency(plugin.name(), dep)
651 if plugin.name().startswith('gst')
652 plugin_names += [plugin.name().substring(3)]
654 plugin_names += [plugin.name()]
659 'Plugins': plugin_names,
660 '(A)GPL license allowed': gpl_allowed,