Bump and update for meson 0.40.1

This patch bumps the required meson to 0.40.1 as gstreamer core just
did, and cleanup some code to use a feature from 0.37 that allow
specifying version range when checking dependency.

https://bugzilla.gnome.org/show_bug.cgi?id=780654
This commit is contained in:
Nicolas Dufresne 2017-05-09 13:16:50 -04:00
parent 413406d28a
commit 60fa3cab5b
3 changed files with 15 additions and 29 deletions

View file

@ -40,47 +40,38 @@ libopencv3_headers = [
gstopencv_cargs = ['-DGST_HAAR_CASCADES_DIR="@0@"'] gstopencv_cargs = ['-DGST_HAAR_CASCADES_DIR="@0@"']
# First, check for the upper version limit and ensure it isn't found opencv_dep = dependency('opencv', version : ['>=2.3.0', '<=3.1.0'], required : false)
# FIXME: When 0.37.0 is released, change this to use many-version-conditions
opencv3_1_dep = dependency('opencv', version : '>3.1.0', required : false)
# Then, check if the lower version limit is found
opencv2_dep = dependency('opencv', version : '>=2.3.0', required : false)
opencv3_dep = dependency('opencv', version : '>= 3.0 ', required : false)
opencv2_found = false if opencv_dep.found()
if opencv3_1_dep.found() opencv_found = true
message('OpenCV version is too new: \'' + opencv3_1_dep.version() + '\' (need <= 3.1.0)')
elif opencv2_dep.found()
message('OpenCV found, version is \'' + opencv2_dep.version() + '\'')
opencv2_found = true
foreach h : libopencv2_headers foreach h : libopencv2_headers
if not cxx.has_header(h) if not cxx.has_header(h)
message('Needed header "' + h + '" not found') message('Needed header "' + h + '" not found')
opencv2_found = false opencv_found = false
endif endif
endforeach endforeach
if opencv3_dep.found() if opencv_dep.version() >= '3.0.0'
foreach h : libopencv3_headers foreach h : libopencv3_headers
if not cxx.has_header(h) if not cxx.has_header(h)
message('Needed header "' + h + '" not found') message('Needed header "' + h + '" not found')
opencv2_found = false opencv_found = false
endif endif
endforeach endforeach
endif endif
endif endif
if opencv2_found if opencv_found
opencv2_prefix = opencv2_dep.get_pkgconfig_variable('prefix') opencv_prefix = opencv_dep.get_pkgconfig_variable('prefix')
gstopencv_cargs += ['-DOPENCV_PREFIX="' + opencv2_prefix + '"'] gstopencv_cargs += ['-DOPENCV_PREFIX="' + opencv_prefix + '"']
# Check the data dir used by opencv for its xml data files # Check the data dir used by opencv for its xml data files
# Use prefix from pkg-config to be compatible with cross-compilation # Use prefix from pkg-config to be compatible with cross-compilation
r = run_command('test', '-d', opencv2_prefix + '/share/opencv') r = run_command('test', '-d', opencv_prefix + '/share/opencv')
if r.returncode() == 0 if r.returncode() == 0
gstopencv_cargs += '-DOPENCV_PATH_NAME="opencv"' gstopencv_cargs += '-DOPENCV_PATH_NAME="opencv"'
else else
r = run_command('test', '-d', opencv2_prefix + '/share/OpenCV') r = run_command('test', '-d', opencv_prefix + '/share/OpenCV')
if r.returncode() == 0 if r.returncode() == 0
gstopencv_cargs += '-DOPENCV_PATH_NAME="OpenCv"' gstopencv_cargs += '-DOPENCV_PATH_NAME="OpenCv"'
else else
@ -92,7 +83,7 @@ if opencv2_found
cpp_args : gst_plugins_bad_args + gstopencv_cargs + [ '-DGST_USE_UNSTABLE_API' ], cpp_args : gst_plugins_bad_args + gstopencv_cargs + [ '-DGST_USE_UNSTABLE_API' ],
link_args : noseh_link_args, link_args : noseh_link_args,
include_directories : [configinc], include_directories : [configinc],
dependencies : [gstbase_dep, gstvideo_dep, opencv2_dep, gstopencv_dep], dependencies : [gstbase_dep, gstvideo_dep, opencv_dep, gstopencv_dep],
install : true, install : true,
install_dir : plugins_install_dir, install_dir : plugins_install_dir,
) )

View file

@ -3,14 +3,9 @@ webrtc_sources = [
'gstwebrtcechoprobe.cpp' 'gstwebrtcechoprobe.cpp'
] ]
webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : false) webrtc_dep = dependency('webrtc-audio-processing', version : ['>= 0.2', '< 0.4'], required : false)
webrtc_max_dep = dependency('webrtc-audio-processing', version : '>= 0.4', required : false)
if (webrtc_max_dep.found()) if webrtc_dep.found()
message('WebRTC Audio Processing library is not API stable,'
+ ' we cannot support newer version ' + webrtc_max_dep.version()
+ ' (we only support 0.2 and 0.3)')
elif (webrtc_dep.found())
gstwebrtcdsp = library('gstwebrtcdsp', gstwebrtcdsp = library('gstwebrtcdsp',
webrtc_sources, webrtc_sources,
cpp_args : gst_plugins_bad_args, cpp_args : gst_plugins_bad_args,

View file

@ -1,6 +1,6 @@
project('gst-plugins-bad', 'c', 'cpp', project('gst-plugins-bad', 'c', 'cpp',
version : '1.13.0.1', version : '1.13.0.1',
meson_version : '>= 0.36.0', meson_version : '>= 0.40.1',
default_options : [ 'warning_level=1', default_options : [ 'warning_level=1',
'buildtype=debugoptimized' ]) 'buildtype=debugoptimized' ])