Enable -Wexit-time-destructors and -Wglobal-constructors.
This CL enables -Wexit-time-destructors and -Wglobal-constructors on
rtc_static_library and rtc_source_set build targets.
It also adds the possibility to suppress these warnings because
they trigger in a few places.
The long term goal is to avoid regressions on this and remove all the
suppressions.
Bug: webrtc:9693
Change-Id: I4c1ecc137ef9e87ec5e66981ce95d96fb082727c
Reviewed-on: https://webrtc-review.googlesource.com/98380
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24604}
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index b5fd104..95750fc 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -531,6 +531,7 @@
rtc_static_library("videocodec_objc") {
visibility = [ "*" ]
+ configs += [ "..:no_global_constructors" ]
sources = [
"objc/components/video_codec/RTCCodecSpecificInfoH264+Private.h",
"objc/components/video_codec/RTCCodecSpecificInfoH264.h",
@@ -585,6 +586,7 @@
}
rtc_static_library("vpx_codec_constants") {
+ configs += [ "..:no_global_constructors" ]
sources = [
"objc/api/video_codec/RTCVideoCodecConstants.h",
"objc/api/video_codec/RTCVideoCodecConstants.mm",
@@ -664,6 +666,7 @@
}
rtc_static_library("mediaconstraints_objc") {
+ configs += [ "..:no_global_constructors" ]
sources = [
"objc/api/peerconnection/RTCMediaConstraints+Private.h",
"objc/api/peerconnection/RTCMediaConstraints.h",
@@ -775,6 +778,10 @@
"audio_codecs", # TODO(bugs.webrtc.org/8396): Remove.
"software_video_codecs", # TODO(bugs.webrtc.org/7925): Remove.
]
+ configs += [
+ "..:no_exit_time_destructors",
+ "..:no_global_constructors",
+ ]
sources = [
"objc/api/peerconnection/RTCAudioSource+Private.h",
"objc/api/peerconnection/RTCAudioSource.h",