1 project('gst-devtools', 'c',
3 meson_version : '>= 0.54',
4 default_options : [ 'warning_level=1',
6 'buildtype=debugoptimized' ])
8 gst_version = meson.project_version()
9 version_arr = gst_version.split('.')
10 gst_version_major = version_arr[0].to_int()
11 gst_version_minor = version_arr[1].to_int()
12 gst_version_micro = version_arr[2].to_int()
13 if gst_version_minor.is_even()
14 TESTSUITE_VERSION = '@0@.@1@'.format(gst_version_major, gst_version_minor)
16 TESTSUITE_VERSION = 'master'
21 # maintaining compatibility with the previous libtool versioning
22 # current = minor * 100 + micro
23 curversion = gst_version_minor * 100 + gst_version_micro
24 libversion = '@0@.@1@.0'.format(soversion, curversion)
25 osxversion = curversion + 1
27 prefix = get_option('prefix')
29 glib_req = '>= 2.56.0'
30 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
32 cc = meson.get_compiler('c')
34 if cc.get_id() == 'msvc'
35 # Ignore several spurious warnings for things gstreamer does very commonly
36 # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
37 # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
38 # NOTE: Only add warnings here if you are sure they're spurious
39 add_project_arguments(
40 '/wd4018', # implicit signed/unsigned conversion
41 '/wd4146', # unary minus on unsigned (beware INT_MIN)
42 '/wd4244', # lossy type conversion (e.g. double -> int)
43 '/wd4305', # truncating type conversion (e.g. double -> float)
45 # Disable SAFESEH with MSVC for plugins and libs that use external deps that
46 # are built with MinGW
47 noseh_link_args = ['/SAFESEH:NO']
53 if cc.has_argument('-fvisibility=hidden')
54 add_project_arguments('-fvisibility=hidden', language: 'c')
57 # Disable strict aliasing
58 if cc.has_argument('-fno-strict-aliasing')
59 add_project_arguments('-fno-strict-aliasing', language: 'c')
62 gst_dep = dependency('gstreamer-' + apiversion, version : gst_req,
63 fallback : ['gstreamer', 'gst_dep'])
64 gstbase_dep = dependency('gstreamer-base-' + apiversion, version : gst_req,
65 fallback : ['gstreamer', 'gst_base_dep'])
66 gst_pbutils_dep = dependency('gstreamer-pbutils-' + apiversion, version : gst_req,
67 fallback : ['gst-plugins-base', 'pbutils_dep'])
68 gst_video_dep = dependency('gstreamer-video-' + apiversion, version : gst_req,
69 fallback : ['gst-plugins-base', 'video_dep'])
70 gst_controller_dep = dependency('gstreamer-controller-' + apiversion, version : gst_req,
71 fallback : ['gstreamer', 'gst_controller_dep'])
72 gst_check_dep = dependency('gstreamer-check-1.0', version : gst_req,
73 required : get_option('validate'),
74 fallback : ['gstreamer', 'gst_check_dep'])
76 glib_dep = dependency('glib-2.0', version : '>=2.32.0',
77 fallback: ['glib', 'libglib_dep'])
78 gmodule_dep = dependency('gmodule-2.0',
79 fallback: ['glib', 'libgmodule_dep'])
80 gio_dep = dependency('gio-2.0',
81 fallback: ['glib', 'libgio_dep'])
83 gtk_dep = dependency('gtk+-3.0', required: false)
84 mathlib = cc.find_library('m', required : false)
85 dl = cc.find_library('dl', required : false)
86 json_dep = dependency('json-glib-1.0',
87 fallback : ['json-glib', 'json_glib_dep'])
89 gst_c_args = ['-DHAVE_CONFIG_H', '-DGST_USE_UNSTABLE_API']
91 gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
92 'g_setenv("GST_REGISTRY_1.0", "/no/way/this/exists.reg", TRUE);' + \
93 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
94 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \
95 'gst_init(NULL,NULL);', '--quiet']
96 gir = find_program('g-ir-scanner', required : get_option('introspection'))
97 build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
98 gnome = import('gnome')
100 if gst_dep.type_name() == 'internal'
101 gst_debug_disabled = not subproject('gstreamer').get_variable('gst_debug')
103 # We can't check that in the case of subprojects as we won't
104 # be able to build against an internal dependency (which is not built yet)
105 gst_debug_disabled = cc.has_header_symbol('gst/gstconfig.h', 'GST_DISABLE_GST_DEBUG', dependencies: gst_dep)
108 if gst_debug_disabled and cc.has_argument('-Wno-unused')
109 add_project_arguments('-Wno-unused', language: 'c')
113 '-Wmissing-declarations',
114 '-Wmissing-prototypes',
121 '-Wmissing-include-dirs',
124 '-Wdeclaration-after-statement',
129 foreach extra_arg : warning_flags
130 if cc.has_argument (extra_arg)
131 add_project_arguments([extra_arg], language: 'c')
135 pkgconfig = import('pkgconfig')
136 plugins_install_dir = join_paths(get_option('libdir'), 'gstreamer-1.0')
137 plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
138 if get_option('default_library') == 'shared'
139 # If we don't build static plugins there is no need to generate pc files
140 plugins_pkgconfig_install_dir = disabler()
142 pkgconfig_subdirs = ['gstreamer-1.0']
145 i18n = import('i18n')
147 python_mod = import('python')
148 python3 = python_mod.find_installation()
150 if not get_option('validate').disabled()
154 if not get_option('debug_viewer').disabled()
155 subdir('debug-viewer')
159 run_command(python3, '-c', 'import shutil; shutil.copy("hooks/multi-pre-commit.hook", ".git/hooks/pre-commit")')