From 4cd63e09d9c166029e9f1cd4b61c4300e21260e7 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sat, 25 Jan 2025 00:15:04 -0500 Subject: [PATCH] webrtcdsp: Use C++20 with MSVC if needed The subproject fails on vs2022 builds with: [...]agc2/input_volume_stats_reporter.cc(89): error C7555: use of designated initializers requires at least '/std:c++20' So let's force C++20 in this case. Part-of: --- subprojects/gst-plugins-bad/ext/webrtcdsp/meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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