2016-08-05 19:48:41 +00:00
|
|
|
project('gst-devtools', 'c',
|
2022-02-07 16:17:28 +00:00
|
|
|
version : '1.20.0.1',
|
2021-10-14 17:38:26 +00:00
|
|
|
meson_version : '>= 0.59',
|
2016-08-05 19:48:41 +00:00
|
|
|
default_options : [ 'warning_level=1',
|
|
|
|
'c_std=gnu99',
|
|
|
|
'buildtype=debugoptimized' ])
|
|
|
|
|
|
|
|
gst_version = meson.project_version()
|
|
|
|
version_arr = gst_version.split('.')
|
2018-08-31 09:51:05 +00:00
|
|
|
gst_version_major = version_arr[0].to_int()
|
|
|
|
gst_version_minor = version_arr[1].to_int()
|
|
|
|
gst_version_micro = version_arr[2].to_int()
|
2021-10-25 10:37:45 +00:00
|
|
|
gst_version_is_stable = gst_version_minor.is_even()
|
|
|
|
gst_version_is_dev = gst_version_minor.is_odd() and gst_version_micro < 90
|
|
|
|
if gst_version_is_stable
|
2017-02-20 15:51:26 +00:00
|
|
|
TESTSUITE_VERSION = '@0@.@1@'.format(gst_version_major, gst_version_minor)
|
2018-03-14 00:14:51 +00:00
|
|
|
else
|
2021-10-25 10:37:45 +00:00
|
|
|
TESTSUITE_VERSION = 'master' # FIXME: main?
|
2016-08-05 19:48:41 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
apiversion = '1.0'
|
|
|
|
soversion = 0
|
|
|
|
# maintaining compatibility with the previous libtool versioning
|
|
|
|
# current = minor * 100 + micro
|
2018-08-31 09:22:04 +00:00
|
|
|
curversion = gst_version_minor * 100 + gst_version_micro
|
|
|
|
libversion = '@0@.@1@.0'.format(soversion, curversion)
|
|
|
|
osxversion = curversion + 1
|
2016-08-05 19:48:41 +00:00
|
|
|
|
|
|
|
prefix = get_option('prefix')
|
|
|
|
|
2020-10-16 10:49:02 +00:00
|
|
|
glib_req = '>= 2.56.0'
|
2021-10-25 10:37:45 +00:00
|
|
|
|
|
|
|
if gst_version_is_stable
|
|
|
|
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
|
|
|
|
else
|
|
|
|
gst_req = '>= ' + gst_version
|
|
|
|
endif
|
2016-08-05 19:48:41 +00:00
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
2016-11-18 01:26:49 +00:00
|
|
|
|
|
|
|
if cc.get_id() == 'msvc'
|
2020-11-04 13:19:03 +00:00
|
|
|
msvc_args = [
|
|
|
|
# Ignore several spurious warnings for things gstreamer does very commonly
|
|
|
|
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
|
|
|
|
# If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
|
|
|
|
# NOTE: Only add warnings here if you are sure they're spurious
|
2016-11-18 01:26:49 +00:00
|
|
|
'/wd4018', # implicit signed/unsigned conversion
|
|
|
|
'/wd4146', # unary minus on unsigned (beware INT_MIN)
|
|
|
|
'/wd4244', # lossy type conversion (e.g. double -> int)
|
|
|
|
'/wd4305', # truncating type conversion (e.g. double -> float)
|
2020-11-04 13:19:03 +00:00
|
|
|
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
|
|
|
|
|
|
|
# Enable some warnings on MSVC to match GCC/Clang behaviour
|
|
|
|
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
|
|
|
|
'/w14101', # 'identifier' : unreferenced local variable
|
|
|
|
'/w14189', # 'identifier' : local variable is initialized but not referenced
|
|
|
|
]
|
|
|
|
add_project_arguments(msvc_args, language: 'c')
|
2016-11-18 01:26:49 +00:00
|
|
|
# Disable SAFESEH with MSVC for plugins and libs that use external deps that
|
|
|
|
# are built with MinGW
|
|
|
|
noseh_link_args = ['/SAFESEH:NO']
|
|
|
|
else
|
|
|
|
noseh_link_args = []
|
|
|
|
endif
|
|
|
|
|
2017-08-12 11:08:09 +00:00
|
|
|
# Symbol visibility
|
|
|
|
if cc.has_argument('-fvisibility=hidden')
|
|
|
|
add_project_arguments('-fvisibility=hidden', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2018-01-30 20:36:00 +00:00
|
|
|
# Disable strict aliasing
|
|
|
|
if cc.has_argument('-fno-strict-aliasing')
|
|
|
|
add_project_arguments('-fno-strict-aliasing', language: 'c')
|
|
|
|
endif
|
|
|
|
|
2016-08-05 19:48:41 +00:00
|
|
|
gst_dep = dependency('gstreamer-' + apiversion, version : gst_req,
|
|
|
|
fallback : ['gstreamer', 'gst_dep'])
|
2019-04-01 18:48:54 +00:00
|
|
|
gstbase_dep = dependency('gstreamer-base-' + apiversion, version : gst_req,
|
|
|
|
fallback : ['gstreamer', 'gst_base_dep'])
|
2016-08-05 19:48:41 +00:00
|
|
|
gst_pbutils_dep = dependency('gstreamer-pbutils-' + apiversion, version : gst_req,
|
|
|
|
fallback : ['gst-plugins-base', 'pbutils_dep'])
|
|
|
|
gst_video_dep = dependency('gstreamer-video-' + apiversion, version : gst_req,
|
|
|
|
fallback : ['gst-plugins-base', 'video_dep'])
|
2020-06-10 19:39:12 +00:00
|
|
|
gst_controller_dep = dependency('gstreamer-controller-' + apiversion, version : gst_req,
|
|
|
|
fallback : ['gstreamer', 'gst_controller_dep'])
|
2020-04-13 20:23:32 +00:00
|
|
|
gst_check_dep = dependency('gstreamer-check-1.0', version : gst_req,
|
|
|
|
required : get_option('validate'),
|
|
|
|
fallback : ['gstreamer', 'gst_check_dep'])
|
2017-06-23 20:20:01 +00:00
|
|
|
|
|
|
|
glib_dep = dependency('glib-2.0', version : '>=2.32.0',
|
|
|
|
fallback: ['glib', 'libglib_dep'])
|
|
|
|
gmodule_dep = dependency('gmodule-2.0',
|
|
|
|
fallback: ['glib', 'libgmodule_dep'])
|
|
|
|
gio_dep = dependency('gio-2.0',
|
|
|
|
fallback: ['glib', 'libgio_dep'])
|
|
|
|
|
2016-08-05 19:48:41 +00:00
|
|
|
gtk_dep = dependency('gtk+-3.0', required: false)
|
|
|
|
mathlib = cc.find_library('m', required : false)
|
2017-01-30 21:19:00 +00:00
|
|
|
dl = cc.find_library('dl', required : false)
|
2016-11-02 11:28:27 +00:00
|
|
|
json_dep = dependency('json-glib-1.0',
|
|
|
|
fallback : ['json-glib', 'json_glib_dep'])
|
2016-08-05 19:48:41 +00:00
|
|
|
|
|
|
|
gst_c_args = ['-DHAVE_CONFIG_H', '-DGST_USE_UNSTABLE_API']
|
|
|
|
|
2016-11-04 17:45:19 +00:00
|
|
|
gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
|
|
|
|
'g_setenv("GST_REGISTRY_1.0", "/no/way/this/exists.reg", TRUE);' + \
|
|
|
|
'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
|
|
|
|
'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
|
2019-03-23 19:22:29 +00:00
|
|
|
'gst_init(NULL,NULL);', '--quiet']
|
2018-07-25 11:57:03 +00:00
|
|
|
gir = find_program('g-ir-scanner', required : get_option('introspection'))
|
2019-10-18 11:31:19 +00:00
|
|
|
build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
|
2016-08-05 19:48:41 +00:00
|
|
|
gnome = import('gnome')
|
|
|
|
|
2016-12-09 20:43:53 +00:00
|
|
|
if gst_dep.type_name() == 'internal'
|
2018-05-05 14:25:14 +00:00
|
|
|
gst_debug_disabled = not subproject('gstreamer').get_variable('gst_debug')
|
2016-12-09 20:43:53 +00:00
|
|
|
else
|
2018-02-21 19:50:33 +00:00
|
|
|
# We can't check that in the case of subprojects as we won't
|
|
|
|
# be able to build against an internal dependency (which is not built yet)
|
|
|
|
gst_debug_disabled = cc.has_header_symbol('gst/gstconfig.h', 'GST_DISABLE_GST_DEBUG', dependencies: gst_dep)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gst_debug_disabled and cc.has_argument('-Wno-unused')
|
|
|
|
add_project_arguments('-Wno-unused', language: 'c')
|
2016-12-09 20:43:53 +00:00
|
|
|
endif
|
|
|
|
|
2018-03-01 17:49:21 +00:00
|
|
|
warning_flags = [
|
|
|
|
'-Wmissing-declarations',
|
|
|
|
'-Wmissing-prototypes',
|
|
|
|
'-Wredundant-decls',
|
|
|
|
'-Wundef',
|
|
|
|
'-Wwrite-strings',
|
|
|
|
'-Wformat',
|
|
|
|
'-Wformat-security',
|
|
|
|
'-Winit-self',
|
|
|
|
'-Wmissing-include-dirs',
|
|
|
|
'-Waddress',
|
|
|
|
'-Wno-multichar',
|
|
|
|
'-Wdeclaration-after-statement',
|
|
|
|
'-Wvla',
|
|
|
|
'-Wpointer-arith',
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach extra_arg : warning_flags
|
|
|
|
if cc.has_argument (extra_arg)
|
|
|
|
add_project_arguments([extra_arg], language: 'c')
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2018-12-10 02:25:58 +00:00
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0')
|
|
|
|
plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
|
|
|
|
if get_option('default_library') == 'shared'
|
|
|
|
# If we don't build static plugins there is no need to generate pc files
|
|
|
|
plugins_pkgconfig_install_dir = disabler()
|
|
|
|
endif
|
2020-08-06 12:00:53 +00:00
|
|
|
pkgconfig_subdirs = ['gstreamer-1.0']
|
2018-12-10 02:25:58 +00:00
|
|
|
|
2021-06-08 16:28:49 +00:00
|
|
|
plugins_doc_dep = []
|
2018-10-22 09:38:30 +00:00
|
|
|
plugins = []
|
2018-04-15 19:31:36 +00:00
|
|
|
i18n = import('i18n')
|
2019-03-21 13:06:00 +00:00
|
|
|
|
2020-06-27 04:39:00 +00:00
|
|
|
static_build = get_option('default_library') == 'static'
|
|
|
|
libraries = []
|
|
|
|
|
2019-03-21 13:06:00 +00:00
|
|
|
python_mod = import('python')
|
|
|
|
python3 = python_mod.find_installation()
|
2020-04-13 20:23:32 +00:00
|
|
|
if not get_option('validate').disabled()
|
2018-04-15 19:31:36 +00:00
|
|
|
subdir('validate')
|
|
|
|
endif
|
|
|
|
|
2020-05-27 19:59:41 +00:00
|
|
|
if not get_option('debug_viewer').disabled()
|
2018-04-15 19:31:36 +00:00
|
|
|
subdir('debug-viewer')
|
|
|
|
endif
|
2018-10-22 09:38:30 +00:00
|
|
|
subdir('docs')
|