meson: bump version
[platform/upstream/gstreamer.git] / meson.build
1 project('gst-plugins-bad', 'c', 'cpp',
2   version : '1.11.1.1',
3   meson_version : '>= 0.36.0',
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]
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]
14 else
15   gst_version_nano = 0
16 endif
17
18 glib_req = '>= 2.40.0'
19 gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
20
21 api_version = '1.0'
22 soversion = 0
23 # maintaining compatibility with the previous libtool versioning
24 # current = minor * 100 + micro
25 libversion = '@0@.@1@.0'.format(soversion, gst_version_minor.to_int() * 100 + gst_version_micro.to_int())
26
27 plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
28
29 cc = meson.get_compiler('c')
30 cxx = meson.get_compiler('cpp')
31
32 if cc.get_id() == 'msvc'
33   # Ignore several spurious warnings for things gstreamer does very commonly
34   # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
35   # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
36   # NOTE: Only add warnings here if you are sure they're spurious
37   add_project_arguments(
38       '/wd4018', # implicit signed/unsigned conversion
39       '/wd4146', # unary minus on unsigned (beware INT_MIN)
40       '/wd4244', # lossy type conversion (e.g. double -> int)
41       '/wd4305', # truncating type conversion (e.g. double -> float)
42       language : 'c')
43   # Disable SAFESEH with MSVC for plugins and libs that use external deps that
44   # are built with MinGW
45   noseh_link_args = ['/SAFESEH:NO']
46 else
47   if cxx.has_argument('-Wno-non-virtual-dtor')
48     add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp')
49   endif
50
51   noseh_link_args = []
52 endif
53
54 cdata = configuration_data()
55 check_headers = [
56   ['HAVE_DLFCN_H', 'dlfcn.h'],
57   ['HAVE_FCNTL_H', 'fcntl.h'],
58   ['HAVE_HIGHGUI_H', 'highgui.h'],
59   ['HAVE_INTTYPES_H', 'inttypes.h'],
60   ['HAVE_MEMORY_H', 'memory.h'],
61   ['HAVE_MSACM_H', 'msacm.h'],
62   ['HAVE_NETINET_IN_H', 'netinet/in.h'],
63   ['HAVE_NETINET_IP_H', 'netinet/ip.h'],
64   ['HAVE_NETINET_TCP_H', 'netinet/tcp.h'],
65   ['HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H', 'opencv2/highgui/highgui_c.h'],
66   ['HAVE_PTHREAD_H', 'pthread.h'],
67   ['HAVE_STDINT_H', 'stdint.h'],
68   ['HAVE_STDLIB_H', 'stdlib.h'],
69   ['HAVE_STRINGS_H', 'strings.h'],
70   ['HAVE_STRING_H', 'string.h'],
71   ['HAVE_SYS_PARAM_H', 'sys/param.h'],
72   ['HAVE_SYS_SOCKET_H', 'sys/socket.h'],
73   ['HAVE_SYS_STAT_H', 'sys/stat.h'],
74   ['HAVE_SYS_TIME_H', 'sys/time.h'],
75   ['HAVE_SYS_TYPES_H', 'sys/types.h'],
76   ['HAVE_SYS_UTSNAME_H', 'sys/utsname.h'],
77   ['HAVE_UNISTD_H', 'unistd.h'],
78   ['HAVE_WINDOWS_H', 'windows.h'],
79   ['HAVE_WINSOCK2_H', 'winsock2.h'],
80   ['HAVE_WS2TCPIP_H', 'ws2tcpip.h'],
81 ]
82
83 foreach h : check_headers
84   if cc.has_header(h.get(1))
85     cdata.set(h.get(0), 1)
86   endif
87 endforeach
88
89 check_functions = [
90 # check token HAVE_ACM
91 # check token HAVE_ANDROID_MEDIA
92 # check token HAVE_APEXSINK
93 # check token HAVE_APPLE_MEDIA
94 # check token HAVE_ASSRENDER
95 # check token HAVE_AVC
96 # check token HAVE_AVFOUNDATION
97 # check token HAVE_BLUEZ
98 # check token HAVE_BZ2
99 # check token HAVE_CFLOCALECOPYCURRENT
100 # check token HAVE_CFPREFERENCESCOPYAPPVALUE
101 # check token HAVE_CHROMAPRINT
102 # check token HAVE_CPU_ALPHA
103 # check token HAVE_CPU_ARM
104 # check token HAVE_CPU_CRIS
105 # check token HAVE_CPU_CRISV32
106 # check token HAVE_CPU_HPPA
107 # check token HAVE_CPU_I386
108 # check token HAVE_CPU_IA64
109 # check token HAVE_CPU_M68K
110 # check token HAVE_CPU_MIPS
111 # check token HAVE_CPU_PPC
112 # check token HAVE_CPU_PPC64
113 # check token HAVE_CPU_S390
114 # check token HAVE_CPU_SPARC
115 # check token HAVE_CPU_X86_64
116 # check token HAVE_CURL
117 # check token HAVE_DAALA
118 # check token HAVE_DASH
119 # check token HAVE_DC1394
120   ['HAVE_DCGETTEXT', 'dcgettext'],
121 # check token HAVE_DECKLINK
122 # check token HAVE_DIRECT3D
123 # check token HAVE_DIRECTDRAW
124 # check token HAVE_DIRECTFB
125 # check token HAVE_DIRECTSOUND
126 # check token HAVE_DOWHILE_MACROS
127 # check token HAVE_DTS
128 # check token HAVE_DVB
129 # check token HAVE_EXPERIMENTAL
130 # check token HAVE_EXTERNAL
131 # check token HAVE_FAAC
132 # check token HAVE_FAAD
133 # check token HAVE_FBDEV
134 # check token HAVE_FLITE
135 # check token HAVE_FLUIDSYNTH
136   ['HAVE_GETPAGESIZE', 'getpagesize'],
137 # check token HAVE_GETTEXT
138 # check token HAVE_GL
139 # check token HAVE_GLCHAR
140 # check token HAVE_GLEGLIMAGEOES
141 # check token HAVE_GLINTPTR
142 # check token HAVE_GLSIZEIPTR
143 # check token HAVE_GME
144   ['HAVE_GMTIME_R', 'gmtime_r'],
145 # check token HAVE_GRAPHENE
146 # check token HAVE_GSETTINGS
147 # check token HAVE_GSM
148 # check token HAVE_GUDEV
149 # check token HAVE_HLS
150 # check token HAVE_ICONV
151 # check token HAVE_IOS
152 # check token HAVE_JPEG
153 # check token HAVE_KATE
154 # check token HAVE_LADSPA
155 # check token HAVE_LIBGCRYPT
156 # check token HAVE_LIBGME_ACCURACY
157 # check token HAVE_LIBMMS
158 # check token HAVE_LIBNSL
159 # check token HAVE_LIBSOCKET
160 # check token HAVE_LIBUSB
161 # check token HAVE_LIBVISUAL
162 # check token HAVE_LINSYS
163 # check token HAVE_LRDF
164 # check token HAVE_LV2
165 # check token HAVE_MIMIC
166   ['HAVE_MMAP', 'mmap'],
167 # check token HAVE_MODPLUG
168 # check token HAVE_MPEG2ENC
169 # check token HAVE_MPG123
170 # check token HAVE_MPLEX
171 # check token HAVE_MUSEPACK
172 # check token HAVE_MYTHTV
173 # check token HAVE_NAS
174 # check token HAVE_NEON
175 # check token HAVE_NETTLE
176 # check token HAVE_OFA
177 # check token HAVE_OPENAL
178 # check token HAVE_OPENCV
179 # check token HAVE_OPENEXR
180 # check token HAVE_OPENJPEG
181 # check token HAVE_OPENJPEG_1
182 # check token HAVE_OPENNI2
183 # check token HAVE_OPENSLES
184 # check token HAVE_OPUS
185 # check token HAVE_ORC
186 # check token HAVE_OSX
187 # check token HAVE_OSX_VIDEO
188 # check token HAVE_PNG
189 # check token HAVE_PVR
190 # check token HAVE_QUICKTIME
191 # check token HAVE_RDTSC
192 # check token HAVE_RESINDVD
193 # check token HAVE_RSVG
194 # check token HAVE_RSVG_2_36_2
195 # check token HAVE_RTMP
196 # check token HAVE_SBC
197 # check token HAVE_SCHRO
198 # check token HAVE_SDL
199 # check token HAVE_SHM
200 # check token HAVE_SMOOTHSTREAMING
201 # check token HAVE_SNDFILE
202 # check token HAVE_SNDIO
203 # check token HAVE_SOUNDTOUCH
204 # check token HAVE_SOUNDTOUCH_1_4
205 # check token HAVE_SPANDSP
206 # check token HAVE_SPC
207 # check token HAVE_SRTP
208 # check token HAVE_SSH2
209 # check token HAVE_TELETEXTDEC
210 # check token HAVE_TIGER
211 # check token HAVE_TIMIDITY
212 # check token HAVE_UVCH264
213 # check token HAVE_VALGRIND
214 # check token HAVE_VCD
215 # check token HAVE_VDPAU
216 # check token HAVE_VIDEOTOOLBOX
217 # check token HAVE_VIDEOTOOLBOX_10_9_6
218 # check token HAVE_VOAACENC
219 # check token HAVE_VOAMRWBENC
220 # check token HAVE_WASAPI
221 # check token HAVE_WAYLAND
222 # check token HAVE_WEBP
223 # check token HAVE_WILDMIDI
224 # check token HAVE_WILDMIDI_0_2_2
225 # check token HAVE_WIN32
226 # check token HAVE_WININET
227 # check token HAVE_WINKS
228 # check token HAVE_WINSCREENCAP
229 # check token HAVE_XVID
230 # check token HAVE_ZBAR
231 ]
232
233 foreach f : check_functions
234   if cc.has_function(f.get(1))
235     cdata.set(f.get(0), 1)
236   endif
237 endforeach
238
239 cdata.set('SIZEOF_CHAR', cc.sizeof('char'))
240 cdata.set('SIZEOF_INT', cc.sizeof('int'))
241 cdata.set('SIZEOF_LONG', cc.sizeof('long'))
242 cdata.set('SIZEOF_SHORT', cc.sizeof('short'))
243 cdata.set('SIZEOF_VOIDP', cc.sizeof('void*'))
244
245 cdata.set('VERSION', '"@0@"'.format(gst_version))
246 cdata.set('PACKAGE', '"gst-plugins-bad"')
247 cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version))
248 cdata.set('PACKAGE_BUGREPORT', '"http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer"')
249 cdata.set('PACKAGE_NAME', '"GStreamer Bad Plug-ins"')
250 cdata.set('GETTEXT_PACKAGE', '"gst-plugins-bad-1.0"')
251 cdata.set('GST_API_VERSION', '"@0@"'.format(api_version))
252 cdata.set('GST_PACKAGE_NAME', '"GStreamer Bad Plug-ins"')
253 cdata.set('GST_PACKAGE_ORIGIN', '"Unknown package origin"')
254 cdata.set('GST_LICENSE', '"LGPL"')
255 cdata.set('LIBDIR', '"@0@"'.format(get_option('libdir')))
256
257 # FIXME: This should be exposed as a configuration option
258 host_system = host_machine.system()
259 if host_system == 'linux'
260   cdata.set('DEFAULT_VIDEOSRC', '"v4l2src"')
261 elif host_system == 'osx'
262   cdata.set('DEFAULT_VIDEOSRC', '"avfvideosrc"')
263 else
264   cdata.set('DEFAULT_VIDEOSRC', '"videotestsrc"')
265 endif
266
267 # Mandatory GST deps
268 gst_dep = dependency('gstreamer-1.0', version : gst_req,
269   fallback : ['gstreamer', 'gst_dep'])
270 gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req,
271   fallback : ['gstreamer', 'gst_base_dep'])
272 gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req,
273   fallback : ['gstreamer', 'gst_net_dep'])
274 gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req,
275   fallback : ['gstreamer', 'gst_controller_dep'])
276
277 gstpbutils_dep = dependency('gstreamer-pbutils-1.0', version : gst_req,
278     fallback : ['gst-plugins-base', 'pbutils_dep'])
279 gstallocators_dep = dependency('gstreamer-allocators-1.0', version : gst_req,
280     fallback : ['gst-plugins-base', 'allocators_dep'])
281 gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req,
282     fallback : ['gst-plugins-base', 'app_dep'])
283 gstaudio_dep = dependency('gstreamer-audio-1.0', version : gst_req,
284     fallback : ['gst-plugins-base', 'audio_dep'])
285 gstfft_dep = dependency('gstreamer-fft-1.0', version : gst_req,
286     fallback : ['gst-plugins-base', 'fft_dep'])
287 gstriff_dep = dependency('gstreamer-riff-1.0', version : gst_req,
288     fallback : ['gst-plugins-base', 'riff_dep'])
289 gstrtp_dep = dependency('gstreamer-rtp-1.0', version : gst_req,
290     fallback : ['gst-plugins-base', 'rtp_dep'])
291 gstrtsp_dep = dependency('gstreamer-rtsp-1.0', version : gst_req,
292     fallback : ['gst-plugins-base', 'rtsp_dep'])
293 gstsdp_dep = dependency('gstreamer-sdp-1.0', version : gst_req,
294     fallback : ['gst-plugins-base', 'sdp_dep'])
295 gsttag_dep = dependency('gstreamer-tag-1.0', version : gst_req,
296     fallback : ['gst-plugins-base', 'tag_dep'])
297 gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
298     fallback : ['gst-plugins-base', 'video_dep'])
299
300 libm = cc.find_library('m', required : false)
301 glib_dep = dependency('glib-2.0', version : glib_req)
302 gio_dep = dependency('gio-2.0', version : glib_req)
303 gmodule_dep = dependency('gmodule-2.0', version : glib_req)
304 x11_dep = dependency('x11', required : false)
305 # Used by dtls and hls
306 openssl_dep = dependency('openssl', version : '>= 1.0.1', required : false)
307
308 if x11_dep.found()
309   cdata.set('HAVE_X11', 1)
310 endif
311
312 mathlib = cc.find_library('m', required : false)
313
314 if host_machine.system() == 'windows'
315   winsock2 = [cc.find_library('ws2_32')]
316 else
317   winsock2 = []
318 endif
319
320 have_orcc = false
321 orcc_args = []
322 if get_option('use_orc') != 'no'
323   need_orc = get_option('use_orc') == 'yes'
324   # Used by various libraries/elements that use Orc code
325   orc_dep = dependency('orc-0.4', required : need_orc)
326   orcc = find_program('orcc', required : need_orc)
327   if orc_dep.found() and orcc.found()
328     have_orcc = true
329     orcc_args = [orcc, '--include', 'glib.h']
330     cdata.set('HAVE_ORC', 1)
331   else
332     message('Orc Compiler not found, will use backup C code')
333     cdata.set('DISABLE_ORC', 1)
334   endif
335 else
336   cdata.set('DISABLE_ORC', 1)
337 endif
338
339 if gst_dep.type_name() == 'internal'
340     gst_proj = subproject('gstreamer')
341
342     if gst_proj.get_variable('disable_gst_debug')
343         message('GStreamer debug system is disabled')
344         add_project_arguments('-Wno-unused', language: 'c')
345     else
346         message('GStreamer debug system is enabled')
347     endif
348 else
349     # We can't check that in the case of subprojects as we won't
350     # be able to build against an internal dependency (which is not built yet)
351     if not cc.compiles('''
352 #include <gst/gstconfig.h>
353 #ifdef GST_DISABLE_GST_DEBUG
354 #error "debugging disabled, make compiler fail"
355 #endif''' , dependencies: gst_dep)
356         message('GStreamer debug system is disabled')
357         add_global_arguments('-Wno-unused', language: 'c')
358     else
359         message('GStreamer debug system is enabled')
360     endif
361 endif
362
363 configure_file(input : 'config.h.meson',
364   output : 'config.h',
365   configuration : cdata)
366
367 gst_plugins_bad_args = ['-DHAVE_CONFIG_H']
368 configinc = include_directories('.')
369 libsinc = include_directories('gst-libs')
370
371 vs_module_defs_dir = meson.current_source_dir() + '/win32/common/'
372
373 # Used by the *_mkenum.py helper scripts
374 glib_mkenums = find_program('glib-mkenums')
375
376 subdir('gst-libs')
377 subdir('gst')
378 subdir('sys')
379 subdir('ext')
380 subdir('pkgconfig')
381
382 python3 = find_program('python3')
383 run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')