Add possibility to set RTC_OBJC_TYPE_PREFIX from GN.

This CL also adds the prefix RTC_TESTING to `ios_internal_pure_release_bot_arm64` in order to avoid ODR
violations.

Bug: b/292472934
Change-Id: If63020e679c8670b4c797217eb38fc8c2954d422
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/313240
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40476}
This commit is contained in:
Mirko Bonadei 2023-07-26 13:01:43 +02:00 committed by WebRTC LUCI CQ
parent 8c9e035edb
commit 9130431b54
5 changed files with 19 additions and 5 deletions

View file

@ -138,6 +138,10 @@ config("common_inherited_config") {
cflags = []
ldflags = []
if (rtc_objc_prefix != "") {
defines += [ "RTC_OBJC_TYPE_PREFIX=${rtc_objc_prefix}" ]
}
if (rtc_dlog_always_on) {
defines += [ "DLOG_ALWAYS_ON" ]
}

View file

@ -36,9 +36,10 @@
// WebRTC.framework with their own prefix in case symbol clashing is a
// problem.
//
// This macro must only be defined here and not on via compiler flag to
// ensure it has a unique value.
// This macro must be defined uniformily across all the translation units.
#ifndef RTC_OBJC_TYPE_PREFIX
#define RTC_OBJC_TYPE_PREFIX
#endif
// RCT_OBJC_TYPE
//

View file

@ -287,8 +287,8 @@
__block RTC_OBJC_TYPE(RTCPeerConnectionFactory) * factory;
__block RTC_OBJC_TYPE(RTCPeerConnection) * pc1;
RTCSessionDescription *rollback = [[RTCSessionDescription alloc] initWithType:RTCSdpTypeRollback
sdp:@""];
RTC_OBJC_TYPE(RTCSessionDescription) *rollback =
[[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithType:RTCSdpTypeRollback sdp:@""];
@autoreleasepool {
factory = [[RTC_OBJC_TYPE(RTCPeerConnectionFactory) alloc] init];

View file

@ -271,7 +271,8 @@
],
'ios_internal_pure_release_bot_arm64': [
'ios', 'pure_release_bot', 'arm64',
'ios_code_signing_identity_description', 'xctest'
'ios_code_signing_identity_description', 'xctest',
'rtc_objc_test_prefix',
],
'ios_internal_release_bot_arm64': [
'ios', 'release_bot', 'arm64', 'ios_code_signing_identity_description',
@ -456,6 +457,9 @@
'release_bot': {
'mixins': ['pure_release_bot', 'dcheck_always_on'],
},
'rtc_objc_test_prefix': {
'gn_args': 'rtc_objc_prefix="RTC_TESTING"',
},
'rtti': {
'gn_args': 'use_rtti=true',
},

View file

@ -239,6 +239,11 @@ declare_args() {
# "warn": RTC_LOGs a message with LS_WARNING severity if the field trial
# hasn't been registered.
rtc_strict_field_trials = ""
# If different from "", symbols exported with RTC_OBJC_EXPORT will be prefixed
# with this string.
# See the definition of RTC_OBJC_TYPE_PREFIX in the code.
rtc_objc_prefix = ""
}
if (!build_with_mozilla) {