Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: webrtc/pc/BUILD.gn

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: CR comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/pc/BUILD.gn
diff --git a/webrtc/pc/BUILD.gn b/webrtc/pc/BUILD.gn
index 483485012da481803fe641f220ef643832af61bb..088477bcc908cafa32c9e6d919e4631b88ae8bc8 100644
--- a/webrtc/pc/BUILD.gn
+++ b/webrtc/pc/BUILD.gn
@@ -25,25 +25,18 @@ config("rtc_pc_config") {
}
}
-rtc_static_library("rtc_pc") {
- defines = []
+rtc_source_set("rtc_pc_common") {
sources = [
"audiomonitor.cc",
"audiomonitor.h",
"bundlefilter.cc",
"bundlefilter.h",
- "channel.cc",
- "channel.h",
- "channelmanager.cc",
- "channelmanager.h",
"currentspeakermonitor.cc",
"currentspeakermonitor.h",
"externalhmac.cc",
"externalhmac.h",
"mediamonitor.cc",
"mediamonitor.h",
- "mediasession.cc",
- "mediasession.h",
"rtcpmuxfilter.cc",
"rtcpmuxfilter.h",
"rtptransport.cc",
@@ -53,17 +46,64 @@ rtc_static_library("rtc_pc") {
"voicechannel.h",
]
+ if (rtc_build_libsrtp) {
+ deps = [
+ "//third_party/libsrtp",
+ ]
+ }
+
+ public_configs = [ ":rtc_pc_config" ]
+
+ if (!build_with_chromium && is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+}
+
+rtc_static_library("rtc_pc_datachannel_only") {
+ sources = [
+ "channel.cc",
+ "channel.h",
+ "channelmanager.cc",
+ "channelmanager.h",
+ "mediasession.cc",
+ "mediasession.h",
+ ]
+
deps = [
+ ":rtc_pc_common",
"../api:call_api",
"../base:rtc_base",
- "../media",
+ "../media:rtc_media_datachannel_only",
]
- if (rtc_build_libsrtp) {
- deps += [ "//third_party/libsrtp" ]
+ if (!build_with_chromium && is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
+}
- public_configs = [ ":rtc_pc_config" ]
+rtc_static_library("rtc_pc") {
+ defines = [
+ "HAVE_WEBRTC_VOICE",
+ "HAVE_WEBRTC_VIDEO",
+ ]
+
+ sources = [
+ "channel.cc",
+ "channel.h",
+ "channelmanager.cc",
+ "channelmanager.h",
+ "mediasession.cc",
+ "mediasession.h",
+ ]
+
+ deps = [
+ ":rtc_pc_common",
+ "../api:call_api",
+ "../base:rtc_base",
+ "../media:rtc_media",
+ ]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
@@ -80,7 +120,7 @@ config("libjingle_peerconnection_warnings_config") {
}
}
-rtc_static_library("libjingle_peerconnection") {
+rtc_source_set("libjingle_peerconnection_common") {
cflags = []
sources = [
"audiotrack.cc",
@@ -100,10 +140,6 @@ rtc_static_library("libjingle_peerconnection") {
"mediastreamobserver.cc",
"mediastreamobserver.h",
"mediastreamtrack.h",
- "peerconnection.cc",
- "peerconnection.h",
- "peerconnectionfactory.cc",
- "peerconnectionfactory.h",
"remoteaudiosource.cc",
"remoteaudiosource.h",
"rtcstatscollector.cc",
@@ -141,12 +177,10 @@ rtc_static_library("libjingle_peerconnection") {
}
deps = [
- ":rtc_pc",
"../api:call_api",
"../api:rtc_stats_api",
"../api/video_codecs:video_codecs_api",
- "../call",
- "../media",
+ "../logging:rtc_event_log_api",
"../stats",
]
@@ -168,6 +202,56 @@ rtc_static_library("libjingle_peerconnection") {
}
}
+rtc_static_library("libjingle_peerconnection_datachannel_only") {
+ sources = [
+ "peerconnection.cc",
+ "peerconnection.h",
+ "peerconnectionfactory.cc",
+ "peerconnectionfactory.h",
+ ]
+
+ deps = [
+ ":rtc_pc_datachannel_only",
+ ]
+
+ public_deps = [
+ ":libjingle_peerconnection_common",
+ ]
+
+ if (!build_with_chromium && is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+}
+
+rtc_static_library("libjingle_peerconnection") {
+ defines = [
+ "HAVE_WEBRTC_VOICE",
+ "HAVE_WEBRTC_VIDEO",
+ ]
+
+ sources = [
+ "peerconnection.cc",
+ "peerconnection.h",
+ "peerconnectionfactory.cc",
+ "peerconnectionfactory.h",
+ ]
+
+ deps = [
+ ":rtc_pc",
+ "../call",
+ ]
+
+ public_deps = [
+ ":libjingle_peerconnection_common",
+ ]
+
+ if (!build_with_chromium && is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+}
+
if (rtc_include_tests) {
config("rtc_pc_unittests_config") {
# GN orders flags on a target before flags from configs. The default config
@@ -223,7 +307,7 @@ if (rtc_include_tests) {
}
}
- rtc_source_set("pc_test_utils") {
+ rtc_source_set("pc_test_utils_common") {
testonly = true
sources = [
"test/fakeaudiocapturemodule.cc",
@@ -243,8 +327,7 @@ if (rtc_include_tests) {
"test/testsdpstrings.h",
]
- deps = [
- ":libjingle_peerconnection",
+ public_deps = [
"../base:rtc_base_tests_utils",
"//testing/gmock",
]
@@ -255,6 +338,28 @@ if (rtc_include_tests) {
}
}
+ rtc_source_set("pc_datachannel_only_test_utils") {
+ testonly = true
+ deps = [
+ ":libjingle_peerconnection_datachannel_only",
+ ]
+
+ public_deps = [
+ ":pc_test_utils_common",
+ ]
+ }
+
+ rtc_source_set("pc_test_utils") {
+ testonly = true
+ deps = [
+ ":libjingle_peerconnection",
+ ]
+
+ public_deps = [
+ ":pc_test_utils_common",
+ ]
+ }
+
config("peerconnection_unittests_config") {
# The warnings below are enabled by default. Since GN orders compiler flags
# for a target before flags from configs, the only way to disable such
@@ -368,4 +473,64 @@ if (rtc_include_tests) {
shard_timeout = 900
}
}
+
+ rtc_test("peerconnection_datachannel_only_unittests") {
+ check_includes = false # TODO(kjellander): Remove (bugs.webrtc.org/6828)
+ testonly = true
+ sources = [
+ "peerconnectionendtoend_datachannel_only_unittest.cc",
+ ]
+
+ if (rtc_enable_sctp) {
+ defines = [ "HAVE_SCTP" ]
+ }
+
+ configs += [ ":peerconnection_unittests_config" ]
+
+ if (!build_with_chromium && is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+
+ # TODO(jschuh): Bug 1348: fix this warning.
+ configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
+
+ if (is_win) {
+ cflags = [
+ "/wd4245", # conversion from int to size_t, signed/unsigned mismatch.
+ "/wd4389", # signed/unsigned mismatch.
+ ]
+ }
+
+ deps = []
+ if (is_android) {
+ sources += [
+ "test/androidtestinitializer.cc",
+ "test/androidtestinitializer.h",
+ ]
+ deps += [
+ "//testing/android/native_test:native_test_support",
+ "//webrtc/sdk/android:libjingle_peerconnection_datachannel_only_jni",
+ "//webrtc/sdk/android:libjingle_peerconnection_java",
+ ]
+ }
+
+ deps += [
+ ":libjingle_peerconnection_datachannel_only",
+ ":pc_datachannel_only_test_utils",
+ "..:webrtc_common",
+ "../api:fakemetricsobserver",
+ "../base:rtc_base_tests_main",
+ "../base:rtc_base_tests_utils",
+ "../pc:rtc_pc_datachannel_only",
+ "../system_wrappers:metrics_default",
+ "//testing/gmock",
+ ]
+
+ if (is_android) {
+ deps += [ "//testing/android/native_test:native_test_support" ]
+
+ shard_timeout = 900
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698