tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 6e2ca975906f7711a4818b1226503e74c0202855
parent 90a1392e87980f7e22698700d604b0d20b1f99f5
Author: Michael Froman <mfroman@mozilla.com>
Date:   Thu,  9 Oct 2025 02:34:30 +0000

Bug 1980501 - enable c++20 builds in libwebrtc. r=ng,cpeterson

Differential Revision: https://phabricator.services.mozilla.com/D267994

Diffstat:
Mdom/media/webrtc/third_party_build/gn-configs/webrtc.json | 10+++++++++-
Mthird_party/libwebrtc/BUILD.gn | 12+++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/dom/media/webrtc/third_party_build/gn-configs/webrtc.json b/dom/media/webrtc/third_party_build/gn-configs/webrtc.json @@ -10,7 +10,15 @@ }, "FINAL_LIBRARY": "xul" }, - "mozilla_flags": ["-fobjc-arc", "-mavx2", "-mfma", "-mfpu=neon", "-msse2"], + "mozilla_flags": [ + "-fobjc-arc", + "-mavx2", + "-mfma", + "-mfpu=neon", + "-msse2", + "-std=gnu++20", + "-std:c++20" + ], "write_mozbuild_variables": { "INCLUDE_TK_CFLAGS_DIRS": [ "third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn", diff --git a/third_party/libwebrtc/BUILD.gn b/third_party/libwebrtc/BUILD.gn @@ -318,6 +318,16 @@ config("common_config") { cflags_objc = [] defines = [] + # We should be able to remove this after c++20 is enabled + # across the Mozilla tree. + if (build_with_mozilla) { + if (is_win) { + cflags_cc += [ "-std:c++20" ] + } else { + cflags_cc += [ "-std=gnu++20" ] + } + } + if (rtc_enable_protobuf) { defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ] } else { @@ -419,7 +429,7 @@ config("common_config") { # "-Wnested-externs", (C/Obj-C only) ] cflags_objc += [ "-Wstrict-prototypes" ] - cflags_cc = [ + cflags_cc += [ "-Wnon-virtual-dtor", # This is enabled for clang; enable for gcc as well.