Hook up new "rtc_enable_sctp" build argument to "HAVE_SCTP" define.

This allows building without SCTP support (and even building/running
tests). The "HAVE_SCTP" define has been functional for a while, but there
wasn't any easy way to turn it on/off.

NOTRY=True
BUG=webrtc:6933

Review-Url: https://codereview.webrtc.org/2593313002
Cr-Commit-Position: refs/heads/master@{#15763}
This commit is contained in:
deadbeef 2016-12-22 10:53:38 -08:00 committed by Commit bot
parent fe50b4d750
commit 40610e24ce
8 changed files with 36 additions and 10 deletions

View File

@ -118,6 +118,10 @@ config("common_config") {
defines += [ "RTC_DISABLE_VP9" ]
}
if (rtc_enable_sctp) {
defines += [ "HAVE_SCTP" ]
}
if (build_with_chromium) {
defines += [
# NOTICE: Since common_inherited_config is used in public_configs for our
@ -126,7 +130,6 @@ config("common_config") {
# source when webrtc:4256 is completed.
"ENABLE_EXTERNAL_AUTH",
"HAVE_OPENSSL_SSL_H",
"HAVE_SCTP",
"HAVE_SRTP",
"HAVE_WEBRTC_VIDEO",
"HAVE_WEBRTC_VOICE",

View File

@ -262,7 +262,9 @@ if (rtc_include_tests) {
"webrtcsession_unittest.cc",
]
defines = [ "HAVE_SCTP" ]
if (rtc_enable_sctp) {
defines = [ "HAVE_SCTP" ]
}
configs += [ ":peerconnection_unittests_config" ]

View File

@ -1789,6 +1789,7 @@ TEST_F(P2PTestConductor, LocalP2PTestOfferDtlsButNotSdes) {
VerifyRenderedAspectRatio(640, 480);
}
#ifdef HAVE_SCTP
// This test verifies that the negotiation will succeed with data channel only
// in max-bundle mode.
TEST_F(P2PTestConductor, LocalP2PTestOfferDataChannelOnly) {
@ -1799,6 +1800,7 @@ TEST_F(P2PTestConductor, LocalP2PTestOfferDataChannelOnly) {
initializing_client()->CreateDataChannel();
initializing_client()->Negotiate();
}
#endif
// This test sets up a Jsep call between two parties, and the callee only
// accept to receive video.
@ -2088,6 +2090,7 @@ TEST_F(P2PTestConductor, LocalP2PTestRtpDataChannel) {
EXPECT_FALSE(receiving_client()->data_observer()->IsOpen());
}
#ifdef HAVE_SCTP
// This test sets up a call between two parties with audio, video and an SCTP
// data channel.
TEST_F(P2PTestConductor, LocalP2PTestSctpDataChannel) {
@ -2175,6 +2178,7 @@ TEST_F(P2PTestConductor, UnorderedSctpDataChannel) {
kMaxWaitMs);
EXPECT_TRUE_WAIT(!receiving_client()->data_observer()->IsOpen(), kMaxWaitMs);
}
#endif // HAVE_SCTP
// This test sets up a call between two parties and creates a data channel.
// The test tests that received data is buffered unless an observer has been

View File

@ -194,6 +194,7 @@ TEST_F(PeerConnectionEndToEndTest, CallWithLegacySdp) {
}
#endif // !defined(ADDRESS_SANITIZER)
#ifdef HAVE_SCTP
// Verifies that a DataChannel created before the negotiation can transition to
// "OPEN" and transfer data.
TEST_F(PeerConnectionEndToEndTest, CreateDataChannelBeforeNegotiate) {
@ -319,6 +320,7 @@ TEST_F(PeerConnectionEndToEndTest,
EXPECT_EQ(1U, dc_1_observer->received_message_count());
EXPECT_EQ(1U, dc_2_observer->received_message_count());
}
#endif // HAVE_SCTP
#ifdef HAVE_QUIC
// Test that QUIC data channels can be used and that messages go to the correct
@ -396,6 +398,7 @@ TEST_F(PeerConnectionEndToEndTest, MessageTransferBetweenQuicDataChannels) {
}
#endif // HAVE_QUIC
#ifdef HAVE_SCTP
// Verifies that a DataChannel added from an OPEN message functions after
// a channel has been previously closed (webrtc issue 3778).
// This previously failed because the new channel re-uses the ID of the closed
@ -455,3 +458,4 @@ TEST_F(PeerConnectionEndToEndTest, CloseDataChannelRemotelyWhileNotReferenced) {
// close message and be destroyed.
rtc::Thread::Current()->ProcessMessages(100);
}
#endif // HAVE_SCTP

View File

@ -523,6 +523,7 @@ class RTCStatsReportVerifier {
rtc::scoped_refptr<const RTCStatsReport> report_;
};
#ifdef HAVE_SCTP
TEST_F(RTCStatsIntegrationTest, GetStatsFromCaller) {
StartCall();
@ -549,6 +550,7 @@ TEST_F(RTCStatsIntegrationTest, GetsStatsWhileDestroyingPeerConnections) {
// the peer connection.
EXPECT_TRUE(stats_obtainer->report());
}
#endif // HAVE_SCTP
} // namespace

View File

@ -47,6 +47,9 @@ declare_args() {
# Set this to true to enable BWE test logging.
rtc_enable_bwe_test_logging = false
# Set this to disable building with support for SCTP data channels.
rtc_enable_sctp = true
# Disable these to not build components which can be externally provided.
rtc_build_expat = true
rtc_build_json = true

View File

@ -143,10 +143,15 @@ rtc_static_library("rtc_media") {
"engine/webrtcvoe.h",
"engine/webrtcvoiceengine.cc",
"engine/webrtcvoiceengine.h",
"sctp/sctpdataengine.cc",
"sctp/sctpdataengine.h",
]
if (rtc_enable_sctp) {
sources += [
"sctp/sctpdataengine.cc",
"sctp/sctpdataengine.h",
]
}
configs += [ ":rtc_media_warnings_config" ]
if (!build_with_chromium && is_clang) {
@ -179,7 +184,7 @@ rtc_static_library("rtc_media") {
include_dirs += [ "$rtc_libyuv_dir/include" ]
}
if (rtc_build_usrsctp) {
if (rtc_enable_sctp && rtc_build_usrsctp) {
include_dirs += [
# TODO(jiayl): move this into the public_configs of
# //third_party/usrsctp/BUILD.gn.
@ -338,9 +343,12 @@ if (rtc_include_tests) {
"engine/webrtcvideocapturer_unittest.cc",
"engine/webrtcvideoengine2_unittest.cc",
"engine/webrtcvoiceengine_unittest.cc",
"sctp/sctpdataengine_unittest.cc",
]
if (rtc_enable_sctp) {
sources += [ "sctp/sctpdataengine_unittest.cc" ]
}
configs += [ ":rtc_media_unittests_config" ]
if (rtc_use_h264) {

View File

@ -15,10 +15,10 @@ group("pc") {
}
config("rtc_pc_config") {
defines = [
"HAVE_SCTP",
"HAVE_SRTP",
]
defines = [ "HAVE_SRTP" ]
if (rtc_enable_sctp) {
defines += [ "HAVE_SCTP" ]
}
}
rtc_static_library("rtc_pc") {