meson: bump meson requirement to >= 0.59
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / meson.build
1 project('gst-plugins-bad', 'c', 'cpp',
2   version : '1.19.2.1',
3   meson_version : '>= 0.59',
4   default_options : [ 'warning_level=1',
5                       'buildtype=debugoptimized' ])
6
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()
14 else
15   gst_version_nano = 0
16 endif
17 gst_version_is_dev = gst_version_minor % 2 == 1 and gst_version_micro < 90
18
19 glib_req = '>= 2.56.0'
20 orc_req = '>= 0.4.17'
21 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
22
23 api_version = '1.0'
24 soversion = 0
25 # maintaining compatibility with the previous libtool versioning
26 # current = minor * 100 + micro
27 curversion = gst_version_minor * 100 + gst_version_micro
28 libversion = '@0@.@1@.0'.format(soversion, curversion)
29 osxversion = curversion + 1
30
31 plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0')
32 static_build = get_option('default_library') == 'static'
33 plugins = []
34 libraries = []
35
36 cc = meson.get_compiler('c')
37 cxx = meson.get_compiler('cpp')
38 host_system = host_machine.system()
39
40 if host_system in ['ios', 'darwin']
41   have_objc = add_languages('objc', native: false)
42   have_objcpp = add_languages('objcpp', native: false)
43 else
44   have_objc = false
45   have_objcpp = false
46 endif
47
48 cdata = configuration_data()
49
50 if cc.get_id() == 'msvc'
51   msvc_args = [
52       # Ignore several spurious warnings for things gstreamer does very commonly
53       # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
54       # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
55       # NOTE: Only add warnings here if you are sure they're spurious
56       '/wd4018', # implicit signed/unsigned conversion
57       '/wd4146', # unary minus on unsigned (beware INT_MIN)
58       '/wd4244', # lossy type conversion (e.g. double -> int)
59       '/wd4305', # truncating type conversion (e.g. double -> float)
60       cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
61
62       # Enable some warnings on MSVC to match GCC/Clang behaviour
63       '/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
64       '/w14101', # 'identifier' : unreferenced local variable
65       '/w14189', # 'identifier' : local variable is initialized but not referenced
66   ]
67   add_project_arguments(msvc_args, language: ['c', 'cpp'])
68   # Disable SAFESEH with MSVC for plugins and libs that use external deps that
69   # are built with MinGW
70   noseh_link_args = ['/SAFESEH:NO']
71 else
72   if cxx.has_argument('-Wno-non-virtual-dtor')
73     add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp')
74   endif
75
76   noseh_link_args = []
77 endif
78
79 if cc.has_link_argument('-Wl,-Bsymbolic-functions')
80   add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
81 endif
82
83 # Symbol visibility
84 if cc.get_id() == 'msvc'
85   export_define = '__declspec(dllexport) extern'
86 elif cc.has_argument('-fvisibility=hidden')
87   add_project_arguments('-fvisibility=hidden', language: 'c')
88   add_project_arguments('-fvisibility=hidden', language: 'cpp')
89   if have_objc
90     add_project_arguments('-fvisibility=hidden', language: 'objc')
91   endif
92   export_define = 'extern __attribute__ ((visibility ("default")))'
93 else
94   export_define = 'extern'
95 endif
96
97 # Passing this through the command line would be too messy
98 cdata.set('GST_API_EXPORT', export_define)
99
100 # Disable strict aliasing
101 if cc.has_argument('-fno-strict-aliasing')
102   add_project_arguments('-fno-strict-aliasing', language: 'c')
103 endif
104 if cxx.has_argument('-fno-strict-aliasing')
105   add_project_arguments('-fno-strict-aliasing', language: 'cpp')
106 endif
107
108 # Define G_DISABLE_DEPRECATED for development versions
109 if gst_version_is_dev
110   message('Disabling deprecated GLib API')
111   add_project_arguments('-DG_DISABLE_DEPRECATED', language: 'c')
112 endif
113
114 cast_checks = get_option('gobject-cast-checks')
115 if cast_checks.disabled() or (cast_checks.auto() and not gst_version_is_dev)
116   message('Disabling GLib cast checks')
117   add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c')
118 endif
119
120 glib_asserts = get_option('glib-asserts')
121 if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev)
122   message('Disabling GLib asserts')
123   add_project_arguments('-DG_DISABLE_ASSERT', language: 'c')
124 endif
125
126 glib_checks = get_option('glib-checks')
127 if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
128   message('Disabling GLib checks')
129   add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
130 endif
131
132 check_headers = [
133   ['HAVE_DLFCN_H', 'dlfcn.h'],
134   ['HAVE_FCNTL_H', 'fcntl.h'],
135   ['HAVE_INTTYPES_H', 'inttypes.h'],
136   ['HAVE_MEMORY_H', 'memory.h'],
137   ['HAVE_NETINET_IN_H', 'netinet/in.h'],
138   ['HAVE_NETINET_IP_H', 'netinet/ip.h'],
139   ['HAVE_NETINET_TCP_H', 'netinet/tcp.h'],
140   ['HAVE_PTHREAD_H', 'pthread.h'],
141   ['HAVE_STDINT_H', 'stdint.h'],
142   ['HAVE_STDLIB_H', 'stdlib.h'],
143   ['HAVE_STRINGS_H', 'strings.h'],
144   ['HAVE_STRING_H', 'string.h'],
145   ['HAVE_SYS_PARAM_H', 'sys/param.h'],
146   ['HAVE_SYS_SOCKET_H', 'sys/socket.h'],
147   ['HAVE_SYS_STAT_H', 'sys/stat.h'],
148   ['HAVE_SYS_TIME_H', 'sys/time.h'],
149   ['HAVE_SYS_TYPES_H', 'sys/types.h'],
150   ['HAVE_SYS_UTSNAME_H', 'sys/utsname.h'],
151   ['HAVE_UNISTD_H', 'unistd.h'],
152   ['HAVE_WINDOWS_H', 'windows.h'],
153   ['HAVE_WINSOCK2_H', 'winsock2.h'],
154   ['HAVE_WS2TCPIP_H', 'ws2tcpip.h'],
155 ]
156
157 foreach h : check_headers
158   if cc.has_header(h.get(1))
159     cdata.set(h.get(0), 1)
160   endif
161 endforeach
162
163 check_functions = [
164   ['HAVE_DCGETTEXT', 'dcgettext'],
165   ['HAVE_GETPAGESIZE', 'getpagesize'],
166   ['HAVE_GMTIME_R', 'gmtime_r'],
167   ['HAVE_MEMFD_CREATE', 'memfd_create'],
168   ['HAVE_MMAP', 'mmap'],
169   ['HAVE_PIPE2', 'pipe2'],
170   ['HAVE_GETRUSAGE', 'getrusage', '#include<sys/resource.h>'],
171 ]
172
173 foreach f : check_functions
174   prefix = ''
175   if f.length() == 3
176     prefix = f.get(2)
177   endif
178   if cc.has_function(f.get(1), prefix: prefix)
179     cdata.set(f.get(0), 1)
180   endif
181 endforeach
182
183 cdata.set('SIZEOF_CHAR', cc.sizeof('char'))
184 cdata.set('SIZEOF_INT', cc.sizeof('int'))
185 cdata.set('SIZEOF_LONG', cc.sizeof('long'))
186 cdata.set('SIZEOF_SHORT', cc.sizeof('short'))
187 cdata.set('SIZEOF_VOIDP', cc.sizeof('void*'))
188
189 cdata.set_quoted('VERSION', gst_version)
190 cdata.set_quoted('PACKAGE', 'gst-plugins-bad')
191 cdata.set_quoted('PACKAGE_VERSION', gst_version)
192 cdata.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/new')
193 cdata.set_quoted('PACKAGE_NAME', 'GStreamer Bad Plug-ins')
194 cdata.set_quoted('GETTEXT_PACKAGE', 'gst-plugins-bad-1.0')
195 cdata.set_quoted('GST_API_VERSION', api_version)
196 cdata.set_quoted('GST_LICENSE', 'LGPL')
197 cdata.set_quoted('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
198 cdata.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
199
200 warning_flags = [
201   '-Wmissing-declarations',
202   '-Wredundant-decls',
203   '-Wwrite-strings',
204   '-Wformat',
205   '-Wformat-security',
206   '-Winit-self',
207   '-Wmissing-include-dirs',
208   '-Waddress',
209   '-Wno-multichar',
210   '-Wvla',
211   '-Wpointer-arith',
212 ]
213
214 warning_c_flags = [
215   '-Wmissing-prototypes',
216   '-Wdeclaration-after-statement',
217   '-Wold-style-definition',
218 ]
219
220 warning_cxx_flags = [
221   '-Wformat-nonliteral',
222 ]
223
224 foreach extra_arg : warning_c_flags
225   if cc.has_argument (extra_arg)
226     add_project_arguments([extra_arg], language: 'c')
227   endif
228 endforeach
229
230 foreach extra_arg : warning_cxx_flags
231   if cxx.has_argument (extra_arg)
232     add_project_arguments([extra_arg], language: 'cpp')
233   endif
234 endforeach
235
236 foreach extra_arg : warning_flags
237   if cc.has_argument (extra_arg)
238     add_project_arguments([extra_arg], language: 'c')
239   endif
240   if cxx.has_argument (extra_arg)
241     add_project_arguments([extra_arg], language: 'cpp')
242   endif
243 endforeach
244
245 # GStreamer package name and origin url
246 gst_package_name = get_option('package-name')
247 if gst_package_name == ''
248   if gst_version_nano == 0
249     gst_package_name = 'GStreamer Bad Plug-ins source release'
250   elif gst_version_nano == 1
251     gst_package_name = 'GStreamer Bad Plug-ins git'
252   else
253     gst_package_name = 'GStreamer Bad Plug-ins prerelease'
254   endif
255 endif
256 cdata.set_quoted('GST_PACKAGE_NAME', gst_package_name)
257 cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('package-origin'))
258
259 # FIXME: This should be exposed as a configuration option
260 if host_system == 'linux'
261   cdata.set_quoted('DEFAULT_VIDEOSRC', 'v4l2src')
262 elif ['darwin', 'ios'].contains(host_system)
263   cdata.set_quoted('DEFAULT_VIDEOSRC', 'avfvideosrc')
264   cdata.set_quoted('GST_EXTRA_MODULE_SUFFIX', '.dylib')
265   # Yes, we set this for iOS too. Same as Autotools.
266   cdata.set('HAVE_OSX', 1)
267 else
268   cdata.set_quoted('DEFAULT_VIDEOSRC', 'videotestsrc')
269 endif
270
271 # Mandatory GST deps
272 gst_dep = dependency('gstreamer-1.0', version : gst_req,
273   fallback : ['gstreamer', 'gst_dep'])
274 gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
275   fallback : ['gstreamer', 'gst_base_dep'])
276 gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req,
277   fallback : ['gstreamer', 'gst_net_dep'])
278 gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
279   fallback : ['gstreamer', 'gst_controller_dep'])
280
281 gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req,
282     fallback : ['gst-plugins-base', 'pbutils_dep'])
283 gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req,
284     fallback : ['gst-plugins-base', 'allocators_dep'])
285 gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req,
286     fallback : ['gst-plugins-base', 'app_dep'])
287 gstaudio_dep = dependency('gstreamer-audio-1.0', version : gst_req,
288     fallback : ['gst-plugins-base', 'audio_dep'])
289 gstfft_dep = dependency('gstreamer-fft-1.0', version : gst_req,
290     fallback : ['gst-plugins-base', 'fft_dep'])
291 gstriff_dep = dependency('gstreamer-riff-1.0', version : gst_req,
292     fallback : ['gst-plugins-base', 'riff_dep'])
293 gstrtp_dep = dependency('gstreamer-rtp-1.0', version : gst_req,
294     fallback : ['gst-plugins-base', 'rtp_dep'])
295 gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req,
296     fallback : ['gst-plugins-base', 'rtsp_dep'])
297 gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req,
298     fallback : ['gst-plugins-base', 'sdp_dep'])
299 gsttag_dep = dependency('gstreamer-tag-1.0', version : gst_req,
300     fallback : ['gst-plugins-base', 'tag_dep'])
301 gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
302     fallback : ['gst-plugins-base', 'video_dep'])
303 gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
304     required : get_option('tests'),
305     fallback : ['gstreamer', 'gst_check_dep'])
306
307 # GStreamer OpenGL
308 gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req,
309     fallback : ['gst-plugins-base', 'gstgl_dep'], required: get_option('gl'))
310 gstglproto_dep = dependency('gstreamer-gl-prototypes-1.0', version : gst_req,
311     fallback : ['gst-plugins-base', 'gstglproto_dep'], required: get_option('gl'))
312 gstglx11_dep = dependency('', required : false)
313 gstglwayland_dep = dependency('', required : false)
314 gstglegl_dep = dependency('', required : false)
315
316 if gstgl_dep.found()
317   if gstgl_dep.type_name() == 'pkgconfig'
318     gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis').split()
319     gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys').split()
320     gst_gl_platforms = gstgl_dep.get_pkgconfig_variable('gl_platforms').split()
321   else
322     gstbase = subproject('gst-plugins-base')
323     gst_gl_apis = gstbase.get_variable('enabled_gl_apis')
324     gst_gl_winsys = gstbase.get_variable('enabled_gl_winsys')
325     gst_gl_platforms = gstbase.get_variable('enabled_gl_platforms')
326   endif
327
328   message('GStreamer OpenGL window systems: @0@'.format(' '.join(gst_gl_winsys)))
329   message('GStreamer OpenGL platforms: @0@'.format(' '.join(gst_gl_platforms)))
330   message('GStreamer OpenGL apis: @0@'.format(' '.join(gst_gl_apis)))
331
332   foreach ws : ['x11', 'wayland', 'android', 'cocoa', 'eagl', 'win32', 'dispmanx', 'viv_fb']
333     set_variable('gst_gl_have_window_@0@'.format(ws), gst_gl_winsys.contains(ws))
334   endforeach
335
336   foreach p : ['glx', 'egl', 'cgl', 'eagl', 'wgl']
337     set_variable('gst_gl_have_platform_@0@'.format(p), gst_gl_platforms.contains(p))
338   endforeach
339
340   foreach api : ['gl', 'gles2']
341     set_variable('gst_gl_have_api_@0@'.format(api), gst_gl_apis.contains(api))
342   endforeach
343
344   # Behind specific checks because meson fails at optional dependencies with a
345   # fallback to the same subproject.  On the first failure, meson will never
346   # check the system again even if the fallback never existed.
347   # Last checked with meson 0.54.3
348   if gst_gl_have_window_x11
349     gstglx11_dep = dependency('gstreamer-gl-x11-1.0', version : gst_req,
350         fallback : ['gst-plugins-base', 'gstglx11_dep'], required: true)
351   endif
352   if gst_gl_have_window_wayland
353     gstglwayland_dep = dependency('gstreamer-gl-wayland-1.0', version : gst_req,
354         fallback : ['gst-plugins-base', 'gstglwayland_dep'], required: true)
355   endif
356   if gst_gl_have_platform_egl
357     gstglegl_dep = dependency('gstreamer-gl-egl-1.0', version : gst_req,
358         fallback : ['gst-plugins-base', 'gstglegl_dep'], required: true)
359   endif
360 endif
361
362 libm = cc.find_library('m', required : false)
363 glib_dep = dependency('glib-2.0', version : glib_req, fallback: ['glib', 'libglib_dep'])
364 gmodule_dep = dependency('gmodule-2.0', fallback: ['glib', 'libgmodule_dep'])
365 gio_dep = dependency('gio-2.0', fallback: ['glib', 'libgio_dep'])
366 # gio-unix-2.0 is used by sys/bluez
367
368 # Optional dep of ext/gl and gst/librfb
369 x11_dep = dependency('x11', required : get_option('x11'))
370 if x11_dep.found()
371   cdata.set('HAVE_X11', 1)
372 endif
373
374 if host_machine.system() == 'windows'
375   winsock2 = [cc.find_library('ws2_32')]
376 else
377   winsock2 = []
378 endif
379
380 if ['darwin', 'ios'].contains(host_system)
381   if not have_objc
382     error('Building on MacOS/iOS/etc requires an ObjC compiler')
383   endif
384   if host_system == 'ios'
385     cdata.set('HAVE_IOS', 1)
386   endif
387
388   avfoundation_dep = dependency('AVFoundation', required : false)
389   if avfoundation_dep.found()
390       cdata.set('HAVE_AVFOUNDATION', 1)
391   endif
392
393   videotoolbox_dep = dependency('VideoToolbox', required : false)
394   if videotoolbox_dep.found()
395       cdata.set('HAVE_VIDEOTOOLBOX', 1)
396   endif
397
398 #  FIXME: framework.version() returns 'unknown'
399 #  if videotoolbox_dep.version().version_compare('>=10.9.6')
400 #    cdata.set('HAVE_VIDEOTOOLBOX_10_9_6', 1)
401 #  endif
402 endif
403
404 have_orcc = false
405 orcc_args = []
406 orc_targets = []
407 # Used by various libraries/elements that use Orc code
408 orc_dep = dependency('orc-0.4', version : orc_req, required : get_option('orc'),
409     fallback : ['orc', 'orc_dep'])
410 orcc = find_program('orcc', required : get_option('orc'))
411 if orc_dep.found() and orcc.found()
412   have_orcc = true
413   orcc_args = [orcc, '--include', 'glib.h']
414   cdata.set('HAVE_ORC', 1)
415 else
416   message('Orc Compiler not found or disabled, will use backup C code')
417   cdata.set('DISABLE_ORC', 1)
418 endif
419 cdata.set('GST_ENABLE_EXTRA_CHECKS', not get_option('extra-checks').disabled())
420
421 gnustl_dep = declare_dependency()
422 if host_system == 'android'
423   gnustl_dep = dependency('gnustl', required : false)
424 endif
425
426 # Disable compiler warnings for unused variables and args if gst debug system is disabled
427 if gst_dep.type_name() == 'internal'
428   gst_debug_disabled = not subproject('gstreamer').get_variable('gst_debug')
429 else
430   # We can't check that in the case of subprojects as we won't
431   # be able to build against an internal dependency (which is not built yet)
432   gst_debug_disabled = cc.has_header_symbol('gst/gstconfig.h', 'GST_DISABLE_GST_DEBUG', dependencies: gst_dep)
433 endif
434
435 if gst_debug_disabled
436   message('GStreamer debug system is disabled')
437   if cc.has_argument('-Wno-unused')
438     add_project_arguments('-Wno-unused', language: 'c')
439   endif
440   if cxx.has_argument ('-Wno-unused')
441     add_project_arguments('-Wno-unused', language: 'cpp')
442   endif
443 else
444   message('GStreamer debug system is enabled')
445 endif
446
447 gst_plugins_bad_args = ['-DHAVE_CONFIG_H']
448 configinc = include_directories('.')
449 libsinc = include_directories('gst-libs')
450
451 python3 = import('python').find_installation()
452
453 gir = find_program('g-ir-scanner', required : get_option('introspection'))
454 gnome = import('gnome')
455 build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
456 gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
457     'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
458     'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
459     'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
460     'gst_init(NULL,NULL);', '--quiet']
461
462 presetdir = join_paths(get_option('datadir'), 'gstreamer-' + api_version, 'presets')
463
464 pkgconfig = import('pkgconfig')
465 plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
466 if get_option('default_library') == 'shared'
467   # If we don't build static plugins there is no need to generate pc files
468   plugins_pkgconfig_install_dir = disabler()
469 endif
470
471 pkgconfig_variables = ['exec_prefix=${prefix}',
472     'toolsdir=${exec_prefix}/bin',
473     'pluginsdir=${libdir}/gstreamer-1.0',
474     'datarootdir=${prefix}/share',
475     'datadir=${datarootdir}',
476     'girdir=${datadir}/gir-1.0',
477     'typelibdir=${libdir}/girepository-1.0']
478
479 pkgconfig_subdirs = ['gstreamer-1.0']
480
481 pkgconfig.generate(
482   libraries : [gst_dep],
483   variables : pkgconfig_variables,
484   subdirs : pkgconfig_subdirs,
485   name : 'gstreamer-plugins-bad-1.0',
486   description : 'Streaming media framework, bad plugins libraries',
487 )
488
489 gpl_allowed = get_option('gpl').allowed()
490
491 subdir('gst-libs')
492 subdir('gst')
493 subdir('sys')
494 subdir('ext')
495 subdir('tests')
496 subdir('data')
497 subdir('tools')
498
499 if have_orcc
500   update_orc_dist_files = find_program('scripts/update-orc-dist-files.py')
501
502   orc_update_targets = []
503   foreach t : orc_targets
504     orc_name = t.get('name')
505     orc_file = t.get('orc-source')
506     header = t.get('header')
507     source = t.get('source')
508     # alias_target() only works with build targets, so can't use run_target() here
509     orc_update_targets += [
510       custom_target('update-orc-@0@'.format(orc_name),
511         input: [header, source],
512         command: [update_orc_dist_files, orc_file, header, source],
513         output: ['@0@-dist.c'.format(orc_name)]) # not entirely true
514     ]
515   endforeach
516
517   if meson.version().version_compare('>= 0.52') and orc_update_targets.length() > 0
518     update_orc_dist_target = alias_target('update-orc-dist', orc_update_targets)
519   endif
520 endif
521
522 # xgettext is optional (on Windows for instance)
523 if find_program('xgettext', required : get_option('nls')).found()
524   cdata.set('ENABLE_NLS', 1)
525   subdir('po')
526 endif
527
528 subdir('scripts')
529
530 # Set release date
531 if gst_version_nano == 0
532   extract_release_date = find_program('scripts/extract-release-date-from-doap-file.py')
533   run_result = run_command(extract_release_date, gst_version, files('gst-plugins-bad.doap'))
534   if run_result.returncode() == 0
535     release_date = run_result.stdout().strip()
536     cdata.set_quoted('GST_PACKAGE_RELEASE_DATETIME', release_date)
537     message('Package release date: ' + release_date)
538   else
539     # Error out if our release can't be found in the .doap file
540     error(run_result.stderr())
541   endif
542 endif
543
544 if glib_dep.version().version_compare('< 2.67.4')
545   cdata.set('g_memdup2(ptr,sz)', '(G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL)')
546 endif
547
548 configure_file(output : 'config.h', configuration : cdata)
549
550 subdir('docs')
551
552 if meson.version().version_compare('>= 0.54')
553   plugin_names = []
554   foreach plugin: plugins
555     # FIXME: Use str.subtring() when we can depend on Meson 0.56
556     split = plugin.name().split('gst')
557     if split.length() == 2
558       plugin_names += [split[1]]
559     else
560       warning('Need substring API in meson >= 0.56 to properly parse plugin name: ' + plugin.name())
561       plugin_names += [plugin.name()]
562     endif
563   endforeach
564
565   summary({
566       'Plugins': plugin_names,
567       '(A)GPL license allowed': gpl_allowed,
568   }, list_sep: ', ')
569 endif