Chromium Code Reviews| Index: webrtc/pc/BUILD.gn |
| diff --git a/webrtc/pc/BUILD.gn b/webrtc/pc/BUILD.gn |
| index 483485012da481803fe641f220ef643832af61bb..8f5d38ae691af637856a2fbc99b85dc9a77ccad8 100644 |
| --- a/webrtc/pc/BUILD.gn |
| +++ b/webrtc/pc/BUILD.gn |
| @@ -25,7 +25,7 @@ config("rtc_pc_config") { |
| } |
| } |
| -rtc_static_library("rtc_pc") { |
| +rtc_static_library("rtc_pc_base") { |
| defines = [] |
| sources = [ |
| "audiomonitor.cc", |
| @@ -56,7 +56,7 @@ rtc_static_library("rtc_pc") { |
| deps = [ |
| "../api:call_api", |
| "../base:rtc_base", |
| - "../media", |
| + "../media:rtc_data", |
| ] |
| if (rtc_build_libsrtp) { |
| @@ -71,6 +71,18 @@ rtc_static_library("rtc_pc") { |
| } |
| } |
| +# TODO(zhihuang): Remove this once the downstream dependencies start using the |
| +# modular targets. |
| +rtc_source_set("rtc_pc") { |
| + public_deps = [ |
| + ":rtc_pc_base", |
| + ] |
| + |
| + deps = [ |
| + "../media:rtc_audio_video", |
| + ] |
| +} |
| + |
| config("libjingle_peerconnection_warnings_config") { |
| # GN orders flags on a target before flags from configs. The default config |
| # adds these flags so to cancel them out they need to come from a config and |
| @@ -80,7 +92,93 @@ config("libjingle_peerconnection_warnings_config") { |
| } |
| } |
| -rtc_static_library("libjingle_peerconnection") { |
| +# This target contains the null implementation of the audio module and it is |
| +# used to build WebRTC without audio support. |
| +rtc_static_library("rtc_null_audio") { |
| + sources = [ |
| + "nullaudiofactory.cc", |
| + ] |
| + |
| + 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" ] |
| + } |
| +} |
| + |
| +# This target contains the real implementation of the audio module and it is |
| +# used to build WebRTC with audio support. It should never be used with |
| +# "rtc_null_audio" at the same time and it should always be linked with the |
| +# "rtc_media". |
| +rtc_static_library("rtc_audio") { |
| + sources = [ |
| + "audiofactory.cc", |
| + ] |
| + |
| + public_deps = [ |
| + "../media:rtc_audio_video", |
| + ] |
| + |
| + 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" ] |
| + } |
| +} |
| + |
| +# This target contains the null implementation of the audio/video related |
| +# objects and it is used to build WebRTC without audio and video support. |
| +rtc_source_set("rtc_null_media") { |
| + sources = [ |
| + "nullmediafactory.cc", |
| + ] |
| + |
| + 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" ] |
| + } |
| +} |
| + |
| +# This target contains the real implementation of the audio/video related |
| +# objects and it is used to build WebRTC with audio and video support. |
| +rtc_source_set("rtc_media") { |
| + deps = [ |
| + "../call", |
| + "../media:rtc_audio_video", |
| + ] |
| + |
| + 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" ] |
| + } |
| +} |
| + |
| +# The modular build targets can be used to build WebRTC with different |
| +# functionalities. The users can choose either the real implemenation |
| +# or the null implementation of the audio/video modules based on their |
| +# requirments. |
| +# |
| +# For example, to build WebRTC with datachannel support only, we would need the |
| +# the peerconnection and the null implementation of the audio and video modules. |
| +# |
| +# rtc_source_set("webrtc_datachannel_only") { |
| +# deps = [ |
| +# ":rtc_null_audio", |
| +# ":rtc_null_media", |
| +# ":rtc_peerconnection", |
| +# ] |
| +# } |
| +# |
| +# To build WebRTC with all the audio, video and datachannel support, we would |
| +# need the peerconnection and the real implementation of the audio and video |
| +# modules. |
| +# |
| +# rtc_source_set("webrtc_full") { |
| +# deps = [ |
| +# ":rtc_audio", |
| +# ":rtc_media", |
| +# ":rtc_peerconnection", |
| +# ] |
| +# } |
| +rtc_static_library("rtc_peerconnection") { |
| cflags = [] |
| sources = [ |
| "audiotrack.cc", |
| @@ -141,18 +239,28 @@ rtc_static_library("libjingle_peerconnection") { |
| } |
| deps = [ |
| - ":rtc_pc", |
| + ":rtc_pc_base", |
| "../api:call_api", |
| "../api:rtc_stats_api", |
| "../api/video_codecs:video_codecs_api", |
| - "../call", |
| - "../media", |
| + "../logging:rtc_event_log_api", |
| "../stats", |
| ] |
| public_deps = [ |
| "../api:libjingle_peerconnection_api", |
| ] |
| +} |
| + |
| +# TODO(zhihuang): Remove this once the downstream dependencies start using the |
| +# modular targets. |
| +rtc_source_set("libjingle_peerconnection") { |
|
Zhi Huang
2017/05/31 03:55:37
I think we might have to revert the changes here i
|
| + public_deps = [ |
| + ":rtc_audio", |
| + ":rtc_media", |
| + ":rtc_peerconnection", |
| + "../api:libjingle_peerconnection_api", |
| + ] |
| if (rtc_use_quic) { |
| sources += [ |
| @@ -244,7 +352,6 @@ if (rtc_include_tests) { |
| ] |
| deps = [ |
| - ":libjingle_peerconnection", |
| "../base:rtc_base_tests_utils", |
| "//testing/gmock", |
| ] |
| @@ -368,4 +475,65 @@ if (rtc_include_tests) { |
| shard_timeout = 900 |
| } |
| } |
| + |
| + rtc_test("peerconnection_datachannelonly_unittests") { |
| + testonly = true |
| + sources = [ |
| + "peerconnection_datachannelonly_unittest.cc", |
| + ] |
| + |
| + 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:base_jni", |
| + "//webrtc/sdk/android:libjingle_peerconnection_java", |
| + "//webrtc/sdk/android:null_audio_jni", |
| + "//webrtc/sdk/android:null_video_jni", |
| + ] |
| + } |
| + |
| + deps += [ |
| + ":pc_test_utils", |
| + ":rtc_null_audio", |
| + ":rtc_null_media", |
| + ":rtc_peerconnection", |
| + "..:webrtc_common", |
| + "../api:fakemetricsobserver", |
| + "../base:rtc_base_tests_main", |
| + "../base:rtc_base_tests_utils", |
| + "../modules/utility", |
| + "../pc:rtc_pc_base", |
| + "../system_wrappers:metrics_default", |
| + "//testing/gmock", |
| + ] |
| + |
| + if (is_android) { |
| + deps += [ "//testing/android/native_test:native_test_support" ] |
| + shard_timeout = 900 |
| + } |
| + } |
| } |