diff --git a/subprojects/gst-plugins-bad/ext/webrtcdsp/meson.build b/subprojects/gst-plugins-bad/ext/webrtcdsp/meson.build index 913af0ca6e..f6bf69ec20 100644 --- a/subprojects/gst-plugins-bad/ext/webrtcdsp/meson.build +++ b/subprojects/gst-plugins-bad/ext/webrtcdsp/meson.build @@ -17,6 +17,8 @@ plugin_sources += { 'webrtcdsp': pathsep.join(doc_sources) } +default_cppstd = 'cpp_std=c++17' + webrtc_dep = dependency('webrtc-audio-processing-2', version : ['>= 2.0'], required : false) if not webrtc_dep.found() @@ -29,8 +31,15 @@ endif if not webrtc_dep.found() # Try again, and this time use fallback if requested and possible + cc = meson.get_compiler('cpp') + if cc.get_id() == 'msvc' + # MSVC doesn't like designated initalizers without c++20 + default_cppstd = 'cpp_std=c++20' + endif + webrtc_dep = dependency('webrtc-audio-processing-2', version : ['>= 2.0'], allow_fallback : true, + default_options : [default_cppstd], required : get_option('webrtcdsp')) endif @@ -43,7 +52,7 @@ if webrtc_dep.found() dependencies : [gstbase_dep, gstaudio_dep, gstbadaudio_dep, webrtc_dep], install : true, install_dir : plugins_install_dir, - override_options : ['cpp_std=c++17'], + override_options : [default_cppstd], ) plugins += [gstwebrtcdsp] endif