1 project('gst-plugins-ugly', 'c',
3 meson_version : '>= 0.36.0',
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]
10 gst_version_minor = version_arr[1]
11 gst_version_micro = version_arr[2]
12 if version_arr.length() == 4
13 gst_version_nano = version_arr[3]
18 glib_req = '>= 2.40.0'
19 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
23 plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
25 cc = meson.get_compiler('c')
27 if cc.get_id() == 'msvc'
28 # Ignore several spurious warnings for things gstreamer does very commonly
29 # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
30 # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
31 # NOTE: Only add warnings here if you are sure they're spurious
32 add_project_arguments(
33 '/wd4018', # implicit signed/unsigned conversion
34 '/wd4146', # unary minus on unsigned (beware INT_MIN)
35 '/wd4244', # lossy type conversion (e.g. double -> int)
36 '/wd4305', # truncating type conversion (e.g. double -> float)
38 # Disable SAFESEH with MSVC for plugins and libs that use external deps that
39 # are built with MinGW
40 noseh_link_args = ['/SAFESEH:NO']
46 if cc.has_argument('-fvisibility=hidden')
47 add_project_arguments('-fvisibility=hidden', language: 'c')
50 cdata = configuration_data()
52 ['HAVE_DLFCN_H', 'dlfcn.h'],
53 ['HAVE_INTTYPES_H', 'inttypes.h'],
54 ['HAVE_MALLOC_H', 'malloc.h'],
55 ['HAVE_MEMORY_H', 'memory.h'],
56 ['HAVE_STDINT_H', 'stdint.h'],
57 ['HAVE_STDLIB_H', 'stdlib.h'],
58 ['HAVE_STRINGS_H', 'strings.h'],
59 ['HAVE_STRING_H', 'string.h'],
60 ['HAVE_SYS_STAT_H', 'sys/stat.h'],
61 ['HAVE_SYS_TYPES_H', 'sys/types.h'],
62 ['HAVE_UNISTD_H', 'unistd.h'],
63 ['HAVE_WINSOCK2_H', 'winsock2.h'],
66 foreach h : check_headers
67 if cc.has_header(h.get(1))
68 cdata.set(h.get(0), 1)
73 # check token HAVE_CPU_ALPHA
74 # check token HAVE_CPU_ARM
75 # check token HAVE_CPU_CRIS
76 # check token HAVE_CPU_CRISV32
77 # check token HAVE_CPU_HPPA
78 # check token HAVE_CPU_I386
79 # check token HAVE_CPU_IA64
80 # check token HAVE_CPU_M68K
81 # check token HAVE_CPU_MIPS
82 # check token HAVE_CPU_PPC
83 # check token HAVE_CPU_PPC64
84 # check token HAVE_CPU_S390
85 # check token HAVE_CPU_SPARC
86 # check token HAVE_CPU_X86_64
87 ['HAVE_DCGETTEXT', 'dcgettext'],
88 # check token HAVE_EXPERIMENTAL
89 # check token HAVE_EXTERNAL
90 # check token HAVE_GETTEXT
91 # check token HAVE_VALGRIND
94 foreach f : check_functions
95 if cc.has_function(f.get(1))
96 cdata.set(f.get(0), 1)
100 cdata.set('SIZEOF_CHAR', cc.sizeof('char'))
101 cdata.set('SIZEOF_INT', cc.sizeof('int'))
102 cdata.set('SIZEOF_LONG', cc.sizeof('long'))
103 cdata.set('SIZEOF_SHORT', cc.sizeof('short'))
104 cdata.set('SIZEOF_VOIDP', cc.sizeof('void*'))
106 cdata.set('VERSION', '"@0@"'.format(gst_version))
107 cdata.set('PACKAGE', '"gst-plugins-ugly"')
108 cdata.set('GETTEXT_PACKAGE', '"gst-plugins-ugly-1.0"')
109 cdata.set('GST_LICENSE', '"LGPL"')
111 # GStreamer package name and origin url
112 gst_package_name = get_option('with-package-name')
113 if gst_package_name == ''
114 if gst_version_nano == 0
115 gst_package_name = 'GStreamer Ugly Plug-ins source release'
116 elif gst_version_nano == 1
117 gst_package_name = 'GStreamer Ugly Plug-ins git'
119 gst_package_name = 'GStreamer Ugly Plug-ins prerelease'
122 cdata.set_quoted('GST_PACKAGE_NAME', gst_package_name)
123 cdata.set_quoted('GST_PACKAGE_ORIGIN', get_option('with-package-origin'))
126 gst_dep = dependency('gstreamer-1.0', version : gst_req,
127 fallback : ['gstreamer', 'gst_dep'])
128 gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req,
129 fallback : ['gst-plugins-base', 'app_dep'])
130 gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
131 fallback : ['gst-plugins-base', 'video_dep'])
132 gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req,
133 fallback : ['gst-plugins-base', 'pbutils_dep'])
134 gsttag_dep = dependency('gstreamer-tag-1.0', version : gst_req,
135 fallback : ['gst-plugins-base', 'tag_dep'])
136 gstfft_dep = dependency('gstreamer-fft-1.0', version : gst_req,
137 fallback : ['gst-plugins-base', 'fft_dep'])
138 gstaudio_dep = dependency('gstreamer-audio-1.0', version : gst_req,
139 fallback : ['gst-plugins-base', 'audio_dep'])
140 gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
141 fallback : ['gstreamer', 'gst_base_dep'])
142 gstriff_dep = dependency('gstreamer-riff-1.0', version : gst_req,
143 fallback : ['gst-plugins-base', 'riff_dep'])
144 gstrtp_dep = dependency('gstreamer-rtp-1.0', version : gst_req,
145 fallback : ['gst-plugins-base', 'rtp_dep'])
146 gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req,
147 fallback : ['gstreamer', 'gst_net_dep'])
148 gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req,
149 fallback : ['gst-plugins-base', 'sdp_dep'])
150 gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req,
151 fallback : ['gst-plugins-base', 'rtsp_dep'])
152 if host_machine.system() != 'windows'
153 gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
154 fallback : ['gstreamer', 'gst_check_dep'])
156 gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
157 fallback : ['gstreamer', 'gst_controller_dep'])
159 orc_dep = dependency('orc-0.4', version : '>= 0.4.16', required : false)
161 cdata.set('HAVE_ORC', 1) # used by a52dec for cpu detection
163 cdata.set('DISABLE_ORC', 1)
166 configure_file(output : 'config.h', configuration : cdata)
168 ugly_args = ['-DHAVE_CONFIG_H']
169 configinc = include_directories('.')
170 libsinc = include_directories('gst-libs')
172 if gst_dep.type_name() == 'internal'
173 gst_proj = subproject('gstreamer')
175 if gst_proj.get_variable('disable_gst_debug')
176 message('GStreamer debug system is disabled')
177 add_project_arguments('-Wno-unused', language: 'c')
179 message('GStreamer debug system is enabled')
182 # We can't check that in the case of subprojects as we won't
183 # be able to build against an internal dependency (which is not built yet)
184 if not cc.compiles('''
185 #include <gst/gstconfig.h>
186 #ifdef GST_DISABLE_GST_DEBUG
187 #error "debugging disabled, make compiler fail"
188 #endif''' , dependencies: gst_dep)
189 message('GStreamer debug system is disabled')
190 add_global_arguments('-Wno-unused', language: 'c')
192 message('GStreamer debug system is enabled')
196 presetdir = join_paths(get_option('datadir'), 'gstreamer-' + api_version, 'presets')
201 # xgettext is optional (on Windows for instance)
202 if find_program('xgettext', required : false).found()
206 python3 = import('python3').find_python()
207 run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')